1998 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Help with super simple OrderModifier
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: | 258 Views |
-
Help with super simple OrderModifier

16 March 2012 at 9:42pm
Hey all,
Firstly, thanks for all the hard work everyone has been doing on the cart! looking great!
Please help.
All I want to do is create a custom Modifier that does nothing more than add $10 to the order Total. I dont need any ModifierForms etc etc... just add $10 to the total
I know, I know... this should be easy... I have the following:<?php
class ModifierExample extends OrderModifier {
protected function LiveName() {
return "Test";
}protected function LiveCalculatedTotal() {
return 10;
}public function LiveTableValue() {
return $this->LiveCalculatedTotal();
}
}and added correct line to _config
But i get the following error going to the checkout page:
[User Error] While the order can be edited, you must call the runUpdate method everytime you get the details for this modifierSessions cleared dev/build etc etc all done..
Sorry if I'm completely missing something stupid here... it's driving me nuts! Thanks in advance -
Re: Help with super simple OrderModifier

26 March 2012 at 1:15pm Last edited: 26 March 2012 1:16pm
Hi nimesodelta,
In the latest version of shop, this should be enough:
<?php
class ModifierExample extends OrderModifier {
function value() {
return 10;
}
}
...not tested though.
| 258 Views | ||
|
Page:
1
|
Go to Top |


