VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: funny-rabbit on October 22, 2020, 13:12:03 PM

Title: Payment method checkboxes don't get checked when clicked
Post by: funny-rabbit on October 22, 2020, 13:12:03 PM
I searched for my answer in the forum but there was no yet.

my question is, why doesn't get the checkbox checked when I click on it?
it doesn't work for payment (methods) but for shipment method.

jQuery(document).ready(function(){

  if(jQuery("#paymentsdiv").length > 0)
  {
      jQuery("#paymentsdiv input").each(function(){
         if(jQuery(this).val() == selected_payment) 
         {
             jQuery(this).prop('checked', true);
         }
      });
  }
 
   jQuery("#paymentsdiv input").each(function(){
      if(jQuery(this).val() == selected_payment) 
      {
          jQuery(this).prop('checked', true);
      }
   });

   jQuery("#shipmentdiv input").each(function(){
      if(jQuery(this).val() == selected_shipment) 
      {
          jQuery(this).prop('checked', true);
      }
   });
});
Title: Re: Payment method checkboxes don't get checked when clicked
Post by: Jörgen on October 22, 2020, 13:14:14 PM
Custom Payment method, changes in html styling ?

New setup, upgrade, has it ever worked ?

Jörgen
Title: Re: Payment method checkboxes don't get checked when clicked
Post by: funny-rabbit on October 22, 2020, 13:52:13 PM
jQuery(this).prop('checked', true); should work. it works for shipment_method but the same code doesn't work for payment method.
Is there a place to look for custom code?
Title: Re: Payment method checkboxes don't get checked when clicked
Post by: Jörgen on October 22, 2020, 14:20:00 PM
You have probably JS errors, You do not give much info. Debug with F12, console.

Jörgen
Title: Re: Payment method checkboxes don't get checked when clicked
Post by: funny-rabbit on October 22, 2020, 19:52:02 PM
Jorgen, I would give more info if I knew how to formulate my problem, listen please, I'm a newbie, I can handle the click and configure in Joomla medium well, but when it comes to custom code, I'm like a child.
Will check the F12 console and report back with what I read, trying to fix it myself. If I can't do it, I will gladly ask or give more information here.
Title: Re: Payment method checkboxes don't get checked when clicked
Post by: Jörgen on October 22, 2020, 23:15:40 PM
Still No more info, Custom Template, any peticular addons ?

Joomla, PHP and VM versions ?

This really works by default, so it is your setup that makes it break.

Jörgen @ Kreativ Fotografi
Title: Re: Payment method checkboxes don't get checked when clicked
Post by: funny-rabbit on November 03, 2020, 18:33:10 PM
I bought a custom shop template. The Setup is J3.9/VM3.8/Custom Shop Template. The custom template overrides the default radio buttons with custom checkboxes. What I could try, is to out-comment all custom radio buttons but I suspect that the default radio buttons click.state wont be there yet, if I do this.
Title: Re: Payment method checkboxes don't get checked when clicked
Post by: Jörgen on November 03, 2020, 19:21:24 PM
The custom code is under templates/Your_template_Name/hmtl

Please check there, You will also find other overrides as CSS.

Jörgen