Cara menampilkan Attributes menjadi per baris
bukan koma ',' di Prestashop 1.6

Leave a Comment
Tampilan attribute dari theme default prestashop adalah menggunakan koma ', ' seperti gambar di bawah ini :












Step-by-step guide

Berikut adalah bagaimana Anda dapat membuat attribute prestashop menjadi per baris :

1. Buka file berikut di /public_html/{PROJECT NAME}/themes/{PROJECT NAME}/modules/blockcart/blockcart-json.tpl, rubah bagian berikut
"attributes": {$product.attributes_small|json_encode},
menjadi
"attributes": {$product.attributes_small|replace:', ':'<br />'|json_encode},
atau jika Anda ingin menampilkan kedua attribute dan nilai di prestashop
"attributes": {$product.attributes|replace:', ':'<br />'|json_encode},
** CATATAN: Jika perubahan tidak mencerminkan ajax keranjang, Anda mungkin perlu mengubah juga di file blockcart.tpl

               /public_html/{PROJECT NAME}/themes/{PROJECT NAME}/modules/blockcart/blockcart.tpl 

2. Buka file berikut di /public_html/{PROJECT NAME}/themes/{PROJECT NAME}/shopping-cart-product-line.tpl, kemudai rubah kode di bawah ini :
{if isset($product.attributes) && $product.attributes}<small><a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}">{$product.attributes|@replace: $smarty.capture.sep:$smarty.capture.default|escape:'html':'UTF-8'}</a></small>{/if}
menjadi
{if isset($product.attributes) && $product.attributes}<small><a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}">{$product.attributes|@replace: $smarty.capture.sep:$smarty.capture.default|escape:'html':'UTF-8'|replace:', ':'<br />'}</a></small>{/if}

Semoga berhasil..! ^_^

Jika ada yang kurang jelas silahkan comment aja ya.


Thanks

0 komentar:

Posting Komentar