Registrován: 30 čer 2009 08:14 Příspěvky: 8617
|
Dobrý den, zdrojový kód aplikace není připravený pro zobrazení EAN ve front-endu obchodu. Ale jelikož by se úpravu mohla hodit i ostatním uživatelům Webhostingu C4, kteří stále používají starší verzi 1.5, uvedu zde návod. Aby zobrazení fungovalo i u kombinací produktů, je postup složitější. A samozřejmě si pro jistotu soubory před změnou zazálohujte. - V souboru classes/Product.php najděte řádek:
Kód: product_attribute_shop.`default_on`, pa.`reference`, product_attribute_shop.`unit_price_impact`,
a nahraďte ho:
Kód: product_attribute_shop.`default_on`, pa.`reference`, pa.`ean13`, product_attribute_shop.`unit_price_impact`,
- V souboru controllers/front/ProductController.php najděte řádek:
Kód: $combinations[$row['id_product_attribute']]['reference'] = $row['reference'];
a za něj na nový řádek přidejte:
Kód: $combinations[$row['id_product_attribute']]['ean13'] = $row['ean13'];
- V souboru themes/default/js/product.js najděte řádek:
Kód: function addCombination(idCombination, arrayOfIdAttributes, quantity, price, ecotax, id_image, reference, unit_price, minimal_quantity, available_date, combination_specific_price)
a nahraďte ho:
Kód: function addCombination(idCombination, arrayOfIdAttributes, quantity, price, ecotax, id_image, reference, ean13, unit_price, minimal_quantity, available_date, combination_specific_price)
Najděte řádek:
Kód: combination['reference'] = reference;
a za něj na nový řádek přidejte:
Kód: combination['ean13'] = ean13;
Najděte řádek:
Kód: selectedCombination['reference'] = combinations[combination]['reference'];
a za něj na nový řádek přidejte:
Kód: selectedCombination['ean13'] = combinations[combination]['ean13'];
Najděte řádky:
Kód: if (selectedCombination['reference'] || productReference) { if (selectedCombination['reference']) $('#product_reference span').text(selectedCombination['reference']); else if (productReference) $('#product_reference span').text(productReference); $('#product_reference:hidden').show('slow'); } else $('#product_reference:visible').hide('slow');
a za ně na nový řádek přidejte:
Kód: if (selectedCombination['ean13'] || productEan13) { if (selectedCombination['ean13']) $('#product_ean13 span').text(selectedCombination['ean13']); else if (productEan13) $('#product_ean13 span').text(productEan13); $('#product_ean13:hidden').show('slow'); } else $('#product_ean13:visible').hide('slow');
- V souboru themes/default/product.tpl najděte řádek:
Kód: var productReference = '{$product->reference|escape:'htmlall':'UTF-8'}';
a za něj na nový řádek přidejte:
Kód: var productEan13 = {$product->ean13};
Najděte řádek:
Kód: addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}', {$combination.unit_impact}, {$combination.minimal_quantity}, available_date, specific_price_combination);
a nahraďte ho:
Kód: addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}', '{$combination.ean13}', {$combination.unit_impact}, {$combination.minimal_quantity}, available_date, specific_price_combination);
Najděte řádky:
Kód: <p id="product_reference" {if isset($groups) OR !$product->reference}style="display: none;"{/if}> <label>{l s='Reference:'} </label> <span class="editable">{$product->reference|escape:'htmlall':'UTF-8'}</span> </p>
a za ně na nový řádek přidejte:
Kód: <p id="product_ean13" {if isset($groups) OR !$product->ean13}style="display: none;"{/if}> <label>{l s='EAN:'} </label> <span class="editable">{$product->ean13}</span> </p>
Aby se změna v šabloně projevila, tak v administraci aplikace PrestaShop v sekci Nástroje > Výkon > Smarty klikněte na tlačítko Vyčistit cache Smarty a automaticky nahrát cache. A následně si zaktualizujte cache Vašeho internetového prohlížeče.
_________________ Radek Plašil Webhosting C4 https://www.c4.cz/
|
|