Customizing your Ollie Shop checkout
In this tutorial, we'll use as an example a common customization used by online Drugstores. In many countries, in order for a store to be able to sell controlled substances it must require the customer to present their Medical Prescription.
Ecommerce is no different and online stores require customers to include a link to their digital prescription.
Before we start let's break down what needs to happen for this to work:
- We'll require a front-end component for the input box and the "send" button. This component must appear only for certain products, so only if the product has an attribute that labels it as a controlled substance product.
- When the user presses "send" the component must include the link in the Cart.
- We must make sure that this data makes its way to the ecommerce provider.
- If the action is successful the component should update to appear as if the link has been added to the cart.
In a nutshell what will happen is:
- A function will be created to enrich the cart data with the attribute for controlled substance. This way allowing for the component to appear accordingly.
- The component will use the Extension API to include the link in the cart.
- The Extension API, by default, raises an Event, which will be used to trigger a Function that will send the prescription data to the ecommerce provider.
- A separate function will be used to fetch the prescription information from the ecommerce provider. Whenever this is successful, it will reflect on the GET Cart operations of the Ollie Shop API.
Updated 6 months ago
What’s Next
The first step is to create the new component with the input box and the send button.