Jump to content

adding price to an attribute


Greenpilgrim

Recommended Posts

Hi Guys

 

Thanks for the respone, unfortunatly most of the products are based on the weight ranges so this wouldnt really work out as i have lots of products with teh same atributes,

 

It is not a huge issue, It would just have been nice for the prices to show.

 

Thanks

 

Chris

Link to comment
Share on other sites

Not sure if this works with taxes and stuff but try this.

 

Open product.tpl

Search for:

<!-- attributes -->

 

You will see:


{if isset($groups)}
<!-- attributes -->
<div id="attributes">
{foreach from=$groups key=id_attribute_group item=group}
{if $group.attributes|@count}
<p>
<label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>
{assign var="groupName" value="group_$id_attribute_group"}
<select name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();{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>
</p>
{/if}
{/foreach}
</div>
{/if}

 

Change it to:

{if isset($groups)}
  <!-- attributes -->
  <div id="attributes">
  {foreach from=$groups key=id_attribute_group item=group}
  {if $group.attributes|@count}
  <p>
   <label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>
   {assign var="groupName" value="group_$id_attribute_group"}
   <select name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();{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'} - {convertPrice price=$productPrice}</option>
 {/foreach}
   </select>
  </p>
  {/if}
  {/foreach}
  </div>
  {/if}

 

Or you instead of changing, add

- {convertPrice price=$productPrice}

Behind:

{$group_attribute|escape:'htmlall':'UTF-8'}

 

..

If you want I can write you a module for this (I think).

Hope this helps (I'm still new so still trying to figure everything out)..

 

Thanks,

Ruud

Link to comment
Share on other sites

Hi meruud

 

I added this i did have a slight problem tho the prices are set at 0. See pic.

 

14jawdi.jpg

 

I am not sure if this is down to the way i have setup the attributes.

 

Basicly i add a base price the do weight and price increase/decreases.

 

e,g.

1kg bag

Start price: £15

Start Weight: 1kg

 

then for next i use.

 

2kg bag

Price increase £10

Weight Increase 1kg

 

Not sure if this would make any difference.

 

Thanks

 

Chris

Link to comment
Share on other sites

Hi Guys!

 

It seems like I rushed myself a bit to much and I think I made a pretty big mistake.

I think the trick I gave you above only shows the original price of the product, hence this might explain Chris (if I might call you that) his problems..

 

I am in class right now, I will look at it tonight.

If anyone can confirm that this is indeed the issue, this would help a lot.

 

Thanks,

Ruud

Link to comment
Share on other sites

  • 2 months later...
  • 6 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...