News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Payment method checkboxes don't get checked when clicked

Started by funny-rabbit, October 22, 2020, 13:12:03 PM

Previous topic - Next topic

funny-rabbit

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);
      }
   });
});
Leaning Virtuemart and Joomla
Config: Joomla 3.9.21 - VM 3.8.5 - PHP 7.4

Jörgen

Custom Payment method, changes in html styling ?

New setup, upgrade, has it ever worked ?

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

funny-rabbit

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?
Leaning Virtuemart and Joomla
Config: Joomla 3.9.21 - VM 3.8.5 - PHP 7.4

Jörgen

You have probably JS errors, You do not give much info. Debug with F12, console.

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

funny-rabbit

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.
Leaning Virtuemart and Joomla
Config: Joomla 3.9.21 - VM 3.8.5 - PHP 7.4

Jörgen

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
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

funny-rabbit

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.
Leaning Virtuemart and Joomla
Config: Joomla 3.9.21 - VM 3.8.5 - PHP 7.4

Jörgen

The custom code is under templates/Your_template_Name/hmtl

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

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.