vespaman Posted January 20, 2013 Share Posted January 20, 2013 cara memodifikasi Group & Attribute product agar tampil berbeda untuk sebuah category tertentu, atau untuk suatu product dalam category tertentu. saya pakai script berikut ini. namun tidak tampil atau blank page. {if $id_category = 10}{foreach from=$groups key=id_attribute_group item=group} <p> <label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label> {assign var='groupName' value='group_'|cat:$id_attribute_group} <select name="{$groupName}" id="group_{$id_attribute_group|intval}" onChange="javascript:findCombination();{if $colors|@count > 0}$('#resetImages').show('slow');{/if}"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option> {/foreach} </select> </p> {/foreach} {else} {foreach from=$groups key=id_attribute_group item=group} <p> <label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label> {assign var='groupName' value='group_'|cat:$id_attribute_group} {foreach from=$group.attributes key=id_attribute item=group_attribute} {$group_attribute|escape:'htmlall':'UTF-8'} {/foreach} </p> {/foreach} Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted January 21, 2013 Share Posted January 21, 2013 smarty if statement anda pada script tsb, tidak tertutup sehingga smarty error dan menyebabkan blank page {if variabel} <!-- awal if statement --> <!-- eksekusi disini --> {/if} <!-- akhir if statement --> Note: jika posting script atau code, sebaiknya anda format dengan CODE (klik icon <>) agar tampil enak dilihat Link to comment Share on other sites More sharing options...
vespaman Posted January 21, 2013 Author Share Posted January 21, 2013 udah tak tutup tapi masih aja mas.. berikut scriptnya {if isset($groups)} <!-- attributes --> <div id="attributes"> {if ($id_category = 10)}{foreach from=$groups key=id_attribute_group item=group} <p> <label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label> {assign var='groupName' value='group_'|cat:$id_attribute_group} <select name="{$groupName}" id="group_{$id_attribute_group|intval}" onChange="javascript:findCombination();{if $colors|@count > 0}$('#resetImages').show('slow');{/if}"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option> {/foreach} </select> </p> {/foreach} {else}{foreach from=$groups key=id_attribute_group item=group} <p> <label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label> {assign var='groupName' value='group_'|cat:$id_attribute_group} {foreach from=$group.attributes key=id_attribute item=group_attribute} {$group_attribute|escape:'htmlall':'UTF-8'} {/foreach} </p> {/foreach} {/if}</div> {/if} Link to comment Share on other sites More sharing options...
vespaman Posted January 21, 2013 Author Share Posted January 21, 2013 udah bisa mas, ternyata kesalahan bukan di penutup smarty tapi {if $id_category = 10} , terimakasih.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now