Skip to content

Instantly share code, notes, and snippets.

@bizlift
bizlift / configurable.phtml
Last active Jun 12, 2019
Magento configurable product default options by attribute label
View configurable.phtml
Product.Config.prototype.fillSelect = Product.Config.prototype.fillSelect.wrap(function(superMethod, element){
var attributeId = element.id.replace(/[a-z]*/, '');
var attribute = this.config.attributes[attributeId];
this.config.chooseText = 'Select ' + this.config.attributes[attributeId].label;
return superMethod(element);
});