Author Topic: Select Payment Page (Auto Check Payment Method)  (Read 21019 times)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10420
  • VirtueMart Version: 3+
Re: Select Payment Page (Auto Check Payment Method)
« Reply #15 on: December 07, 2012, 15:37:25 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.

J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

maxispin

  • Jr. Member
  • **
  • Posts: 174
Re: Select Payment Page (Auto Check Payment Method)
« Reply #16 on: September 20, 2013, 06:42:53 am »
Should these codes be inserted in the very beginning of the file or does it really matter?


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

  • Jr. Member
  • **
  • Posts: 174
Re: Select Payment Page (Auto Check Payment Method)
« Reply #17 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?
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10420
  • VirtueMart Version: 3+
Re: Select Payment Page (Auto Check Payment Method)
« Reply #18 on: September 20, 2013, 16:34:49 pm »
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
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

maxispin

  • Jr. Member
  • **
  • Posts: 174
Re: Select Payment Page (Auto Check Payment Method)
« Reply #19 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)
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10420
  • VirtueMart Version: 3+
Re: Select Payment Page (Auto Check Payment Method)
« Reply #20 on: September 20, 2013, 20:22:25 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
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

maxispin

  • Jr. Member
  • **
  • Posts: 174
Re: Select Payment Page (Auto Check Payment Method)
« Reply #21 on: September 20, 2013, 20:26:20 pm »
Good to know. I have to make more tests.

VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

maxispin

  • Jr. Member
  • **
  • Posts: 174
Re: Select Payment Page (Auto Check Payment Method)
« Reply #22 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();



VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10420
  • VirtueMart Version: 3+
Re: Select Payment Page (Auto Check Payment Method)
« Reply #23 on: September 23, 2013, 01:38:01 am »
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
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

maxispin

  • Jr. Member
  • **
  • Posts: 174
Re: Select Payment Page (Auto Check Payment Method)
« Reply #24 on: September 23, 2013, 06:31:31 am »
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

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10420
  • VirtueMart Version: 3+
Re: Select Payment Page (Auto Check Payment Method)
« Reply #25 on: September 23, 2013, 14:58:47 pm »
that looks like 1 page checkout.

My code is not for 1 page checkout
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

maxispin

  • Jr. Member
  • **
  • Posts: 174
Re: Select Payment Page (Auto Check Payment Method)
« Reply #26 on: September 23, 2013, 21:45:14 pm »
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

  • Beginner
  • *
  • Posts: 46
Re: Select Payment Page (Auto Check Payment Method)
« Reply #27 on: May 22, 2014, 04:19:47 am »
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.