kimlop Posted May 7, 2014 Share Posted May 7, 2014 hiI have a problem, is there a way to insert the code ean13 in the product page (product.tpl) when the product have combinations? I have found this tutorial https://gist.github.com/i0rek/3038903 but is not actual for the 1.6 version could someone help me? thanks Link to comment Share on other sites More sharing options...
Rolige Posted May 7, 2014 Share Posted May 7, 2014 You must make changes in some files Product.php, product.tpl and product.js I'll try to explain. STEP 1 Edit the file: yourshop.com/classes/Product.php Locate the 3 lines of code like this: SELECT DISTINCT a.`id_attribute`, a.`id_attribute_group`, al.`name` as `attribute`, agl.`name` as `group` And change each one to: SELECT DISTINCT a.`id_attribute`, a.`id_attribute_group`, al.`name` as `attribute`, agl.`name` as `group`, pa.`ean13` STEP 2 Edit the file: yourshop.com/themes/your-theme/product.tpl Locate the code: tabInfos['id_attribute_group'] = '{$aC.id_attribute_group|intval}'; Next, add a new line with the following code: tabInfos['ean13'] = '{$aC.ean13}'; Now you need add a <div> to display it, you need to put this inside the next foreach: {foreach from=$groups key=id_attribute_group item=group} {if $group.attributes|@count} It could be as follows: {foreach from=$groups key=id_attribute_group item=group} {if $group.attributes|@count} <div>EAN13: <span id="ean13_{$id_attribute_group|intval}"></span></div> STEP 3 Finally you need edit the file: yourshop.com/themes/your-theme/js/product.js Locate the code: $('select[name=group_' + attributesCombinations[a]['id_attribute_group'] + ']').val(attributesCombinations[a]['id_attribute']); Next, add a new line with the following code: $('#ean13_' + attributesCombinations[a]['id_attribute_group']).html(attributesCombinations[a]['ean13']); I have tested and works. I hope this help you. Link to comment Share on other sites More sharing options...
kimlop Posted May 14, 2014 Author Share Posted May 14, 2014 thanks for your help but for step 2 I have a problem, I not find the code: tabInfos['id_attribute_group'] = '{$aC.id_attribute_group|intval}'; I have the 1.6 version of prestashop than I think that new layout not have the same code of 1.5 version You have any idea? thanks Link to comment Share on other sites More sharing options...
Rolige Posted May 15, 2014 Share Posted May 15, 2014 Yes, that code is for PS 1.5 Link to comment Share on other sites More sharing options...
xxlolo Posted June 13, 2014 Share Posted June 13, 2014 Thanks for your input, it has been very useful to me, I can think of that color attributes which does not change the EAN EAN me the word appears on screen release would be possible to hide if the attribute color has in its combination EAN? thanks Link to comment Share on other sites More sharing options...
Recommended Posts