Jump to content

[SOLVED] modify product attribut


vespaman

Recommended Posts

Kurang lebih seperti berikut ini, tinggal disesuaikan dengan versi prestashop-nya:

 

{foreach from=$groups key=id_attribute_group item=group}
{if $id_attribute_group == a || $id_attribute_group == b || $id_attribute_group == c}
	<div id="Baris1">
	   <label>Name of Groups attribute baris ke-1</label>
	   <!-- Proses pilihan atttribut dalam group a b, c disini : foreach loop -->

	</div>
{elseif $id_attribute_group == x || $id_attribute_group == y || $id_attribute_group == z}
    <div id="Baris2">
	   <label>Name of Groups attributes baris ke-2</label>
	   <!-- Proses pilihan atttribut dalam group x, y, z disini: foreach loop -->

    </div>
{/if}
{/foreach}

Link to comment
Share on other sites

udah bisa cuman listnya masih vertical mas.. kalau dibuat jadi horizontal bisa ga??? jadi untuk kategori A list attribut vertical yang lain horizontal...

 {if $id_attribute_group == 9 || $id_attribute_group == 10 || $id_attribute_group == 11}
		    <div id="Baris1"  style="float:left" >
			   <label>kanan</label>
			    {if $group.attributes|@count > 1} <label class="attribute_label" for="label">:</label>
	 <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select" onchange="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').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> {elseif $group.attributes|@count <= 1} <label class="attribute_label" for="label">:</label>
	 {foreach from=$group.attributes key=id_attribute item=group_attribute}
	  <input name="{$groupName}" id="group_{$id_attribute_group|intval}" value="{$id_attribute|intval}" type="hidden"  class="attribute_select"   onload="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">
    {$group_attribute|escape:'htmlall':'UTF-8'}
	 {/foreach}
    {/if}<!-- Proses pilihan atttribut dalam group a b, c disini : foreach loop -->
		    </div>
    {elseif $id_attribute_group == 14 || $id_attribute_group == 15 || $id_attribute_group == 11}
	    <div id="Baris2" style="float:right">
			   <label>kiri</label>
			    {if $group.attributes|@count > 1} <label class="attribute_label" for="label">:</label>
	 <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select" onchange="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').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> {elseif $group.attributes|@count <= 1} <label class="attribute_label" for="label">:</label>
	 {foreach from=$group.attributes key=id_attribute item=group_attribute}
	  <input name="{$groupName}" id="group_{$id_attribute_group|intval}" value="{$id_attribute|intval}" type="hidden"  class="attribute_select"   onload="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">
    {$group_attribute|escape:'htmlall':'UTF-8'}
	 {/foreach}
    {/if}<!-- Proses pilihan atttribut dalam group x, y, z disini: foreach loop -->
	    </div>{else} {if $group.attributes|@count > 1} <label class="attribute_label" for="label">:</label>
	 <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select" onchange="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').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> {elseif $group.attributes|@count <= 1} <label class="attribute_label" for="label">:</label>
	 {foreach from=$group.attributes key=id_attribute item=group_attribute}
	  <input name="{$groupName}" id="group_{$id_attribute_group|intval}" value="{$id_attribute|intval}" type="hidden"  class="attribute_select"   onload="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">
    {$group_attribute|escape:'htmlall':'UTF-8'}
	 {/foreach}
    {/if}


Edited by vespaman (see edit history)
Link to comment
Share on other sites

kalau different layout per kategory gimana cssnya mas??? misal kategory A display vertikal selain itu horizontal.. trus untuk nampilin group attribut satu satu gimana mas?? misal tabel kolom A group attribut 1 kolom B grup attribut 2 kolom C grup attribut 3.. udah tak coba malah tampil semua list grup bukan 1 nama grup.. pengennya tiap kolom tampil 1 nama grup..

Edited by vespaman (see edit history)
Link to comment
Share on other sites

  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...