Announcement

Collapse
No announcement yet.

switch off cart button if there are attributes or components

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

    switch off cart button if there are attributes or components

    Hi

    I am using a modified CSS Product Layout and would like to switch off the add to cart button per product if there are attributes or components, such that customers can order simple products from a listings page, but have to go through to a extended info page if there are choices to be made. This is in order to keep the listings page compact.

    I have tried the following without success.

    Code:
    <actinic:variable name="IsAddToCartButtonShown" /> AND 
    (<actinic:variable name="NumberAttributesInPushButtonGrid" /> == 0)
    
      (<actinic:variable name="AttributeCount" /> == 0) AND 
      (<actinic:variable name="ComponentCount" /> == 0)
    
        <br /><actinic:variable name="AddToCartButton" />
    
      [close block if]
    
    [close block if]
    I notice that the AttributeCount and ComponentCount vars are bold in the condition dialogue, whereas the vars in the outer block if (factory) are not bold.

    Perhaps I cannot use the Count vars here, or is the wrong tree being barked up?

    Many thanks, Dan
    adaptive-image.co.uk

    #2
    I have one idea, which I'm not overly happy with.

    Perhaps I can use an Attribute List, within an Attribute List Layout, with the markup in the first Layout line to open Javascript, then put a counter in the middle bit and close Javascript at the end. Thus outputting no HTML, but creating a variable (count) which I can then test for in the block if around the Add To Cart layout.

    I don't really like the idea of doing it this way, but if there's no alternative...?

    Thanks, Dan
    adaptive-image.co.uk

    Comment

    Working...
    X