I’m currently developing a try before you buy app and I need to develop a functionality in the customer account which allow him to manage his trial product .for example, he order some trial products a t-shirt and a book and after receiving the products he decide to keep the t-shirt and return the book so i need a mechanism in the customer account allow him to pay for the t-shirt not the all order so I create the customer account extension an a full-page extension and I implement a table contain the order product each row has a checkbox to select which one to pay, and I implement a button “pay now” to handle the items selecting action, now I want when the customer select which products he want to keep and click pay now got redirect to the checkout page(to pay the remaining amount not starting the shipping process again !) With the selected products to pay the remaining amount because in the pre-order he pay for example 30% and to keep the product he has to pay for the 70% .
This is quite a specific feature to develop, but it’s definitely possible to do so. Here’s a possible approach you could try:
-
Create a new order for the remaining products: When the user finalizes their selection of products to keep and clicks on the ‘Pay Now’ button, you should create a new order containing only the selected products. This order will be for the remaining 70% of the product price that the customer still owes.
-
Redirect to the new order’s checkout: Once the new order is created, you can redirect the customer to the checkout page for this new order. You can do this by using the
checkoutUrlfield of the Order object in the Shopify API. -
Update the original order’s status: You should also update the original order to reflect that it’s been partially paid and partially returned. You could use order tags or metafields to keep track of this.
-
Handle returned products: For the products that the customer decided not to keep, you’ll need to handle returns and refunds as necessary.\n\nThis is just a high-level overview and there are many technical details you’ll need to work out.
You may also want to consider using a Shopify app that provides similar functionality, such as Bold’s Product Options or Advanced Custom Fields.