Announcement

Collapse
No announcement yet.

Tool Kit testing price group if else

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

    Tool Kit testing price group if else

    Hi,

    I'm trying to test if some one is in a price group and then show different information based on if they are or not. I'm not doing so well so was wondering if anyone has any ideas.

    So here it goes...this is what I'm trying to do:

    On the category and product pages show Price or "Log in" or "Call for Prices" based on the following:
    • if a customer is logged in but not assigned to the "Customers" pricing group to show a message that shows "Call for Prices"
    • if a customer is logged in AND a member of the "Customers"pricing group to show product prices
    • Else show Logged in button instead of product price


    I installed the Tool Kit Module and added the toolkit item to all pages. Then on the category page I inserted the code below. Unfortunately nothing shows now in the price area. Any suggestions?

    <!-- TEST PRICE GROUP -- PASTED THIS STRAIGHT FROM THE TOOL KIT DOCUMENTATION -->
    <mvt:item name="toolkit" param="pgroup|pcount" />
    <mvt:if expr="g.pcount GT 0">
    <mvt:foreach iterator="customer_pgroup" array="customer_pgroups">
    <br>&mvt:customer_pgroup:name;
    </mvt:foreach>
    </mvt:if>
    <!-- END TEST -->

    <!-- PRICE GROUP CONDITIONAL FOR SHOWING PRICES -- MY FAILED ATTEMPT -->
    <mvt:item name="toolkit" param="pgroup|pcount" />
    <mvt:if expr="g.pcount GT 0">
    <mvt:foreach iterator="customer_pgroup" array="customer_pgroups">
    <mvt:if expr="l.settings:customer_pgroup:name EQ 'Customers'">
    <div class="item-price pull-left">&mvt:product:formatted_price;</div>
    <div class="button pull-right"><a href="&mvte:product:link;">Buy Now</a></div>
    <mvt:else>
    <p><strong><mvt:item name="cssui_links" param="customer_login">LOGIN TO BUY</mvt:item></a></strong></p>
    </mvt:if>
    </mvt:foreach>
    </mvt:if>
    <!-- END CONDITIONAL -->

    Thanks,
    Daphne
    Last edited by daphne; 10-17-14, 08:24 AM.

    #2
    Re: Tool Kit testing price group if else

    Your code looks ok, try outputting &mvt:customer_pgroup:name; in the for each loop to see what is displaying.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Tool Kit testing price group if else

      Originally posted by Brennan View Post
      ...try outputting &mvt:customer_pgroup:name; in the for each loop to see what is displaying.
      Notice in the first group of code marked as "TEST" that I did do that and nothing is being returned.

      Comment


        #4
        Re: Tool Kit testing price group if else

        Are you logged in as a customer and is that customer assigned to the right price group?
        Brennan Heyde
        VP Product
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment


          #5
          Re: Tool Kit testing price group if else

          Originally posted by daphne View Post
          Notice in the first group of code marked as "TEST" that I did do that and nothing is being returned.
          Nope and now I am and it is working :) Yeah. Thanks!!!!

          Comment

          Working...
          X