View Full Version : show weights?
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.
cheers chris
thanks for your help
j
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>
some excellent advice there, thanks guys!
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.