Announcement

Collapse
No announcement yet.

Help with Price Group Minimum Order

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

    Help with Price Group Minimum Order

    Hi,

    I recently updated Toolkit in preparation to install PR7. I was using toolkit to restrict our wholesale customers from checking out without meeting a minimum purchase requirement.

    After updating all my modules, the code for minimum orders was working fine. Now, all of a sudden it's not working. I have spent hours on the code, but can't isolate the problem.

    The code I was using before and immediately after the updates was:

    <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 'Wholesale'">

    <mvt:item name="toolkit" param="basket|itemcount" />
    <mvt:if expr="l.settings:toolkit:basketcount GT 0">
    <mvt:if expr="l.settings:toolkit:baskettotal LT 100.00">
    <br><br><b>Your order does not meet the $100.00 minimum for wholesale orders.</b><br><br>
    (Link back to storefront)
    </body></html>
    <mvt:exit>
    </mvt:if>
    <mvt:else>
    <br><br>
    Your basket is empty<br><br>
    (link to continue shopping)
    </body></html>
    <mvt:exit>
    </mvt:if>

    </mvt:if>
    </mvt:foreach>
    </mvt:if>


    I've tried using the code on Weiland's site, but it doesn't work either:

    <mvt:item name="toolkit" param="subtotal|basketsubtotal" />
    <mvt:if expr="g.basketsubtotal LT 50">
    <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 'Platinum'">
    <mvt:item name="toolkit" param="sassign|showmin|1" />
    </mvt:if>
    </mvt:foreach>
    </mvt:if>
    <mvt:if expr="g.showmin">
    <mvt:item name="toolkit" param="sacreate|error_message|Your price group requires $50.00 minimum order!|," />
    <mvt:item name="toolkit" param="sassign|Error_Message_Count|1" />
    <mvt:item name="toolkit" param="vassign|Error_Messages|l.all_settings:error _message" />
    <mvt:item name="toolkit" param="render|OMIN" />
    <mvt:exit>
    </mvt:if>
    </mvt:if>


    I've tried using Bill's code both ways - with a link back to the storefront and with the redirect to the OMIN page.

    I have no idea why this is suddenly not working, but am beginning to think it might not be the code, but something else that has gone awry.

    Any help would be greatly appreciated.

    Annie

    #2
    Re: Help with Price Group Minimum Order

    Annie - I know this is a year and a half later, but did you get this working? I'm needing a way to enforce an order minimum on a price group too.

    Thanks,
    Leslie
    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


      #3
      Re: Help with Price Group Minimum Order

      The 2nd example should work fine. It goes on the OSEL page before anything else on the page. Make sure toolkit is assigned to the items list of the OSEL page too.
      Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
      Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
      Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
      Facebook http://www.facebook.com/EmporiumPlus
      Twitter http://twitter.com/emporiumplus

      Comment


        #4
        Re: Help with Price Group Minimum Order

        Did anybody ever get this working? I have copied the code as is, pasted it at the top of the OSEL template code, assigned toolkit to the page, and changed the price group name to match ours, as well as assigned our test customer account to the group. But nothing is happening.

        Comment


          #5
          Re: Help with Price Group Minimum Order

          I was able to get this working by changing one minor thing in the toolkit code:

          Code:
          <mvt:item name="toolkit" param="subtotal|basketsubtotal" /><mvt:if expr="g.basketsubtotal LT 50">
          <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 'Wholesale'">
          <mvt:item name="toolkit" param="sassign|showmin|1" />
          </mvt:if>
          </mvt:foreach>
          <mvt:if expr="g.showmin">
          <mvt:item name="toolkit" param="sacreate|error_message|Your price group requires $50.00 minimum order!|," />
          <mvt:item name="toolkit" param="sassign|Error_Message_Count|1" />
          <mvt:item name="toolkit" param="vassign|Error_Messages|l.all_settings:error_message" />
          <mvt:item name="toolkit" param="render|OMIN" />
          
          
          </mvt:if>
          <mvt:exit>
          </mvt:if>
          </mvt:if>
          I moved an ending </mvt:if>

          Then I had to add
          Code:
          &mvte:global:Error_Messages
          for the error message to appear on the OMIN page.

          Now I will work on modifying this to work for quantity and not subtotal.

          Comment

          Working...
          X