Announcement

Collapse
No announcement yet.

display text on OSEL page depending on basket quantity and product coes

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

    display text on OSEL page depending on basket quantity and product coes

    I am attempting to write some code that will display a text message on the page if the basket contents is under 5000 USD or if it is NOT one of several product codes. I came up with this, but it's totally useless and wrong. If someone can help me format this correctly, it would be appreciated,

    <mvt:if expr="( l.settings:basket:total LT '5000') OR (l.settings:Product_Code NE '50') OR (l.settings:Product_Code NE 'EXTERNAL') or (l.settings:Product_Code NE 'Digital_Map')">
    TEXT
    <mvt:else>
    TEXT2
    </mvt:if>

    Which just displays the world TEXT.

    Kevin



    __________________________
    GEOGRAPHIUCS ANTIQUE MAPS
    923 Putnam Ave
    Brooklyn,NY 11221
    TEL: 646-320-8650
    www.GEOGRAPHICUS.com

    #2
    OR an even better way to do it would be to set this up such that if the basket value is under 5000 OR the products in basket are NOT in a certain category, say EXCLUDE, then the specified text would load.

    __________________________
    GEOGRAPHIUCS ANTIQUE MAPS
    923 Putnam Ave
    Brooklyn,NY 11221
    TEL: 646-320-8650
    www.GEOGRAPHICUS.com

    Comment


      #3
      It depends on where you want to display the message if the variables are available.

      You may need to set a flag variable within the the products group array:

      Code:
      <mvt:foreach iterator="group" array="basket:groups">
      
        <mvt:if expr="l.settings:group:code CIN '50|EXTERNAL|Digital_Map'">
          <mvt:assign name="g.has_excluded_product" value="1" />
        </mvt:if>
      
      </mvt:foreach>
      Setting the variable with global scope allows you to use it anywhere on the page.
      Then use it in the basket:charges array to test the conditional:

      Code:
      <mvt:if expr="( l.settings:basket:total LT '5000') OR g.has_excluded_product">
      
      TEXT
      
      <mvt:else>
      
      TEXT2
      
      </mvt:if>

      http://www.alphabetsigns.com/

      Comment

      Working...
      X