Perch Shop - Can't checkout

  • Hello,

    I have had this problem before, and could only reverse this with moving backwards to a very old backup.

    The problem is about the price of the products. When I give a product the price 59,99, so with a , and I add the product to cart, it adds with the price 59.00.

    When I give the product the price 59.99 with a . and I go to checkout, it won't proceed to checking out, and I get the following error in my debug:

    1. 0,0663 0,0002 INSERT INTO perch3_shop_orders(orderStatus,orderGateway,orderTotal,currencyID,orderItemsSubtotal,orderItemsTax,orderItemsTotal,orderShippingSubtotal,orderShippingDiscounts,orderShippingTax,orderShippingTaxDiscounts,orderShippingTotal,orderDiscountsTotal,orderTaxDiscountsTotal,orderSubtotal,orderTaxTotal,orderItemsRefunded,orderTaxRefunded,orderShippingRefunded,orderTotalRefunded,orderTaxID,orderShippingWeight,orderCreated,orderPricing,orderDynamicFields,customerID,shippingID,orderShippingTaxRate,orderBillingAddress,orderShippingAddress) VALUES('created','manual','59.99','44','59.99','0.00',59,99,'0.00','0.00','0.00','0.00','0.00','0.00','0.00',59,99,'0.00',0,0,0,0,NULL,'0.00','2019-11-23 17:10:38','standard','{\"terms_agreed\":\"true\"}','56',NULL,0,'391','392')
    2. 0,0665 0,0003 Invalid query: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1

    So for some reason, some bug happened, because a few days ago it did work and now when reverting to a working backup, I get the same errors. When trying to insert the order into the database, it does this with a , instead of a . as seen here:

    1. VALUES('created','manual','59.99','44','59.99','0.00',>>>>>>>>59,99<<<<<<<<<,'0.00','0.00','0.00','0.00','0.00','0.00','0.00',>>>>>>>>59,99<<<<<<<<<,'0.00',0,0,0,0,NULL,'0.00','2019-11-23 17:10:38','standard','{\"terms_agreed\":\"true\"}','56',NULL,0,'391','392')

    So now it is seen as too many fields getting inserted.

    EDIT: This happens with every gateway, even manual.

  • The problem is coming from PerchShop_Orders.class.php

    If I make a string from the orderItemsTotal and orderSubtotal it works. What would cause this problem from happening?