Message in cart drawer when below minimum order quantity

DragonVaults
New Member
1 0 0

Hi all,

I am building a wholesale website on a budget in the Debutify theme. I am using the cart drawer so customers can easily add to their order and change quantity. This all works fine.

I also want to add a notice and hide the checkout button if the total is below 100 or above 1200. I got it to work on the normal cart but on the drawer it does not update unless I reload the page, which makes sense because there is no function updating this. 

I am not at all experienced with ajax but I do understand programming logic. What do I have to do to make this update just like the quantity selector does?

 

PS: here is the changes I made to ajax-cart-template.liquid

{% if customer %}
          {% if cart.total_price < 10000 %}
                {% raw %}
                    <p style="background-color: #C98127; color: #E7E8ED; padding: 6px;">Please order a minimum quantity of 10 trays <br>(e.g. two packs of 5 or one pack of 10)</p>
                {% endraw %}
              {% elsif cart.total_price > 120000 %}
                {% raw %}
                    <p style="background-color: #C98127; color: #E7E8ED; padding: 6px;">Maximum order quantity of $1200 exceeded. Please contact us for a larger order so we can schedule it realiably.</p>
                {% endraw %}            
              {% else %}
                  {% raw %}
                      <button type="submit" class="btn btn--buy btn--full cart__checkout ajaxcart-checkout" name="checkout">
                          <span class="btn__text">
                  {% endraw %}
          {% endif %}
        {% endif %}

 

Thanks

 

PS: I am not looking to buy an add-on or another subscription. My budget won't allow it. I am sure with community help I can figure it out

0 Likes