Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Ecommerce error: must call the runUpdate method everytime you get the details for this modifier


Reply


3 Posts   805 Views

Avatar
Anatol

126 Posts

12 August 2011 at 2:09pm

Edited: 12/08/2011 2:13pm

Hi forum,

I installed the latest ecommerce module (together with the ecommerce_product_variation, payment modules and the featured products widget). My current versions are

ecommerce: r1284
ecommerce_product_variation : r1409
payment: build date 21 July 2011 ( http://silverstripe.org/assets/modules/master/silverstripe-payment-master-HEAD.tar.gz )

I had an earlier version of the ecommerce module installed on my development site before and it worked well (before the product variations became a separate module). Now I always have a problem with the checkout page:

[User Error] While the order can be edited, you must call the runUpdate method everytime you get the details for this modifier

I just can't find the problem. When I add a product to the cart it is nicely displayed in the cart sidebar, but I did notice that the "Cart" page is empty (no products appear).

The only modifier I have enabled at the moment is the SimpleShippingModifier, but removing that doesn't change anything. I also tried to completely remove all ecommerce related pages from the CMS and I removed all ecommerce, payment, etc. database tables for a "fresh" install but to no avail.

Anyway, if anyone has any hint I would be very grateful. Here is the complete trace:

--------
Line 241 in /path/to/ecommerce/code/model/OrderModifier.php

Source

232 // ######################################## *** template functions (e.g. ShowInTable, TableTitle, etc...)
233
234    /**
235    * tells you whether the modifier shows up on the checkout / cart form.
236    * this is also the place where we check if the modifier has been updated.
237    *@return Boolean
238    **/
239    public function ShowInTable() {
240       if(!$this->baseInitCalled && $this->canBeUpdated()) {
241          user_error("While the order can be edited, you must call the runUpdate method everytime you get the details for this modifier", E_USER_ERROR);
242       }
243       return false;
244    }
245
246    /**
247    * some modifiers can be hidden after an ajax update (e.g. if someone enters a discount coupon and it does not exist).

Trace

  • While the order can be edited, you must call the runUpdate method everytime you get the details for this modifier
    Line 241 of OrderModifier.php

  • OrderModifier->ShowInTable()
    Line 369 of ViewableData.php

  • ViewableData->obj(ShowInTable,,,1,)
    Line 411 of ViewableData.php

  • ViewableData->cachedCall(ShowInTable,)
    Line 424 of ViewableData.php

  • ViewableData->hasValue(ShowInTable,,1)
    Line 3559 of DataObject.php

  • DataObject->hasValue(ShowInTable)
    Line 254 of .cache.themes.mytheme_ecommerce.templates.Layout.CheckoutPage.ss

  • include(/tmp/silverstripe-cache-home-myuser-mysite-html/.cache.themes.mytheme_ecommerce.templates.Layout.CheckoutPage.ss)
    Line 420 of SSViewer.php

  • SSViewer->process(CheckoutPage_Controller,Zend_Cache_Frontend_Output)
    Line 411 of SSViewer.php

  • SSViewer->process(CheckoutPage_Controller)
    Line 202 of Controller.php

  • Controller->handleAction(SS_HTTPRequest)
    Line 143 of RequestHandler.php

  • RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php

  • Controller->handleRequest(SS_HTTPRequest)
    Line 199 of ContentController.php

  • ContentController->handleRequest(SS_HTTPRequest)
    Line 184 of ContentController.php

  • ContentController->handleRequest(SS_HTTPRequest)
    Line 67 of ModelAsController.php

  • ModelAsController->handleRequest(SS_HTTPRequest)
    Line 282 of Director.php

  • Director::handleRequest(SS_HTTPRequest,Session)
    Line 125 of Director.php

  • Director::direct(/shop/checkout/)
    Line 127 of main.php

------------

Thank you!
Anatol

Avatar
Anatol

126 Posts

12 August 2011 at 2:18pm

Edited: 12/08/2011 2:19pm

Just to add that, I tested to remove the red line above from /ecommerce/code/model/OrderModifier.php and all looks OK, but I'm wondering if this will not create any other problems... I just don't really know what this line does or what runUpdate() really does.

Avatar
Jedateach

Forum Moderator, 232 Posts

15 August 2011 at 12:20pm

Hi Anatol,

I'm assuming you're making use of trunk code, and I'm also going to recommend using the branches/0.8 branch...or 0.8.x tags.

That runUpdate function was introduced when changing the way the modifiers are introduced for an order. I believe the function should be run every time the order total needs to be re-caclulated.

The modifiers system needs some serious review to be honest, and I have plans to do so.

regards,
Jeremy