Announcement

Collapse
No announcement yet.

Quantity Limits - Show Category Limits on PROD page

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

    Quantity Limits - Show Category Limits on PROD page

    Hi,

    Quantity Limits by Miva works well - but as noted elsewhere it doesn't give you the 'OOPS!' until you start to check out. I tested the category limits and works fine but I want to place the category limit note on PROD and not getting it.

    Code:
    <mvt:item name="quanlimits" param="QuantityLimit_Load_Category( l.settings:category:id, l.settings:category:cumulative_limits )" />
    <mvt:if expr="l.settings:category:cumulative_limits:max_qu an GT 0">
    <br><span style="background:#F4FF61; padding: 2px 4px !important; font-size: .62em; color: #333; font-weight: normal; font-family: 'Roboto Condensed'; display: inline-block; margin-top: 2px">Limit &mvte:category:cumulative_limits:max_quan; per customer<br>cumulative total of items in this category</span>
    <mvt:elseif expr="l.settings:category:cumulative_limits:min_qu an GT 0">
    <br><span style="padding: 2px 4px !important; background:#F4FF61;font-size: .62em; color: #333; font-weight: normal; font-family: 'Roboto Condensed'; display: inline-block; margin-top: 2px;">Minimum cumulative purchase of &mvte:category:cumulative_limits:min_quan; units required<br>of items in this category</span>
    </mvt:if>

    #2
    Typically the variable l.settings:category:id is not available on PROD unless you are explicitly passing it. How are you getting the category:id in this case to load the data from?
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Originally posted by Brennan View Post
      Typically the variable l.settings:category:id is not available on PROD unless you are explicitly passing it. How are you getting the category:id in this case to load the data from?
      I am using some code on PROD to show the category name (found code that Bruce posted on the forum)
      Code:
      <mvt:comment>
      *****************************************
      Start Show parent category name
      code snippet from Bruce on Miva forums
      https://www.miva.com/forums/node/705623
      11-27-2019
      *****************************************
      </mvt:comment>
      <mvt:do name="l.result" file="g.Module_Library_DB" value="CategoryList_Load_Offset_Product_Assigned(l .settings:product:id,0,'','',0,l.null, g.assigned_categories )" />
      <mvt:foreach iterator="category" array="global:assigned_categories">
      
      <mvt:comment>
      &mvt:category:active;<br>
      &mvt:category:code;<br>
      &mvt:category:id;<br>
      &mvt:category:name;<br>
      </mvt:comment>
      
      <mvt:if expr="l.settings:category:active">
      <div class="ctgy-name-badge">
      &mvt:category:name;:<br><span style="font-size: 1.1em">&mvt:product:name;</span>
      </div>
      </mvt:if>
      </mvt:foreach>
      
      <mvt:comment>
      Last edited by habreu; 05-13-21, 01:24 PM.

      Comment


        #4
        Could that product be assigned to multiple categories so that the wrong category id is being passed into the function?
        Brennan Heyde
        VP Product
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment


          #5
          Yes that is a possibility I hadn't considered.

          Comment


            #6
            Turns out that doesn't seem to be the problem and I got the code to work but I'm going to have to stick to product level quantity limits. I have a set up like this

            Corner Guards All
            - Child Category: 2" Corner Guards
            --Product: 2" Corner Guard 1
            --Product: 2" Corner Guard 2

            - Child Category: 3" Corner Guards
            --Product: 3" Corner Guard 1
            --Product: 3" Corner Guard 2

            etc

            But the category quanity limits does not cascade to products that are in teh child categories - so if I can have all 2" corner guards require a minimum purchase of 4, but I can not have a mixed cart of 2" and 3" corner guards if I assign it to the Corner Guards All root.

            It is still a useful module just would have to extend it and it isn't urgent.
            Last edited by habreu; 05-14-21, 11:12 AM.

            Comment

            Working...
            X