Jump to:

2076 Posts in 857 Topics by 449 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Uncaught Exception on "total" DataObjectSet

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

Page: 1
Go to End
Author Topic: 609 Views
  • Mrfixer
    Avatar
    Community Member
    49 Posts

    Uncaught Exception on "total" DataObjectSet Link to this post

    SS 2.4.5
    ecommerce v0.81

    Heres a wierd error that im getting with ecommerce v0.81, it did work fine up until tonight, had a week off and added the featured products widget and right away i got this error when adding a product to cart:

    Uncaught Exception: Object->__call(): the method 'total' does not exist on 'DataObjectSet'

    i removed the widget thinking this could have been a cause, ran a /dev/build and a ?flush=all to clear anything left behind and im still getting it, i can trace it to here in ecommerce/code/model/order.php

    function ModifiersSubTotal($excluded = null, $onlyprevious = false) {
    $total = 0;

    if($modifiers = $this->Modifiers()) {
    foreach($modifiers as $modifier) {
    if(is_array($excluded) && in_array($modifier->class, $excluded)) {
    if($onlyprevious)
    break;
    continue;
    } elseif($excluded && ($modifier->class == $excluded)) {
    if($onlyprevious)
    break;
    continue;
    }

    $total += $modifier->Total();
    }
    }

    return $total;
    }


    like i said it was working before, so im pretty stumped on how to get iy working again, any thoughts?
    TY

  • Mrfixer
    Avatar
    Community Member
    49 Posts

    Re: Uncaught Exception on "total" DataObjectSet Link to this post

    Just an update, luckily enough this is just a thing im bashing about with at home (while im learning how to get to grips SS), after a few hours of searching and stuff i decided to copy my mysite folder, theme folder,payments and ecommerce modules and run a new install and then overwrite into the new folder, working ok now (also added the Featured prods widget with no issues this time).. but if any one knows what would have caused the error in the first place i would appreciate a heads up on that.. regards

  • Mrfixer
    Avatar
    Community Member
    49 Posts

    Re: Uncaught Exception on "total" DataObjectSet Link to this post

    And another update, theres definatly a problem with widgets and this error, today it happened again when testing a widget i had knocked up for "popular products" this error happened again when trying to add an item into the cart, was racking my brains again trying to get aways round it, anyway after a couple of hours i deletedthe fields inside the widget and widgetarea tables in the database and now all is good again

    609 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.