Author Topic: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C  (Read 10795 times)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10422
  • VirtueMart Version: 3+
I auto check my with jquery


views/cart/select_payment.php


<?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

BUT!!!    you still have to go to the payment page, because the card details have to be filled in.


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

romatvirtue

  • Jr. Member
  • **
  • Posts: 91
I auto check my with jquery


views/cart/select_payment.php


<?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

BUT!!!    you still have to go to the payment page, because the card details have to be filled in.

Hey. Thanks for your reply. I tried you solution, but it didn't work. Does it matter where exactly I insert the code? I inserted it in the beginning of the file.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10422
  • VirtueMart Version: 3+
did you change the payment ID like I said?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

romatvirtue

  • Jr. Member
  • **
  • Posts: 91
did you change the payment ID like I said?


I did. My ID is "1," so I changed it to


Code: [Select]
<?php
$document 
JFactory::getDocument();
$document->addScriptDeclaration("
   jQuery(document).ready(function($) {
    $('input:radio:#1').attr('checked',true);
   });
"
);
?>

romatvirtue

  • Jr. Member
  • **
  • Posts: 91
Hey. It works. I did not do it properly. I removed "payment_id" and replaced it with the number. That's why it didn't work. It works now after I added back "payment_id."


Thank you so much.

rayge

  • Jr. Member
  • **
  • Posts: 189
Has this issue been solved yet?
I Use: Joomla 3.4.1 & VM 3.0.9

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10422
  • VirtueMart Version: 3+
Has this issue been solved yet?


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

SparksArts

  • Jr. Member
  • **
  • Posts: 84
    • Sparks Arts
None of the previously suggested solutions worked for me. I have only one checkout method "credit card" and customers were forgetting to check the radio button next to that option when filling in their credit card details. Then the payment would fail. I asked for help from the developer of the custom Virtuemart theme I'm using and they offered this solution (and it works perfectly for me...)


In administrator/components/com_virtuemart/plugins/vmpsplugin.php ~ line 760

look for
Code: [Select]
if ($selectedPlugin == $plugin->$pluginmethod_id) {
$checked = 'checked="checked"';
} else {
$checked = '';
}
 

and change this to
Code: [Select]
//if ($selectedPlugin == $plugin->$pluginmethod_id) {
$checked = 'checked="checked"';
//} else {
// $checked = '';
//}

Basically commenting out everything except making it checked. This works if you have only one checkout option available. I doesn't auto-select the payment method because customers must still enter their credit card details. It only checks the radio button by default - see attached screenshot.

Just remember to take out the hack if you ever add another payment method!

Full thread of this discussion at http://www.flexiblewebdesign.com/index.php?option=com_kunena&view=topic&catid=18&id=1105&Itemid=234#5225

good luck, Richard

[attachment cleanup by admin]
Richard Sparks, Website Developer

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10422
  • VirtueMart Version: 3+
why hack the core when you can just do it with javascript in the select_payment template like I suggested?

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

SparksArts

  • Jr. Member
  • **
  • Posts: 84
    • Sparks Arts
Because the javascript solution didn't work for me. I tried it and the radio button remained unchecked. Not sure why it didn't work, it should... but it didn't. I suggest trying that option first and going with my solution only as a last resort.

Richard
Richard Sparks, Website Developer

rayge

  • Jr. Member
  • **
  • Posts: 189
Why cant we simply borrow code from the other payment plugins that ARE working? Is the auth.net plugin code THAT far removed from the others?

THANKS!
I Use: Joomla 3.4.1 & VM 3.0.9

alatak

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2045
    • alatak.net
Hello
Quote
Because the javascript solution didn't work for me. I tried it and the radio button remained unchecked. Not sure why it didn't work, it should... but it didn't. I suggest trying that option first and going with my solution only as a last resort.
hum..
please open a ticket here http://extensions.virtuemart.net/ticket
i will try to find out why.

SparksArts

  • Jr. Member
  • **
  • Posts: 84
    • Sparks Arts
Alatak,

I submitted a ticket as you requested. Thank you for looking into this issue.

Richard
Richard Sparks, Website Developer

ralfeez

  • Jr. Member
  • **
  • Posts: 119
Has anyone found a work around for this? I need it immediately. Please help...

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10422
  • VirtueMart Version: 3+
I auto check my with jquery


views/cart/select_payment.php


<?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

BUT!!!    you still have to go to the payment page, because the card details have to be filled in.




^^^ this shopuld work for EVERYONE as long as you change

payment_id_11

to whatever payment id you have

for example, if its payment id #2

change it to


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