Hi.
It's easier than it seems.
Every time you change the combination, the reference changes as well.
1. a function needs to be added to ./classes/Combination.php
public static function getReferenceById($idProductAttribute) { if (empty($idProductAttribute)) { return; } $query = new DbQuery(); $query->select('pa.reference'); $query->from('product_attribute', 'pa'); $query->where('pa.id_product_attribute = \'' . pSQL($idProductAttribute) . '\''); return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query); }
2. in your template product-variants.tpl you insert the code at the beginning
I intentionally left the attribute ID there before the reference to make it understandable for others.
Ref: {$product.id_product_attribute} - {Combination::getReferenceById($product.id_product_attribute)}
3. result