News:

Support the VirtueMart project and become a member

Main Menu

Cannot get VM2 to display payment methods.

Started by MrWizard516, April 22, 2012, 00:55:01 AM

Previous topic - Next topic

MrWizard516

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.

rethinkmarketing

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

MrWizard516

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.

MrWizard516

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.

PRO

MrWizard516,

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

did you do the "install or update tables"


MrWizard516

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.

PRO

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

Don2

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

mbarry

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.

alatak