cart-quantity-validation Checkout Function
A Shopify Checkout Function for preventing particular actions on items within the Cart
Last updated
A Shopify Checkout Function for preventing particular actions on items within the Cart
Last updated
The cart-quantity-validation Checkout Function runs on Shopify's servers, monitoring updates to a customer's Cart. It's only purposes, are:
Prevent the customer from updating the quantity of an item from directly within the cart. A customer needs to check availability for the quantity they want from the PRP Rental Widget on the product page. If we didn't prevent quantity updates, a customer could start with a quantity of 1 when looking at the rental availability calendar, then increase it to 10 once they arrive to the cart, essentially bypassing the availability calendar.
Prevent the customer from removing a Security Deposit product from the cart, whilst the rental product it's connected to is still in the cart.
To enable either of the capabilities above, the Checkout Function must be enabled on your store.
Go to Shopify Settings > Checkout.
Scroll down to the bottom and look for the box named Checkout rules. Click Add Rule.
A popup will appear with a list of available checkout rules on your store. Click on cart-quantity-validation under PRODUCT RENTALS PRO.
The rule screen will first ask you to save settings. Leave "allow all customers to complete checkout" ticked and click Save. The checkout rule is added.
Even thought the checkout rule has been added, it is not turned on by default. Click Turn on at the top right of screen.
The On badge appears next to the title, meaning the Checkout Function is active, and the setup is complete!