Announcement

Collapse
No announcement yet.

show weights?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    #2
    I'm afraid there is no handy variable, so you will need to use custom properties to include the value.

    Comment


      #3
      cheers chris

      thanks for your help

      j

      Comment


        #4
        8 years on..but in v9, can we show weights on product pages?

        Comment


          #5
          Pretty sure you can yes, try adding it from the variable list.

          Comment


            #6
            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 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.

            Comment


              #7
              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.

              Code:
              <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>
              Darren Guppy
              Golf Tee Warehouse
              Golf Tees and Golf Accessories.

              Comment


                #8
                some excellent advice there, thanks guys!

                Comment

                Working...
                X