VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: snstfd on August 31, 2016, 17:37:45 PM

Title: Cart Error: 1064 You have an error in your SQL syntax;
Post by: snstfd on August 31, 2016, 17:37:45 PM
In the checkout at the top of the page is a save button. I'm not even sure why it is there but when I hit it, it produces the following 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 '' at line 3 SQL=SELECT mf_name FROM #__virtuemart_manufacturers_en_gb WHERE virtuemart_manufacturer_id =

I have included the screenshot of the button.

I'm not sure if this is relevant but we have store locations set up as manufacturers so they can pick which store they are ordering from. Those locations do not appear in the pull down menu shown under "cart" in the attachment. The main name of the store which is also our company name does appear. 


Joomla version, 3.6.2.
VirtueMart 3.0.16



Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: GJC Web Design on August 31, 2016, 17:58:43 PM
rule 1!!!

don't test ANYTHING front end as an administrator!
Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: snstfd on August 31, 2016, 18:05:22 PM
I am not sure that applies. I tested in several browsers which I do not use to log in to the CMS so I don't think that would apply but it's a good rule I will keep in mind.

You should be able to reproduce the error here:

dev.sunsetfoods.com/cart

or www.sunsetfoods.com/cart
Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: GJC Web Design on August 31, 2016, 18:14:23 PM
is this multi vendor????

afaik this is

// This displays the form to change the current shopper
   if ($this->allowChangeShopper){
      echo $this->loadTemplate ('shopperform');
   }

and set in admin by

Allow Administrators to change the current Shopper   

so should only show for admins


Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: snstfd on August 31, 2016, 18:21:23 PM
Thank you for your follow up. I have attached a screenshot of what is selected in the back-end.

Enable Multi-vendor: administrated multi-vendor
Multi-vendor cart handling: Selectable by user

Are those the correct settings?

Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: GJC Web Design on August 31, 2016, 19:19:19 PM
I don't know.. I have never used multi vendor

http://docs.virtuemart.net/manual/general-concepts/211-multivendor.html
Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: snstfd on August 31, 2016, 23:16:35 PM
This is a SQL Syntax error - not VM
Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: GJC Web Design on September 01, 2016, 00:29:10 AM
I agree.. but my question is why is this form shown to non admins?

I have never seen it on my installs
Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: Milbo on September 01, 2016, 19:13:16 PM
Quote from: GJC Web Design on August 31, 2016, 17:58:43 PM
rule 1!!!

don't test ANYTHING front end as an administrator!

Of course, you should test as guest, registered and also administrator.

snstfd, the multivendor setup looks correct. Can you copy paste the sql error?
Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: GJC Web Design on September 01, 2016, 19:16:40 PM
Quotedon't test ANYTHING front end as an administrator!

I meant when testing your shop as a user..  have seen this so many times by clients asking why they see different elements and options from std. and the reason is they are using their super admin login as a normal shopper on the FE
Of course use admin IF u want to test as an admin
Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: sgrunch on May 17, 2017, 17:22:32 PM
same problem after update to 3.22 with J 3.71 product detail page:
'ASC FROM `#__virtuemart_products` as p INNER JOIN `#__virtuemart_products_it


Title: Re: Cart Error: 1064 You have an error in your SQL syntax;
Post by: Milbo on May 17, 2017, 17:46:10 PM
That is the neighboured product function, please read here http://forum.virtuemart.net/index.php?topic=137501.msg481450#msg481450