Cart Payment option - auto select set, unchecked radio button showing 2.0.21C

Started by rayge, May 30, 2013, 20:35:56 PM

Previous topic - Next topic

PRO

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.



romatvirtue

Quote from: PRO on June 15, 2013, 16:08:01 PM
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


romatvirtue

Quote from: PRO on June 15, 2013, 17:56:11 PM
did you change the payment ID like I said?


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


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

romatvirtue

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

I Use: Joomla 3.4.1 & VM 3.0.9


SparksArts

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
if ($selectedPlugin == $plugin->$pluginmethod_id) {
$checked = 'checked="checked"';
} else {
$checked = '';
}

 

and change this to
//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

why hack the core when you can just do it with javascript in the select_payment template like I suggested?


SparksArts

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

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

Hello
QuoteBecause 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

Alatak,

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

Richard
Richard Sparks, Website Developer

ralfeez

Has anyone found a work around for this? I need it immediately. Please help...

PRO

Quote from: PRO on June 15, 2013, 16:08:01 PM
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