SQL error after updating to 3.0.1 from 2.6

  • Posts: 40
  • Thank you received: 1
  • Hikashop Business
7 years 7 months ago #266602

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6
-- Error-message(debug-mod must be tuned on) -- : The requested page can't be found.
Error: 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 ',,,,,,,,,,,,,,,,) ORDER BY a.ordering,b.characteristic_value' at line 1 SQL=SELECT a.*,b.* FROM j3tb_hikashop_variant AS a LEFT JOIN j3tb_hikashop_characteristic AS b ON a.variant_characteristic_id=b.characteristic_id WHERE a.variant_product_id IN (,,,,,,,,,,,,,,,,,) ORDER BY a.ordering,b.characteristic_value

Hello!

I installed an update to ver. 3. When I used 2.6 everything was perfect.
After a short research I found out that this error is displayed only on those pages where shopping cart module is published (when I unpublish the module, this error vanishes). The same error is also displayed on checkout page. Turning legacy options on also gives nothing.

So, I'm now forced to restore site backup with hikashop 2.6. Looking forward to the sollution.

Thanks!

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 7 months ago #266615

Hi,

That query was in the file administrator/components/com_hikashop/classes/cart.php
That whole file has been replaced with new code, and the old file content was moved to administrator/components/com_hikashop/classes/cart_legacy.php
The cart_legacy file is not used by HikaShop anymore.
That query is not anymore in administrator/components/com_hikashop/classes/cart.php
So in short, I don't see how you can have this query at all with HikaShop 3.0.1 unless the Joomla installer wasn't able to overwrite the file administrator/components/com_hikashop/classes/cart.php due you access right issues.
I would recommend to rename the whole folder administrator/components/com_hikashop/ before running the update process so that the installer wouldn't have any access right issues so that the file administrator/components/com_hikashop/classes/cart.php can be updated.

The following user(s) said Thank You: rndm

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

  • Posts: 40
  • Thank you received: 1
  • Hikashop Business
7 years 7 months ago #267069

Thanks, Nicolas!

it's working!

But I have some other issues now.

1) When I use "hide if empty" option in cart module, cart content isn't shown, but the module's title remains. In hikashop v2 the title was hidden too.
2) When adding the same product several times, they come into the shopping cart as separate products instead of product quantity being updated (it also worked in v2). It looks weird, see the pic 1.
3) For some reason adding a product to cart is taking ridiculously much time in both normal and legacy modes. Now, after pressing "add to cart" button, nothing happens for 5-7 seconds. I restored hikashop v2.6 and checked again - it takes for sure less than a second to add a product to the cart.

Thank you in advance!

Attachments:

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 7 months ago #267073

Hi,

1. Yes. We had to change that since otherwise, the cart module cannot be refreshed by the AJAX process when a product is added to the cart and that the cart is empty. However, regarding the title, you can turn off the display of the title of the module. And if you want to display it only when the module has content, then you can add it in the file "cart" of the view "product".

2. & 3. We don't have that on our end. Is it for all the products ? Could you provide a link to a page where we can look at the issue ?

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

  • Posts: 40
  • Thank you received: 1
  • Hikashop Business
7 years 7 months ago #267419

2,3)
It is for all products.

Sorry for delay, I was trying to catch a moment when that mentioned slowing down begins.
I should add: firstly, this speed drop is seen not only while adding a product to cart. If a have a product in cart and if the cart module is displayed on a page, than the whole page is loaded slowly. Even if this is static single article page. I recorded a short video as a proof.
https://www.youtube.com/watch?v=YWhxM7XP-Yo
Secondly, if I add products to cart as a guest user, everything is fine whatever else I do. The situation described above happens only when I'm logged in.

Situation №2 happens regardless of any conditions.

Here are examples of products:
https://phyton.com/categories/product/AE-P20U
https://phyton.com/categories/product/CPI2-B1

Last edit: 7 years 7 months ago by rndm.

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

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

Hello,

If we need to have an access to your admin ; we will ask for it.
And if we need that access, we will ask you to send it through the "contact us" form and not put it in a forum message !

Please understand that it is your website and it is your responsibility to maintain his security.
We cannot be responsible if you have been hack because you leave some credentials in a forum ; even if you use a "confidential" tag.

It is for your own protection, so please never do that again.

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: 40
  • Thank you received: 1
  • Hikashop Business
7 years 7 months ago #267492

Ok.

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

  • Posts: 40
  • Thank you received: 1
  • Hikashop Business
7 years 7 months ago #267628

So, any ideas?..

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 7 months ago #267662

Hi,

The account you provided didn't allow us to access your backend:
monosnap.com/file/Q7uI2CiYJveDGdYsJHE9bMKiJXTTLz

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 7 months ago #267794

Hi,

Thank you for the new account access. It worked now. I was actually able to find that the issue came from the custom item fields you have. The custom text custom fields were not handled properly in the new cart and thus, the system was thinking that the product added to the cart had different custom item fields than the one already in the cart for these custom fields.

I've added a patch on our end for that. Download the install package on our website and install it on yours and that will add the patch for it.

The following user(s) said Thank You: rndm

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

  • Posts: 40
  • Thank you received: 1
  • Hikashop Business
7 years 7 months ago #267837

Hi!
Great, it's perfect now!

But slow page loading issue remains.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 7 months ago #267843

Hi,

When I'm logged out on your website, I don't have the problem. Between the moment I press add to cart on your product pages and the moment I see the blue notification on the top right corner of your website, it takes less than a second. It's actually faster than when I do it on my local test website...
However, when I'm logged in on your website frontend with the test user account you provided, I do indeed see that it takes a few seconds. In fact, even the login process itself, which isn't linked to HikaShop takes a few seconds.
We would need to analyze the MySQL queries on the add to cart request to be able to say why it does that.
Could you provide a FTP access via our contact form along with a link to this thread so that we could have a greater look into it ?

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

  • Posts: 40
  • Thank you received: 1
  • Hikashop Business
7 years 7 months ago #267909

nicolas wrote: Hi,
In fact, even the login process itself, which isn't linked to HikaShop takes a few seconds.

Login process takes usual ~1 second, if I have no products in cart before logging in and the registered user doesn't have products in cart from previous sessions.

I left a message via contact form with ftp account details.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 7 months ago #268153

Hi,

Thank you for the access.
Thanks to it, we were able to understand why this happens.

The delay is actually caused by the connection delay between your server and Fedex's shipping rates service.
When a product is added to the cart, the products in the cart change, which invalidates the shipping method of the cart. Thus, HikaShop automatically ask the shipping plugins to recalculate the shipping rates so that it can updates the shipping method selected and its fee on the cart.
That also explains why it only happens when you're logged in since when you're not logged in, the Fedex plugin doesn't have your address and thus cannot have the rates recalculated.

So unfortunately, I can't provide some code fix to your problem as the problem is the speed between the server and Fedex.

The following user(s) said Thank You: rndm

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 7 months ago #268160

Hi,

Note that you can also reduce the number of services that you selected in your Fedex shipping method. That will reduce the number of back and forth between your website and Fedex and should greatly help if you selected all of them but that you actually only use 2 or 3.

The following user(s) said Thank You: rndm

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

  • Posts: 40
  • Thank you received: 1
  • Hikashop Business
7 years 7 months ago #268162

Hello, Nicolas!

I really appreciate that you managed to find the reason.

But this problem appeared only after upgrading to v.3.0.1. I have been using v.2.6 for 1.5 years with same number of shipping services, same cart module options etc, and there were no delays. As I remember the cart module in v.2.6 worked the same way - shipping costs were dynamically recalculated too. So, weren't there any code changes which lead to these delays?..

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

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

Hello,

There are some differences between HikaShop 3 and HikaShop 2 (for sure, HikaShop 3 is a major release).

About the cart, HikaShop 3 can know handle the shipping almost everywhere ; when the shipping methods were mostly only loaded during the checkout in HikaShop 2.6.
Because of the shipping cache, it is not something problematic ; and with your HikaShop 2.6 you had the exact same Fedex API calls but it was not on the same "page".

Now, it might be possible to see to if we can exclude the shipping API calls when a product is added to the cart but at the end, it will not really solve the problem, it will just "deport" it.
Because even if the API calls are not made when the cart is updated (by ajax), the next page will automatically do these API calls. It could be the dynamic refresh of the cart module or any other action which will have a link with (or need) the cart.

HikaShop 3 does not change the time that your server need to get the shipping quotes ; it just perform them at a different moment than HikaShop 2.6.

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: 195
  • Thank you received: 5
  • Hikashop Business
7 years 6 months ago #269798

We are having similar issues on our site ( www.cmdnet.org ).

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 ',,,,,,,,,,,,,,,,) ORDER BY a.ordering,b.characteristic_value' at line 1

However, after renaming the administrator/components/com_hikashop folder, then re-installing 3.0.1 we are still getting the error.
I've ensured that the cache have all been disabled and tested several times with same results.

Also, one thing that I've noticed is that even though I set the cart to offline in admin, clicking the link to the main category display results in this error (I guess the error is being thrown before any other processes).

Any ideas?

We are using:
Joomla 3.7.1
DB: 5.5.52
PHP: 7.0.17

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

  • Posts: 195
  • Thank you received: 5
  • Hikashop Business
7 years 6 months ago #269800

Update ... I just found that this is also an issue for the Hikashop Cart MODULE.
After renaming the module folder and then re-installing again, it fixed that (on a 'store offline' manual article page that we created earlier).
However, even after renaming the module, then reinstalling the checkout process is still not working.

I'm going to test further to see if other modules might be causing the issue.

Strange why this is happening now. Never had a problem with any other HS upgrades.

BTW ... I checked the admin cart.php file and it (and everything in that folder) were set with 644 access.

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

  • Posts: 40
  • Thank you received: 1
  • Hikashop Business
7 years 6 months ago #269802

Hello!
I found out that there were two identical sql errors. One was caused by rights issues - as nicolas said, joomla wasn't able to overwrite some files.
The other was spawned by awocoupon component and was fixed after updating this coupon component. Don't you have any 3d party components which work with HS?..

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

Time to create page: 0.102 seconds
Powered by Kunena Forum