Preventing Quantity Updates on your Cart page
Stopping customers from changing the quantity after bypassing the availability calendar
Last updated
Stopping customers from changing the quantity after bypassing the availability calendar
Last updated
Updating the quantity of a rental product on the Cart page is a way for customers to essentially bypass the availability calendar in the Rental Widget. You may only have 1 unit available for particular dates, but on the Cart page, the customer could update the quantity to 2, without any check against the availability calendar required.
For this reason, many rental businesses disable or remove the quantity selector on their Cart page, at least for rental line items.
There are two ways to solve this problem. One involves a few clicks and our Cart Validation Function. The other is a bit nicer, but involves theme code updates, which may be done differently on each theme.
The PRP Cart Validation Function is code that runs on Shopify's servers that checks updates made to the Cart to see if they should be allowed. In this specific case, it checks that the quantity for any rental item stays as the quantity with which it was originally added to Cart with, from the PRP Rental Widget (the availability calendar) on the product page.
Any attempts to update the quantity of a rental item via a Cart page or Cart drawer will show this message:
Unfortunately it's not possible for an app to enable a Cart Validation Function function automatically, so you'll need to do it yourself by following these steps:
Go to Shopify Settings > Checkout
Scroll to the bottom, to Checkout Rules then click Add Rule
Select the Product Rentals Pro cart-quantity-validation
Click Save
The "On" green label should be visible next to the title. You can now exit settings.
By modifying your theme code, you can hide the quantity fields altogether for any rental items in the Cart.
More detailed instructions are coming for this soon. However, for developers, this is relatively straightforward. In the Cart's liquid file, where the Cart items are being output into the Cart table, first check if the Cart item has a line item property of _prp_id
If it does, it's an item that was added to Cart via the PRP Rental Widget. For these items you can just output the quantity as text, rather than as an input field that can be updated by the customer.
Click Turn On at the top right of the box