VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: rayge on May 30, 2013, 20:35:56 PM

Title: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: rayge on May 30, 2013, 20:35:56 PM
Even though there's only 1 payment method enabled
Automatic Selected Payment enabled
Radio button for authorize.net still shows

Can anyone tell me how to debug and or fix this?
Title: Re: One Payment option. radio still showing
Post by: AH on May 30, 2013, 21:31:02 PM
Confirmed

If I enable only authorize.net

Cart still expects me to select a payment option
I see only payment option in the cart and an unchecked  radio button.

Consequently the auto select payment option appears not to be functioning

If I enable only Paypal then auto selection works!?


VM 2.0.21C

Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: rayge on May 31, 2013, 00:06:21 AM
Ok now that its been confirmed does anyone know where we might fix the code to repair it? Ive looks around but haven't found the correct place yet.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: rayge on May 31, 2013, 23:03:30 PM
Here is what ive found

in the plugin for authorizenet.php line 146
$html = $this->getPluginHtml ($method, $selected, $methodSalesPrice);
this is what shows the radio button. so the function getPluginHtml I am assuming is the issue.

The other plugins are Using displayListFE to display where authorizenet is not using the same coding structure.

If i replace
$html = $this->getPluginHtml ($method, $selected, $methodSalesPrice);
WITH
$html = $this->displayListFE ($cart, $selected, $htmlIn);

it is showing a 1.
when i look at vmplugin.php function displayListFE
Line 166 has return TRUE which is why its showing a 1 in this current coding configuration for auth.net
if i comment it out it then the 1 goes away.

Is there a reason its returning TRUE? I am not sure that commenting it out is Okay yet.

It also still isnt autoselecting still so all of this may have been for nothing.

The only bandaid i can use as of this moment is in authorizenet.php line 122 right after the beginning of the function add
$selected=1;
then atleast it is selected.

Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: AH on June 01, 2013, 13:47:27 PM
I am not a coder so cannot really help in this.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: rayge on June 04, 2013, 08:48:29 AM
WHere can I pass to to a coder to have it fixed?
I am a developer but i don't have the kind of time required to fix this.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: Milbo on June 04, 2013, 16:26:50 PM
advertise it on the commercial board? No, the correct board is here http://forum.virtuemart.net/index.php?board=136.0,

but the momentan board is also not really wrong. I sent the link to valerie, she will take a look.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: alatak on June 04, 2013, 17:55:36 PM
Hello

At the moment, it is done like that:
when a payment requires some input (like in Authorize.net), the automatic selection of the payment does not work.

I am checking if it is possible to change that.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: rayge on June 04, 2013, 19:27:09 PM
Thanks for helping on this!
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: romatvirtue on June 14, 2013, 06:25:27 AM
Hello. I am having exactly the same issue and would like to get this resolved. Any updates so far? :)

Thanks.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: alatak on June 14, 2013, 09:23:27 AM
Hello
To do this requires some change in the code.
Meanwhile you can use some OPCs that will solve this issue.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: romatvirtue on June 14, 2013, 15:06:26 PM
Quote from: alatak on June 14, 2013, 09:23:27 AM
Hello
To do this requires some change in the code.
Meanwhile you can use some OPCs that will solve this issue.
Hello.Thanks for getting back.

So why do we have an option of setting it to be automatically set in VM back end?
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: jenkinhill on June 14, 2013, 15:15:07 PM
Quote from: romatvirtue on June 14, 2013, 15:06:26 PM
So why do we have an option of setting it to be automatically set in VM back end?

Because for all of us who use ship/payment plugins that require no user input the autoselection works perfectly.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: AH on June 14, 2013, 15:57:56 PM
Yep works fine for my Paypal Pro hosted iframe solution!
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: romatvirtue on June 15, 2013, 06:20:58 AM
Well, this doesn't work with Authorize.net... :(
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: 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.


Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: romatvirtue on June 15, 2013, 17:49:32 PM
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.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: PRO on June 15, 2013, 17:56:11 PM
did you change the payment ID like I said?
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: romatvirtue on June 15, 2013, 18:04:57 PM
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);
   });
"
);
?>
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: romatvirtue on June 15, 2013, 18:17:07 PM
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.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: rayge on June 25, 2013, 19:56:23 PM
Has this issue been solved yet?
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: PRO on June 25, 2013, 20:12:49 PM
Quote from: rayge on June 25, 2013, 19:56:23 PM
Has this issue been solved yet?


what issue?
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: SparksArts on June 26, 2013, 00:27:32 AM
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]
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: PRO on June 26, 2013, 02:01:06 AM
why hack the core when you can just do it with javascript in the select_payment template like I suggested?

Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: SparksArts on June 26, 2013, 02:24:13 AM
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
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: rayge on June 26, 2013, 17:36:46 PM
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!
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: alatak on June 26, 2013, 18:35:13 PM
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.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: SparksArts on June 26, 2013, 18:53:00 PM
Alatak,

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

Richard
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: ralfeez on July 01, 2013, 19:57:59 PM
Has anyone found a work around for this? I need it immediately. Please help...
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: PRO on July 01, 2013, 20:13:53 PM
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
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: maxispin on September 20, 2013, 07:19:48 AM
It didn't work for me either, before I inserted the code in the very beginning of the the select_payment.php.

@ 2.0.22c
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: AH on October 01, 2013, 20:07:57 PM
Enable Automatic Selected Payment set to Y

VM now asks for input when only one payment method (paypal) exists

2.0.22e  and 2.0.24 worked fine on 2.0.22c (did not check on D)
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: alatak on October 02, 2013, 12:39:42 PM
Hello

Yes it is a problem with the new payments. If you do not use them, unpublish the sofort payment plugins in the list  joomla plugins.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: AH on October 02, 2013, 17:39:36 PM
Alatak

Thanks for the super quick reply

Yes disbaling the (newly enabled by default) sofort payment plugins has fixed it!

Many thanks for the update.

Not sure that these plugins  should have been enabled by default though  ;)
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: jenkinhill on October 02, 2013, 17:50:10 PM
If they aren't enabled new users complain that there are no payment options.........
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: alatak on October 02, 2013, 18:21:34 PM
hello
QuoteIf they aren't enabled new users complain that there are no payment options.........
Yes exactly
QuoteNot sure that these plugins  should have been enabled by default though
and all payment methods should be disabled when not used for performance reasons

For version 2.1 we are going to think about about a better way to do that
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: AH on October 02, 2013, 19:26:14 PM
LOL

2 replies  8)

I agree with the prob of no plugins enabled. 

However this will be an upgrade for many people and we will (no doubt) get lots of people noticing that the auto select fails (if they only have one payment method) and that will be directly because the upgrade enabled the 2 new sofort payment methods in addition to whatever other plugin was enabled. 

Upgraders will be unlikely to utilise these new methods immediately, but they will notice auto select failing.

Then Jenkin will be constantly pointing posts to this thread for the solution.   ;)
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: alatak on October 02, 2013, 19:31:20 PM
Hello

It is a bug in the Sofort Ideal Payment plugin, that can be solved by unpublishing the payment in joomla.
I have myself more than 20 payment methods on my test site. i did not notice that problem.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: hotrod on February 25, 2014, 01:04:36 AM
THis worked  for my by Commenting out..  But it created this email error You must provide at least one recipient email address

And The buyer will not get invoices or confirmations.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: rayge on June 03, 2014, 00:53:11 AM
Wow its been over a year and i installed a new version of the cart TODAY and we still have the SAME ISSUE?
WHY??
My hack doesn't seem to work now either so really we are going backwards?

thanks for any help as to how to resolve this issue yet again. :(


VirtueMart 2.6.6

**UPDATE - 2014-06-02
Here is what i had to do UNTIL there is a more Permanent FIX.
Open the file: plugins/vmpayment/authorizenet/authorizenet.php

after the line
foreach ($this->methods as $this->_currentMethod) {
add
$selected = $this->_currentMethod->virtuemart_paymentmethod_id;

This will set selected to the ID of Auth.net payment method and make the radio be selected.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: cylord on June 19, 2014, 15:38:08 PM
Ok i found a solution.

in virtuemart 2.6.6 using the jquery method to auto check the payment method,

the line

$('input:radio:#payment_id_3').attr('checked','true');

remove

input:radio:

I should look like this :

$document = JFactory::getDocument();
$document->addScriptDeclaration("
   jQuery(document).ready(function($) {
    $('#payment_id_11').attr('checked',true);
   });
");
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: SCJberry on September 11, 2015, 17:41:01 PM
I know I just resurrected a year old post but I had to thank RAYGE! This worked for me..

Running latest VM3 with OnePage Checkout by PV and using Authorize.net as my only payment option. I was banging my head for hours over this. I couldn't get the radio button checked for anything.

THANK YOU

Quote from: rayge on June 03, 2014, 00:53:11 AM
Wow its been over a year and i installed a new version of the cart TODAY and we still have the SAME ISSUE?
WHY??
My hack doesn't seem to work now either so really we are going backwards?

thanks for any help as to how to resolve this issue yet again. :(


VirtueMart 2.6.6

**UPDATE - 2014-06-02
Here is what i had to do UNTIL there is a more Permanent FIX.
Open the file: plugins/vmpayment/authorizenet/authorizenet.php

after the line
foreach ($this->methods as $this->_currentMethod) {
add
$selected = $this->_currentMethod->virtuemart_paymentmethod_id;

This will set selected to the ID of Auth.net payment method and make the radio be selected.
Title: Re: Cart Payment option - auto select set, unchecked radio button showing 2.0.21C
Post by: Milbo on September 11, 2015, 20:19:32 PM
Nice to hear this.