Skip to content

Instantly share code, notes, and snippets.

@mkdgs
Last active April 18, 2021 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mkdgs/2463574b05657f4b1ce42d1c146884fe to your computer and use it in GitHub Desktop.
Save mkdgs/2463574b05657f4b1ce42d1c146884fe to your computer and use it in GitHub Desktop.
Prestashop disable default attribute value on product page
/*********************
* Prestashop
* Simple quick
* (and maybe dirty)
* fix
* (works for radio button)
*
**********************/
let your_attribute_id = 42; // the attribute group
let selected_taille = document.querySelector('[data-product-attribute="'+your_attribute_id+'"][checked]');
if ( selected_taille) {
selected_taille.checked=false;
let add_to_cart = document.querySelector('button.add-to-cart');
add_to_cart.disabled=true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment