Announcement

Collapse
No announcement yet.

Choice dependent pushbutton Images

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

    Choice dependent pushbutton Images

    On some of our products I am using an attribute with two choices ('sample' or 'item'). I use a push button grid to display both. I use images instead of buttons and I want a different image for each choice. I am trying to modify the 'Add to Cart Button' layout code (by use of conditional blocks) so that -

    if it is this type of product (strpos(<actinic:variable name="ProductName" />, "Fabric" - which works)

    the buttons should either have the 'sample' or 'item' image applied (e.g. <actinic:variable name="ChoiceName" /> == "Sample" - which doesn't work)

    Does anyone have any suggestions?
    Gerald

    #2
    Try two conditions and two images.

    The one you have will presumably set the add to cart button to the new 'sample' image - the != NOT EQUAL of the same condition test will set the add to cart button to the 'item' image.
    Bill
    www.egyptianwonders.co.uk
    Text directoryWorldwide Actinic(TM) shops
    BC Ness Solutions Support services, custom software
    Registered Microsoft™ Partner (ISV)
    VoIP UK: 0131 208 0605
    Located: Alexandria, EGYPT

    Comment


      #3
      Thanks for feed back, I have tried that. So if I seperately test for the choice names I get nothing, and if I test for their converse I get two buttons for each choice ie 4 buttons. I think the problem lies in test for choice names and I think it's a logic failure rather than an incorrect choice name variable.
      Gerald

      Comment


        #4
        Reading this again it would seem you have three add to cart images (in pseudo code)

        block if /* test for NOT fabric
        normal add to cart button
        end block
        block if /* test for fabric
        block if /* test for 'selected option' = "Sample"
        sample button
        end block
        block if /* test for 'selected option' = "Item"
        item button
        end block
        end block

        the variable to use for test will I think be ChoiceSelectedValue which is numeric so you will be testing for values of 0 and 1 if it is a zero based index, and for 1 and 2 if the index starts with 1.
        Bill
        www.egyptianwonders.co.uk
        Text directoryWorldwide Actinic(TM) shops
        BC Ness Solutions Support services, custom software
        Registered Microsoft™ Partner (ISV)
        VoIP UK: 0131 208 0605
        Located: Alexandria, EGYPT

        Comment

        Working...
        X