News:

Support the VirtueMart project and become a member

Main Menu

Select Payment Page (Auto Check Payment Method)

Started by PRO, October 18, 2012, 20:03:09 PM

Previous topic - Next topic

PRO

Quote from: toad78 on December 07, 2012, 15:14:18 PM
I've managed to finally get your code working (operator error).

Would this code be sufficient to use for checkboxes as well, considering this is nothing more than a jquery script?

I do the same for the "agree to terms of service" checkbox.

You just have to identify the checkbox selector correctly.


maxispin

#16
Should these codes be inserted in the very beginning of the file or does it really matter?

Quote from: PRO on October 18, 2012, 20:03:09 PM

views/cart/tmpl/select_payment.php[/b]
<?php
$document = JFactory::getDocument();
$document->addScriptDeclaration("
   jQuery(document).ready(function($) {
    $('input:radio:#payment_id_11').attr('checked',true);
   });
");
?>

change payment_id_11  to your payment id   


VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

maxispin

And what I discover is that the information is not saved before Save button is pressed. Do you have any solution for that to suggest, please?
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

PRO

Quote from: maxispin on September 20, 2013, 07:41:44 AM
And what I discover is that the information is not saved before Save button is pressed. Do you have any solution for that to suggest, please?

what do you mean?

it should be close to the top of the file

maxispin

Thanks for your reply Pro!

I mean that radio button selection is not registered by VM and it says, " Payment method not selected" .

From the customer point of view it is "selected". (Just not saved)
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

PRO

Quote from: maxispin on September 20, 2013, 17:58:42 PM
Thanks for your reply Pro!

I mean that radio button selection is not registered by VM and it says, " Payment method not selected" .

From the customer point of view it is "selected". (Just not saved)

I know it works on mine, my selected is "first" which is credit card.

Then, if they want to use paypal, or google checkout. They have to select it, and it works

maxispin

VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

maxispin

I can't get it work. The radio button is selected yes, but not submitted and it is launched  "payment method not selected"

I have tried to add there some jquery submits without luck.

e.g.

$("#paymentForm").submit();



VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

PRO

Quote from: maxispin on September 20, 2013, 22:24:00 PM
I can't get it work. The radio button is selected yes, but not submitted and it is launched  "payment method not selected"

I have tried to add there some jquery submits without luck.

e.g.

$("#paymentForm").submit();






nobody can help without a url

maxispin

#24
True. The store is at xyz.fi [because of hackers picking sites removed address]- click on text KAUPPA
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

PRO

that looks like 1 page checkout.

My code is not for 1 page checkout

maxispin

I changed checkout page back to multistep and the result is same. The option is selected as it should be. However, I must point out that, in multistep checkout you (the customer) wants to see save button and your code Pro is just perfect.

My original point was that, when user presses (or has already selected with ajax etc code) radio button, that information should be automatically saved for the use of system. In one page checkout view this is an issue (at least for me).

Thanks Pro for your responses and for checking my site!
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

tophatco

#27
Since upgrading to 2.60a, Joomla 2.5.20... the jquery script mentioned previously in this thread no longer worked. 

What worked for me now was to add a modification of it at the top of select_payment.php

<?php
/************* Autocheck credit card ********************/
$document = JFactory::getDocument();
$document->addScriptDeclaration("
   jQuery(document).ready(function($) {
   $('#payment_id_4').prop('checked', true);
   });
");
?>

where payment_id_4 might need to be changed to reflect the payment_id_X you want to check.

Why VM doesn't have a default selection for payments I do not understand.  Time after time I have had customers go to Select Payment, only to fill out their credit card information, not check the radio button, hit save, and submit their order. There should at least be an error thrown if no payment type is selected.

The order is actually recorded in the Orders in VM when they do not check the radio button... but the order is not processed by credit card nor are confirmations of the order mailed to the vendor or the customer.