Feedback for your online store from the community
I sell small leather goods and accessories, which my customers buy as a gift a lot of the times. Therefore, I started offering gift boxes as an additional service/product in case the customer wants a special box to put the accessory inside.
So, lets say I have a keychain as a product (USD 10) , and a gift box as another product (USD 5). What ends up happening is some people will like the gift box too much that they place an order for a gift box ONLY, but do not buy any of my products.
I want to restrict the purchase of the gift box in a way that a customer is only allowed to buy one gift box per product. For example, if the customer wanted to buy 1 keychain, they are allowed to add one gift box to their order, and if they want 3 keychains, they can add 3 gift boxes to the order
Hi @LeSoleil , for this kind of restriction you would need to include an app, or contact a developer to create a solution for you. Here is an example on how this should look like, of course this is not an exact solution for your case, since I don't have any details. But something like:
function restrictGiftBoxQuantity() {
fetch('/cart.js')
.then(response => response.json())
.then(cart => {
const giftBoxLimit = cart.attributes.gift_box_limit || 0;
let giftBoxCount = 0;
cart.items.forEach(item => {
if (item.product_type === 'Gift Box') {
giftBoxCount += item.quantity;
}
});
if (giftBoxCount > giftBoxLimit) {
alert(`You can only buy ${giftBoxLimit} gift box(es) based on the other items in your cart.`);
cart.items.forEach(item => {
if (item.product_type === 'Gift Box' && item.quantity > giftBoxLimit) {
const updatedQuantity = giftBoxLimit;
fetch('/cart/change.js', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
id: item.id,
quantity: updatedQuantity
})
}).then(() => location.reload());
}
});
}
});
}
document.addEventListener('cart:updated', restrictGiftBoxQuantity);
So you need to restrict users from buying gift box only, and to restrict the quantity of bought gift boxes, based on the number of other products in the cart.
Best
Hi, This is BSS Commerce
I think you can try B2B Wholesale Solution by BSS. We have all the features to help merchants manage and customize pricing, orders, and registration forms for B2B/B2C Customer Segment.
About the feature "Order Limit," you can easily modify the minimum order quantity so that the buyers are allowed to buy at lease a certain number of products per order. For example, in this case, this will be 1 gift box per product.
But if you don't want to use all of our features in-app, you can thoroughly describe for me what you expect, then we can check and give you the best suggestion
Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges: Get more sales with striking labels, badges, and banners from our 10,000+ available templates.
BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
Hi @LeSoleil ,
We can set a limit for the gift box purchase. And when they try to buy more than a limit, we can simply display the message or we can disable the ATC.
Let me know if you need help with the implementation.
Thank you
Learn what's possible with customizing Shopify Checkout beyond what's available out of...
By Shopify Feb 19, 20252m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025