Announcement

Collapse
No announcement yet.

display image based on custom variables

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

    display image based on custom variables

    Is it possible to display an image based on price and / or product type?

    So basically, if the price is more than £100 and / or the product type is 'x' then display an image...

    I currently have...

    Code:
     <actinic:block php="true">
    $actinicprice = <actinic:variable name="ProductPriceRaw" selectable="false" />;
    $freethreshold = 100;
    if ($actinicprice > $freethreshold ) 
    {
    echo '<img src="image.gif" alt="image" />';
    }
    </actinic:block>
    I also have a varibale set up called 'producttype', but I can seem to combine the two with and / or.

    Is this possible?

    Thanks

    #2
    Are you aware that ProductType (note the capitalisation) is a SellerDeck variable. Best use something else.
    E.g. you could then test like.
    Code:
    '<actinic:variable name="MyProductStatus" encoding="perl" selectable="false" />' == 'x'
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks for that. How would I work that into the code so that it displays an image if the price is more than £100 and / or the product type is 'x' ? I can't seem to work that out without it briging up an error.

      Comment


        #4
        price is more than £100 and / or the product type is 'x'
        You can have AND or OR but having both is somewhat meaningless.

        Tutorial in the Starter Guide called Hiding Things With Conditions which can also be used to Show Things With Conditions.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment

        Working...
        X