SQL 1064 Error in Cart Module

  • Posts: 7
  • Thank you received: 0
9 years 7 months ago #198338

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.3.29
-- Error-message(debug-mod must be tuned on) -- : 1064 - 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 'and b.price_value > 0' at line 1 SQL=SELECT count(*) as total FROM pescaTestDB_hikashop_product as a LEFT JOIN pescaTestDB_hikashop_price as b ON b.price_product_id = a.product_id WHERE a.product_type = 'variant' and a.product_parent_id = and b.price_value > 0

Hi,

I don`t know if this is the correct forum category. Sorry for the inconvenience.

An SQL error arise when I enable a cart module:

1064 - 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 'and b.price_value > 0' at line 1 SQL=SELECT count(*) as total FROM pescaTestDB_hikashop_product as a LEFT JOIN pescaTestDB_hikashop_price as b ON b.price_product_id = a.product_id WHERE a.product_type = 'variant' and a.product_parent_id = and b.price_value > 0.


If you check last 5 words you can watch that there is an "and" between 'a.product_parent_id =' and 'b.price_value > 0' so there should be some data before the 'and'.

Best Regards

Last edit: 9 years 7 months ago by JoseAlvarez.

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
9 years 7 months ago #198339

Hi,

What product are you adding in the cart ?
The SQL error you got is because HikaShop is trying to load variants for a product but there is no product id in the query ; the value for "a.product_parent_id = " is missing.
So it will be interesting to know when this issue is displayed in order to see more about the targeting product.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 0
9 years 7 months ago #198423

Hi,

There is no product in the cart. I just created a cart module, positioned it and activated it in Joomla. You can see the error here: test.pescanocheydia.com/tienda.html

PS: There is no view overrides.

Last edit: 9 years 7 months ago by JoseAlvarez.

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 7 months ago #198441

Hi,

We do not see that error on that page:
take.ms/5CvWx
That's why we asked what you were doing so that we could reproduce the problem.
We were also unable to locate the query in the code of the latest version of HikaShop. It would seems to be as if you were not using the latest version of HikaShop or if this query was coming from something else than HikaShop.
Do you have other extensions related to HikaShop installed on your website ?

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 0
9 years 7 months ago #198569

Hi,

I don`t understand what is happening :( Have a look: prntscr.com/6tnoy0

That is all I can see. If I disable cart module, it works perfectly. There is just one more extensions: S5 Flex Menu

Best Regards.

Last edit: 9 years 7 months ago by JoseAlvarez.

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 7 months ago #198630

Hi,

If you turn on the "error reporting" and "debug" mode of the Joomla configuration, do you get a better error message, with more information ? That would help us understand the issue.

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 0
9 years 7 months ago #198676

Yap. Debug mode is turn on. I do not konw if you can see the error (inexplicable, really strange) so I send you the error report as attachment.

Best regards

File Attachment:

File Name: error_1064.zip
File Size:326 KB

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 7 months ago #198737

Hi,

Great, that was what we needed.
See this screenshot: take.ms/nA4SQ
The error indicates that the problem comes from a MySQL query which is done in a view override in your template.
So that's why we couldn't find that query on our end.
Rename the file templates/design_control/html/com_hikashop/product/listing_price.php to something else via FTP and that will deactivate the customization done in this view file so that it uses the standard display of HikaShop and you won't have the error and it will work.
Then, I would recommend that you contact the support of your template or the person who customized that view file for you so that they can provide a fix to their code and potentially fix the template for others.

The following user(s) said Thank You: JoseAlvarez

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 0
9 years 7 months ago #198814

Hi,

Yes, You're right. I suppose listing_price.php code has been changed.

Thank you very much.

Please Log in or Create an account to join the conversation.

Time to create page: 0.071 seconds
Powered by Kunena Forum