Rental Widget - Advanced Customization
Perform custom actions when a customer interacts with the Rental Widget
Event Triggers
prp::cart:added
prp::cart:addedProperty
Description
Code Example
// This event fires whenever an item is added to cart via the Rental Widget
document.addEventListener('prp::cart:added', (event) => {
// Reset the Rental Widget
// This is the default when using event.preventDefault() anyway,
// but showing here for the example
event.detail.whenPrevented.dontReset = false;
// Don't redirect to the full Cart page
// This is the default when using event.preventDefault() anyway,
// but showing here for the example
event.detail.whenPrevented.redirect = false;
// This stops the navigation to the full cart page
event.preventDefault();
// Code for any action you want to take goes below
// The next 2 lines are not functions that would work your store
// you would need to use the equivalent functions your theme/store uses
// to trigger a quick cart refresh and open the cart drawer
refreshQuickCart();
openCartDrawer();
});prp::variant:unavailable
prp::variant:unavailableCode Example

prp::variant::changed
prp::variant::changedCode Example
Date Selection Validator
Other Custom Development
Code Example - Custom Field for Pickup Time

Code Example: Add a simple Terms & Conditions checkbox before the Rent Now button

Code Example - Add extra information about 'Buy Now' items

Last updated