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

Error on check out


Reply


3 Posts   1075 Views

Avatar
Bambii7

Community Member, 254 Posts

15 July 2010 at 11:18am

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.

Avatar
Bambii7

Community Member, 254 Posts

15 July 2010 at 1:53pm

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

Avatar
Bambii7

Community Member, 254 Posts

15 July 2010 at 3:16pm

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.