1999 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Weight Based Shipping
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1871 Views |
-
Weight Based Shipping

8 June 2009 at 11:32am
Has anyone gotten weight based shipping to work?
It looks like you need to use an array to pass the weight and price values, however there is no example code that demonstrates how it should be done?
/**
* Calculates the shipping cost of an order, by taking the products
* and calculating the shipping weight, based on an array set in _config
* ASSUMPTION: The total order weight can be at maximum the last item
* in the $shippingCosts array.
*/Any clues / ideas?
Thanks in advance
-Ross -
Re: Weight Based Shipping

15 July 2009 at 3:57am
Did you got ecommerce module working with weight based shipping?
-
Re: Weight Based Shipping

21 July 2009 at 3:22am
I'm tried to put this code in config file:
WeightShippingModifier::shippingCosts(array(
'1' => 15,
'3' => 30,
'5' => 50,
));but it doesn't worked.
Has anybody ideas or example how to ser weight based shipping?
-
Re: Weight Based Shipping

21 July 2009 at 1:01pm
Hi
So that we can help you, please post a bit more information:
- what is not working?
- what error do you get?
- what version of SS / ecommerce are you running?
- how do you know you have an error?
- have you done a dev/build/?flush=1 and cleared all your cookies (important for ecommerce)?
Cheers
Nicolaas
- what is not working?
-
Re: Weight Based Shipping

21 July 2009 at 9:08pm Last edited: 22 July 2009 8:59pm
Sorry, here is more information.
When I'm trying to set Weight based shipping array (see code above), I get this error message: Fatal error: Call to undefined method WeightShippingModifier::shippingcosts() in /var/www/vhosts/sandie.dev.bluwcreative.com/httpdocs/mysite/_config.php on line 111
I used class "shippingcosts" because it was on the documentation:
* Calculates the shipping cost of an order, by taking the products
* and calculating the shipping weight, based on an array set in _config
*
* ASSUMPTION: The total order weight can be at maximum the last item
* in the $shippingCosts array."Maybe this array code is wrong and I should use another class from WeightShippingModifier.php ?
Thanks for any help!
My System:
ecommerce 0.6 beta 1
silverstripe 2.3.2 (stable version)
php 5.2.9
mysql 5.0.83
apache 2 -
Re: Weight Based Shipping

22 July 2009 at 7:45pm
ok, so what you want to do is to find the class WeightShippingModifier and see what static methods are available. I imagine that the module has been changed but that the documentation has not been updated yet. Let us know how that goes.
-
Re: Weight Based Shipping

22 July 2009 at 9:01pm
I didn't found there any static method (see attached file).
-
Re: Weight Based Shipping

22 July 2009 at 9:25pm
those modifiers actually dont make any sense....
have a look here:
http://open.silverstripe.com/browser/modules/ecommerce/trunk/code/modifiers/SimpleShippingModifier.phpI think you will have to write your own shipping modifier for the time being as they seem incomplete. Simple Shipping M. makes a good start and so does Weight Shipping, but you really need a combination of the two. It makes me wonder if the WSM should actually extend the SimpleShippingModifier.
You would be better off writing your own modifier using ideas from those two files.
Cheers
Nicolaas
| 1871 Views | ||
|
Page:
1
|
Go to Top |

