Skip to content

Instantly share code, notes, and snippets.

@unlocomqx
Created May 5, 2019 13:11
Show Gist options
  • Save unlocomqx/9b1c97d54f8b2175fddc6ace9b078dc2 to your computer and use it in GitHub Desktop.
Save unlocomqx/9b1c97d54f8b2175fddc6ace9b078dc2 to your computer and use it in GitHub Desktop.
// define a max for each attribute
// open the console then change the attribute to see the selected id
var max = {
581: 20,
582: 10
}
prestashop.on('updatedProduct', function(data) {
const idProductAttribute = data.id_product_attribute;
console.log(idProductAttribute);
if (max[idProductAttribute]) {
getField('leveys').data('max', max[idProductAttribute]).apply();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment