Announcement

Collapse
No announcement yet.

ShowForPriceSchedule within a php block

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

    ShowForPriceSchedule within a php block

    I have this code in the dynamic price layout, so far so good:
    Code:
    $rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> = <actinic:variable name="RRP" />;
    $rawprice<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> = <actinic:variable name="ProductPriceRaw" selectable="false" />;
    
    if ( ($rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> != 0) && ($rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> > $rawprice<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />) )
    {
    $savepercent = round((($rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> - $rawprice<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />) / $rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />) * 100);
    $savehowmuch<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> = round($rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> - $rawprice<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />);
    //echo "<h5 class='rrp'>RRP <s>".number_format((float)$rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> , 2, '.', '')."</s> You Save ".$savepercent."%</h5>";
    echo "<h5 class='rrp'>RRP <s>".number_format((float)$rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> , 2, '.', '')."</s> You Save £".$savehowmuch<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />."</h5>";
    I wish this line:
    Code:
    echo "<h5 class='rrp'>RRP <s>".number_format((float)$rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> , 2, '.', '')."</s> You Save £".$savehowmuch<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />."</h5>";
    to be only visible or active for Customer Group 1 AND not-logged-in customers.

    I wish this line:
    Code:
    echo "<h5 class='rrp'>RRP <s>".number_format((float)$rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> , 2, '.', '')."</s> You Save ".$savepercent."%</h5>
    To be ONLY visible or active for customer groups 2 and 4 (there is not a 3 in this site).

    php does not like '< >' so how can I show the respective lines for the respective price schedules (customer groups)?

    Thank you!
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    #2
    PHP code within SellerDeck layouts only works when building static HTML pages. You need something that works on the live web-pages. Try making your lines hidden HTML and use jQuery / JavaScript on the live page to enable their display if the required conditions are met.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Excellent Norman, thank you very much.

      I have come up with the following in the Dynamic Price Layout (take a copy first). There is one Retail customer group (1) and two trade groups (2&4):

      Code:
      echo "<h5 class='rrp'>";
      echo "<Actinic:NOTINB2B>RRP <s>".number_format((float)$rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> , 2, '.', '')."</s> You Save £".$savehowmuch<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />."</Actinic:NOTINB2B>";
      echo "<Actinic:ShowForPriceSchedule Schedules='1' HTML='RRP <s>".number_format((float)$rrp<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" /> , 2, '.', '')."</s> You Save £".$savehowmuch<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />."'></Actinic:ShowForPriceSchedule>";
      echo "<Actinic:ShowForPriceSchedule Schedules='2' HTML='Save ".$savepercent<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />."%'></Actinic:ShowForPriceSchedule>";
      echo "<Actinic:ShowForPriceSchedule Schedules='4' HTML='Save ".$savepercent<actinic:variable encoding="perl" name="EncodedProductAnchor" selectable="false" />."%'></Actinic:ShowForPriceSchedule>";
      echo "</h5>";
      Jonathan Chappell
      Website Designer
      SellerDeck Website Designer
      Actinic to SellerDeck upgrades
      Graphicz Limited - www.graphicz.co.uk

      Comment

      Working...
      X