Announcement

Collapse
No announcement yet.

Multiple Choice Variables

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

    Multiple Choice Variables

    Hi,

    This would be a multiple choice style variable. e.g. you add choices to a varaible and then when it is used you can choose as little or many of the choices as you wish.

    This variable would require a new type of "block" being used, an 'for_each' type. For example,

    Code:
    block if multichoicevar <> ""
      Block for_each = multichoicevar
        echo "multichoicevar"
      end for_each block
    end block
    this code would simply repeat for each option selected (in this example, it would just show the name of each option in a row). You should be able to test the variable to see if it has any options selected so you can ignore the whole block.

    Thanks,
    Paul.

    #2
    Where will this loop be processed? Actinic does its processing on your PC when it builds the pages - so is this something you will populate in setup and create multiple layouts from?

    If you want to present choices to the customer and repeat an action online based on the customer choices, then you need something that will run on the server - not something in Actinic.
    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
      Hi Bill,

      This loop would be done on actinic side as it does with other blocks. Here is an example that I would like to use.

      I have a varaible called "Awards", in that awards variable I have a list of awards, e.g. Gift Association Best Gift 2006, Gift Association Best Gift 2007 etc etc.

      For each product I have, I click on the variable and using check boxes select the ones that that applies to that product.

      In actinic code I have an if block which asks if there are any awards selected, and if so, then the block runs. For each award that is ticked, It displays the award name.

      Code:
      Block If vAward <> ""
        This product has won the following awards:  <br>
        Block For vAward
          vAward<br>
        End For
      End If
      You could use this for colours, sizes, designs, anything where by you want to show a list to the customer.

      I guess you could even use it to create checkboxes or select box for the customer to select from. It could be quite a useful tool and I can think of quite a few things that I could use this for.

      Code:
      Block If vGifttag <> ""
        Echo "Select your Gifttag"
        <SELECT>
        Block For vGifttag
           <OPTION  vGifttag>
        End For
        </SELECT>
      End If
      Thanks,
      Paul.

      Comment


        #4
        Hi Paul

        I'm afraid I don't really follow how this would work. Could you maybe give an example of how this would improve the customer shopping experience?

        Comment


          #5
          Hi Chris, I have two realworld examples. I would like to modify the original description to allow a reference and then text within the variable - When selecting the various choices in the product, you would just see the reference. Its not neccesary, but might make it easier to use.

          I have given a couple of examples and gone into as much detail as possible as it seems I can not explain myself properly!

          Thanks,
          Paul.

          Example 1:
          1. I configure a new variable vColour.

          Code:
          Variable: vColour
          Options:
          Ref = Text Used
          Red = swatch_red.gif
          Yellow = swatch_yellow.gif
          Green = swatch_green.gif
          Blue = swatch_blue.gif
          2. I goto my products and select as many of the colours as I need.
          3. I code into Actinic:

          Code:
          If vColour <> "" //If no options are selected, ignore.
            Echo "Colour Options:"
            Loop vColour  //Loop all selected options within this variable.
              Echo "<div style='background-image:<vColour>'></div>"
            End Loop
          End If
          This example would create a div containing an image/colour for each colour I have selected.

          Example 2.

          Same again, I create a new variable called "vNotes". I populate it with:

          Ref = Text Used
          Heavy = "A special postage surchage applies to this item."
          Bulb = "A bulb is supplied FOC"
          Special = "This item is made to order".

          For my handmade lampshade I select the Special & Bulb options. For my heavy items I select the heavy option.

          In my code I have

          Code:
          If vNotes <> "" //If no options are selected, ignore.
            Echo "<U>Please Note:</U>"
            Loop vNotes  //Loop all selected options within this variable.
              Echo "<span class="product_notes"><vNotes></span><br>"
            End Loop
          End If
          This example would create:

          "Please Note:
          This item is made to order.
          A bulb is supplied FOC."

          To produce the same result now I would need either a single text variable (not an option if you have lots of the same) or a list variable. The list variable though would can get complicated if you have lots of different choices etc. You would need "A bulb is supplied FOC", "This Item is made to order", "A bulb is supplied FOC. This item is made to order". Thats three options for just the two choices.

          Comment

          Working...
          X