Jump to:

2082 Posts in 1002 Topics by 452 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Error on check out

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: 1016 Views
  • Bambii7
    Avatar
    Community Member
    254 Posts

    Error on check out Link to this post

    Hey all,
    Anyone experienced an error after submitting the order form?
    Maybe I don't have my configuration set up correctly, getting it on two different set ups. The error isn't too helpful

    Website Error
    There has been an error

    The website server has not been able to respond to your request.

  • Bambii7
    Avatar
    Community Member
    254 Posts

    Re: Error on check out Link to this post

    Setting the site to dev mode revealed the sql error

    Looks like its happening inside the recalculate_numbersold() function around line 114 of Product.php

    [User Error] Couldn't run query: SELECT "SiteTree"."ClassName", "SiteTree"."Created", "SiteTree"."LastEdited", "SiteTree"."URLSegment", "SiteTree"."Title", "SiteTree"."MenuTitle", "SiteTree"."Content", "SiteTree"."MetaTitle", "SiteTree"."MetaDescription", "SiteTree"."MetaKeywords", "SiteTree"."ExtraMeta", "SiteTree"."ShowInMenus", "SiteTree"."ShowInSearch", "SiteTree"."HomepageForDomain", "SiteTree"."ProvideComments", "SiteTree"."Sort", "SiteTree"."HasBrokenFile", "SiteTree"."HasBrokenLink", "SiteTree"."Status", "SiteTree"."ReportClass", "SiteTree"."CanViewType", "SiteTree"."CanEditType", "SiteTree"."ToDo", "SiteTree"."Version", "SiteTree"."Priority", "SiteTree"."ParentID", "Page"."SubMenu", "Page"."PlaceInFooter", "Product"."Price", "Product"."Weight", "Product"."Model", "Product"."FeaturedProduct", "Product"."AllowPurchase", "Product"."InternalItemID", "Product"."NumberSold", "Product"."ImageID", "SiteTree"."ID", CASE WHEN "SiteTree"."ClassName" IS NOT NULL THEN "SiteTree"."ClassName" ELSE 'SiteTree' END AS "RecordClassName", SUM(OrderItem.Quantity) AS NewNumberSold FROM "SiteTree" LEFT JOIN "Page" ON "Page"."ID" = "SiteTree"."ID" LEFT JOIN "Product" ON "Product"."ID" = "SiteTree"."ID" LEFT JOIN "Product_OrderItem" ON Product.ID = Product_OrderItem.ProductID LEFT JOIN "OrderItem" ON Product_OrderItem.ID = OrderItem.ID WHERE ("SiteTree"."ClassName" IN ('Product')) AND (`Product`.`AllowPurchase` IS TRUE) GROUP BY Product.ID ORDER BY NewNumberSold DESC You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRUE) GROUP BY Product.ID ORDER BY NewNumberSold DESC' at line 1

  • Bambii7
    Avatar
    Community Member
    254 Posts

    Re: Error on check out Link to this post

    This error is related to the current release of ecommerce module found here http://silverstripe-ecommerce.googlecode.com/svn/trunk/

    Line 117 of Product.php
    $q = $ps->buildSQL("`Product`.`AllowPurchase` IS TRUE");

    should be
    $q = $ps->buildSQL("`Product`.`AllowPurchase` = 1");

    Silver Stripe seems to be formatting declared datatypes of Boolean as tinyint(1) in the database, I assume that why 'is true' results in error.

    1016 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.