Announcement

Collapse
No announcement yet.

creating block/condition for shopping cart

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

    creating block/condition for shopping cart

    I'd like to try to create a condition for our sidebar shopping cart summary so that it only appears in the sidebar once you have added something to the cart - can anyone tell me how this works?

    We have our side bar code in the overall layout :
    Code:
     <div id="right">
       <actinic:variable name="ShoppingCartSummary" value="Shopping Cart Summary In Box" />
       <actinic:variable name="CustomSidebarBox" value="Special offers (+)" />   
       <div><actinic:variable name="CustomSidebarBox" value="Freeshipping (+)" /></div><br/>
       <actinic:variable name="CustomSidebarBox" value="TrailZilla Affilliate" />
    Also, if at all possible it would be great to make the FreeShipping variable also conditional so that disappears when someone puts something in the cart - so the side bar doesn't get too crowded, but i'm not massively worried about this.

    All help and suggestions gratefully received!

    #2
    You can't use a blockif (if that's what you mean) on the website.
    These only work offline (to show Actinic what to include/not include when creating pages/uploading)
    Tracey

    Comment


      #3
      You'll have to use JavaScript. You can use getCartItem(3) to return the number of items in the shopping cart. If non zero, enable the display of the summary.

      E.g (untested):
      Code:
      <span id="summary" style="display:none">
      SUMMARY CODE HERE
      </span>
      <script>
      if (getCartItem(3) > 0) document.getElementById('summary').style.display='';
      </script>
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment

      Working...
      X