PDA

View Full Version : show weights?


0ad
28-Oct-2003, 09:37 AM
hi all

can you show the product weight in the productline page without having to use customvars? i was hoping there was a netquotevar:weight i could throw into the template.

cheers

j

cdicken
29-Oct-2003, 12:53 PM
I'm afraid there is no handy variable, so you will need to use custom properties to include the value.

0ad
29-Oct-2003, 02:01 PM
cheers chris

thanks for your help

j

0ad
21-Apr-2011, 08:03 AM
8 years on..but in v9, can we show weights on product pages?

leehack
21-Apr-2011, 08:12 AM
Pretty sure you can yes, try adding it from the variable list.

Duncan Rounding
21-Apr-2011, 08:18 AM
I don't think all the variables are exposed for the product weights (ShippingWeight is but not Alternative Weight) however here is a method to extract the data from the Actinic database in the design (http://actinic-tips-n-tricks.posterous.com/how-to-access-data-from-the-database-in-actin) that will allow you to use the value in a layout. The example is for the Alternate Weight but could be any data by changing the SQL query.

Note thanks go to many forum contributors for this, it is not entirely my own work.

Golf Tee Warehouse
21-Apr-2011, 08:22 AM
We add a weight using the following code which will convert kg into g when the weight is less than 1 kg, assuming you have entered your weight in kg.

<actinic:block php="true" >
$weight = '<actinic:variable encoding="perl" name="ShippingWeight" selectable="false" />';
if ($weight == '') $weight = 0;
if ($weight < 1 {
echo ($weight * 1000) . 'g';
}
else
{
echo $weight . 'Kg';
}
</actinic:block>

0ad
21-Apr-2011, 08:36 AM
some excellent advice there, thanks guys!