VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: MrWizard516 on April 22, 2012, 00:55:01 AM

Title: Cannot get VM2 to display payment methods.
Post by: MrWizard516 on April 22, 2012, 00:55:01 AM
I am not sure if this should be posted here or else where but here goes.

I am having an issues with VM 2.0.6. It doesn't display the payment methods in the frontend. I have 2 methods setup and I am pretty sure I did them correctly. If I go to the shopping cart and click on the payment methods link all it shows is:


Checkout Step 3
Please select a payment method

I get the following error when logged in:

        vmError: Error reading getPluginMethods 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 'ORs.`virtuemart_shoppergroup_id`= "2" ORs.`virtuemart_shoppergroup_id`= "3" OR (' at line 4 SQL=SELECT l.*, v.*, j.`extension_id`,j.`name`, j.`type`, j.`element`, j.`folder`, j.`client_id`, j.`enabled`, j.`access`, j.`protected`, j.`manifest_cache`, j.`params`, j.`custom_data`, j.`system_data`, j.`checked_out`, j.`checked_out_time`, j.`state`, s.virtuemart_shoppergroup_id FROM `yfqr2_virtuemart_paymentmethods_en_gb` as l JOIN `yfqr2_virtuemart_paymentmethods` AS v USING (`virtuemart_paymentmethod_id`) LEFT JOIN `yfqr2_extensions` as j ON j.`extension_id` = v.`payment_jplugin_id` LEFT OUTER JOIN `yfqr2_virtuemart_paymentmethod_shoppergroups` AS s ON v.`virtuemart_paymentmethod_id` = s.`virtuemart_paymentmethod_id` WHERE v.`published` = "1" AND j.`element` = "standard" AND (v.`virtuemart_vendor_id` = "1" OR v.`virtuemart_vendor_id` = "0") AND (s.`virtuemart_shoppergroup_id`= "1" ORs.`virtuemart_shoppergroup_id`= "2" ORs.`virtuemart_shoppergroup_id`= "3" OR (s.`virtuemart_shoppergroup_id`) IS NULL ) ORDER BY v.`ordering`
        vmError: Error reading getPluginMethods 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 'ORs.`virtuemart_shoppergroup_id`= "2" ORs.`virtuemart_shoppergroup_id`= "3" OR (' at line 4 SQL=SELECT l.*, v.*, j.`extension_id`,j.`name`, j.`type`, j.`element`, j.`folder`, j.`client_id`, j.`enabled`, j.`access`, j.`protected`, j.`manifest_cache`, j.`params`, j.`custom_data`, j.`system_data`, j.`checked_out`, j.`checked_out_time`, j.`state`, s.virtuemart_shoppergroup_id FROM `yfqr2_virtuemart_paymentmethods_en_gb` as l JOIN `yfqr2_virtuemart_paymentmethods` AS v USING (`virtuemart_paymentmethod_id`) LEFT JOIN `yfqr2_extensions` as j ON j.`extension_id` = v.`payment_jplugin_id` LEFT OUTER JOIN `yfqr2_virtuemart_paymentmethod_shoppergroups` AS s ON v.`virtuemart_paymentmethod_id` = s.`virtuemart_paymentmethod_id` WHERE v.`published` = "1" AND j.`element` = "authorizenet" AND (v.`virtuemart_vendor_id` = "1" OR v.`virtuemart_vendor_id` = "0") AND (s.`virtuemart_shoppergroup_id`= "1" ORs.`virtuemart_shoppergroup_id`= "2" ORs.`virtuemart_shoppergroup_id`= "3" OR (s.`virtuemart_shoppergroup_id`) IS NULL ) ORDER BY v.`ordering`
        vmError: Error reading getPluginMethods 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 'ORs.`virtuemart_shoppergroup_id`= "2" ORs.`virtuemart_shoppergroup_id`= "3" OR (' at line 4 SQL=SELECT l.*, v.*, j.`extension_id`,j.`name`, j.`type`, j.`element`, j.`folder`, j.`client_id`, j.`enabled`, j.`access`, j.`protected`, j.`manifest_cache`, j.`params`, j.`custom_data`, j.`system_data`, j.`checked_out`, j.`checked_out_time`, j.`state`, s.virtuemart_shoppergroup_id FROM `yfqr2_virtuemart_paymentmethods_en_gb` as l JOIN `yfqr2_virtuemart_paymentmethods` AS v USING (`virtuemart_paymentmethod_id`) LEFT JOIN `yfqr2_extensions` as j ON j.`extension_id` = v.`payment_jplugin_id` LEFT OUTER JOIN `yfqr2_virtuemart_paymentmethod_shoppergroups` AS s ON v.`virtuemart_paymentmethod_id` = s.`virtuemart_paymentmethod_id` WHERE v.`published` = "1" AND j.`element` = "paypal" AND (v.`virtuemart_vendor_id` = "1" OR v.`virtuemart_vendor_id` = "0") AND (s.`virtuemart_shoppergroup_id`= "1" ORs.`virtuemart_shoppergroup_id`= "2" ORs.`virtuemart_shoppergroup_id`= "3" OR (s.`virtuemart_shoppergroup_id`) IS NULL ) ORDER BY v.`ordering`



Any help with this would be most appreciated. Thanks in advance.
Title: Re: Cannot get VM2 to display payment methods.
Post by: rethinkmarketing on April 22, 2012, 02:26:19 AM
I'm having a similar issue with shippment methods, butound that it was related to the onepage checkout module I purchased from linelabs.org.

It works for logged in users but no for unregistered users.


The problem lies in the scripting, but I haven't been able to resolve it yet
Title: Re: Cannot get VM2 to display payment methods.
Post by: MrWizard516 on April 23, 2012, 11:47:40 AM
Looks like I am going to have to experiment and try to figure out for my self what is.causing my issue since apparently no one else is having the same issue.
Title: Re: Cannot get VM2 to display payment methods.
Post by: MrWizard516 on April 26, 2012, 21:15:42 PM
Whats the point of these forums if we can't get a solution to our problems? It seems that there are several people with the same issues and no answers thus far.
Title: Re: Cannot get VM2 to display payment methods.
Post by: PRO on April 26, 2012, 21:56:15 PM
MrWizard516,

what payment method? and are you sure all the files were uploaded when you upgraded?

did you do the "install or update tables"

Title: Re: Cannot get VM2 to display payment methods.
Post by: MrWizard516 on April 30, 2012, 11:34:44 AM
I have ALL updates installed. I am trying to use Paypal and Google Checkout. I have the plugins installed and configured.
Both are published. I dont know what the issues is.
When I click on select payment method the page comes up with nothing to choose from yet the save and.cancel buttons are there.
Title: Re: Cannot get VM2 to display payment methods.
Post by: PRO on April 30, 2012, 13:35:12 PM
are they assigned to shopper groups?

are they assigned to states? countries?

If so, they will not show until u select that state or country
Title: Re: Cannot get VM2 to display payment methods.
Post by: Don2 on April 30, 2012, 21:04:56 PM
I have really struggled with this issue but came to one conclusion. If I un-publish all mods besides the bare essentials then my J2.5 and VM2.06 works fine and checkout goes through Paypal with no problem.
VM jscript clashes with everything I tried to install from social buttons to menus and image mods.
Don
NOOB
Title: Re: Cannot get VM2 to display payment methods.
Post by: mbarry on May 02, 2012, 14:11:07 PM
Hi MrWizard516

I had same/similar problem. I could add product to cart without being logged in. Then logged in from Cart page and would get the following error

JDatabaseMySQLi::query: 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 'ORs.`virtuemart_shoppergroup_id`= "11" OR (s.`virtuemart_shoppergroup_id`) IS NU' at line 4 SQL=SELECT l.*, v.*, j.`extension_id`,j.`name`, j.`type`, j.`element`, j.`folder`, j.`client_id`, j.`enabled`, j.`access`, j.`protected`, j.`manifest_cache`, j.`params`, j.`custom_data`, j.`system_data`, j.`checked_out`, j.`checked_out_time`, j.`state`, s.virtuemart_shoppergroup_id FROM `jcav1_virtuemart_shipmentmethods_en_gb` as l JOIN `jcav1_virtuemart_shipmentmethods` AS v USING (`virtuemart_shipmentmethod_id`) LEFT JOIN `jcav1_extensions` as j ON j.`extension_id` = v.`shipment_jplugin_id` LEFT OUTER JOIN `jcav1_virtuemart_shipmentmethod_shoppergroups` AS s ON v.`virtuemart_shipmentmethod_id` = s.`virtuemart_shipmentmethod_id` WHERE v.`published` = "1" AND j.`element` = "weight_countries" AND (v.`virtuemart_vendor_id` = "1" OR v.`virtuemart_vendor_id` = "0") AND (s.`virtuemart_shoppergroup_id`= "8" ORs.`virtuemart_shoppergroup_id`= "11" OR (s.`virtuemart_shoppergroup_id`) IS NULL ) ORDER BY v.`ordering`

The problem is there is a missing space between the OR statement in the last line. Your post shows the exact same problem.

The SQL statement is constructed in vmpsplugin.php (administrator/components/com_virtuemart/plugins)
Approx line 525 in Version 4601 of this file.

foreach ($user->shopper_groups as $groups) {
       $q .= 's.`virtuemart_shoppergroup_id`= "' . (int) $groups . '" OR';

Change this to
foreach ($user->shopper_groups as $groups) {
       $q .= 's.`virtuemart_shoppergroup_id`= "' . (int) $groups . '" OR ';  <--- must have a space here for when concatenated shopper groups are ORed together.

and the problem should be solved for at least the case I described.
Title: Re: Cannot get VM2 to display payment methods.
Post by: alatak on May 03, 2012, 12:40:20 PM
Hi,

Yes u are rigth, it has been solved
http://forum.virtuemart.net/index.php?topic=102013.0