Last active
April 18, 2021 16:37
-
-
Save mkdgs/2463574b05657f4b1ce42d1c146884fe to your computer and use it in GitHub Desktop.
Prestashop disable default attribute value on product page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************* | |
* 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