[SOLVED] Products, Formatting Price Attribute
Posted: Wed Feb 15, 2012 3:20 pm
Hello,
I have racked my brain on this one and searched forum for 2 days, but haven't been able to solve this.
I have a website for an artist, and she would like to sell four different types of prints, Lithographs, Framed Lithographs, Canvas Giclee, Framed Canvas Giclee. I have this set-up in Products, and would like to use Attributes to prices each of these types of prints.
The trouble is, the prices are coming out incorrect, showing the first number and then (decimal) zero zero. (example: 1.00)
Here is the code within the template:
Here is what spits out from {$entry->attributes|@print_r}
And what comes out of {$entry->attribs_full|@print_r}
I would like to show the three digits of the price, followed by .00, but the .00 is not necessary. Any ideas? I believe it is just the formatting, and I have tired everything I could get my hands on. So if someone could just point me in the right direction, I would be totally grateful.
Thanks!
I have racked my brain on this one and searched forum for 2 days, but haven't been able to solve this.
I have a website for an artist, and she would like to sell four different types of prints, Lithographs, Framed Lithographs, Canvas Giclee, Framed Canvas Giclee. I have this set-up in Products, and would like to use Attributes to prices each of these types of prints.
The trouble is, the prices are coming out incorrect, showing the first number and then (decimal) zero zero. (example: 1.00)
Here is the code within the template:
Code: Select all
{* print out attributes *}
{if isset($entry->attribs_full)}
{foreach from=$entry->attributes key='name' item='attribset'} <!-- -->
<select id='lithoType' name='lithoType'>
{foreach from=$attribset key='label' item='attribute'}
<option value='{$attribute.attrib_sku}' name='{$attribute.attrib_text}' label='{$label}'>{$label} {$currency_symbol}{$attribute.attrib_adjustment|string_format:"%.2f"}</option>
{/foreach}
</select>
{/foreach}
{/if}
Code: Select all
Array ( [Price] => Array ( [Lithograph Framed] => 179.00 [Canvas Giclee] => 350.00 [Canvas Giclee Framed] => 450.00 [Lithograph] => 70.00 ) ) 1
Code: Select all
Array ( [Price] => Array ( [Lithograph Framed] => Array ( [attrib_id] => 111 [attrib_set_id] => 5 [attrib_text] => Lithograph Framed [attrib_adjustment] => 179.00 [sku] => MM13LF ) [Canvas Giclee] => Array ( [attrib_id] => 112 [attrib_set_id] => 5 [attrib_text] => Canvas Giclee [attrib_adjustment] => 350.00 [sku] => MM13CG ) [Canvas Giclee Framed] => Array ( [attrib_id] => 110 [attrib_set_id] => 5 [attrib_text] => Canvas Giclee Framed [attrib_adjustment] => 450.00 [sku] => MM13CGF ) [Lithograph] => Array ( [attrib_id] => 109 [attrib_set_id] => 5 [attrib_text] => Lithograph [attrib_adjustment] => 70.00 [sku] => MM13L ) ) ) 1
Thanks!