Mix and match purchases in multiples

Thecookiedealer
New Member
4 0 0

Hi guys,

Does anyone know how to add purchase limitations? I want customers to be able to mix and match in multiples of five. Any help would be greatly appreciate 

Thanks

0 Likes
PaulNewton
Shopify Partner
2579 134 440

Crudest way is to only allow checkout through the /cart page and wrap the checkout button in logic checking cart totals.

This also means turning off or hiding accelerated checkout buttons everywhere else like product pages and also on the /cart page.

{%-comment paull.newton+shopifycustomizations@gmail.com %}
 prices are in pennies
 optionally place minimum message into a disabled checkout button
 optional - upsell_product takes a product handle to upsell a specific product with a simple message with link
 move code for checkout buttons under the else tag
 {%endcomment%}
{% assign checkout_minimum = 10000 %}
{% assign upsell_product == "" %}
{% if cart.cart-total_price < checkout_minimum %}
 <p>{%if customer%}customer.first_name{%endif%} add {{ checkout_minimum | minus: cart.cart-total_price | money }} more to your cart</p>
{% if upsell_product != blank %}
 Here's a product you may like {{  all_products[upsell_product].title | link_to: all_products[upsell_product].url,all_products[upsell_product].title }}!
{% endif %}
{%else %}
 <! -- checkout button code -->
{% endif %}

 

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes
Thecookiedealer
New Member
4 0 0

Hi Paul,

thanks for the reply but unfortunately that doesn’t mean anything to me. I was hoping there would be a Shopify app that would do it for me?

 Thanks 

0 Likes
PaulNewton
Shopify Partner
2579 134 440

This is the technical forum there is a forum for questions seeking app solutions: https://community.shopify.com/c/Shopify-Apps/bd-p/shopify-apps

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes
klob
New Member
1 0 0

I've trying to do similar logic before checkout, so the checkout button would be disabled/hidden (and a notification message would be displayed) if certain product combination criteria is not met. For instance, something like this:

- quantity of product with SKU xxx needs to be at least n
- products with SKU yyy (add-on) cannot be in cart without product with SKU xxx (main product)

Is your code example supposed to be injected into cart-template.liquid? If so, what I've observed that if the user is changing the quantities when still on the cart page, the {{ cart.items }} are not changing on the fly, so any if-else-logic based on that solely with liquid is not adequate. Is there way to achieve this?

0 Likes