Announcement

Collapse
No announcement yet.

Displaying a message based on shipping method

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

    Displaying a message based on shipping method

    I can display the shipping method using
    Code:
    <mvt:assign name="l.settings:shipping_method_found" value="0" />
    <mvt:foreach iterator="charge" array="order:charges">
    <mvt:if expr="l.settings:charge:type EQ 'SHIPPING'">
    &mvt:charge:descrip;
    <mvt:assign name="l.settings:shipping_method_found" value="1" />
    </mvt:if>
    </mvt:foreach>
    What I want to be able to do is display a message designed for a method. I thought maybe this would do it

    Code:
    <mvt:if expr="'UPS' CIN g.order_charge:descrip">Found a Match</mvt:if>
    I tried it in and out of the loop - it didn't work. What am I doing wrong?

    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    #2
    g.order_charge us not a standard variable. Did you mean to use l.settings:charge?
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


      #3
      Originally posted by Kent Multer View Post
      g.order_charge us not a standard variable. Did you mean to use l.settings:charge?
      I dunno - it's what I found when using the Token List
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

      Comment


        #4
        The Token List doesn't show "where" a variable is created. Especially for global variables. In general, l.settings:variable name are loaded before the page template runs. However, many l.settings: variables are arrays so you can just express them with a foreach. You might want to do something like:

        [code]

        <mvt:foreach iterator="charge" array="order:charges">
        Existing code.

        <mvt:if expr="'UPS' IN l.settings:charge:descrip"/>
        <mvt:assign name="l.settings:my:showUPSMessage" value="'yes'"/>
        </mvt:if>

        </mvt:foreach>

        then

        <mvt:if expr="l.settings:my:showUPSMessage">
        <p>Hope you don't want it soon.</p>
        </mvt:if>
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment

        Working...
        X