Specifically, we have 2 issues:
-
There is no ability to base product discounts on the shipping method selected
-
There is no ability to add line item properties.
How do we transition this functionality?
A merchant is seeking alternatives for two Scripts features being deprecated:
1. Shipping-method-based product discounts:
The merchant runs a program that refunds previous shipping costs when bundled orders exceed a free shipping threshold, but only for specific shipping methods. This requires applying product discounts based on the selected shipping method.
Suggested workaround: Use client-side code (UI extension or Theme extension) to set a cart attribute when the shipping method changes, which the Discount Function can then read to determine discount eligibility.
2. Adding line item properties:
The merchant’s reporting processes depend on line item properties added via Scripts.
Suggested solution: Implement this client-side using UI extensions, Theme extensions, or custom cart code in the theme, as Functions cannot directly add line item properties.
Both solutions require moving logic from server-side Scripts to client-side implementations, representing a significant architectural change from the current approach.
Specifically, we have 2 issues:
There is no ability to base product discounts on the shipping method selected
There is no ability to add line item properties.
How do we transition this functionality?
It would be very helpful to understand what business problem the merchant is trying to solve that you used to use these two Scripts features for, then we can suggest solutions using the features that exist in Functions or that are in the roadmap.
We have a program where we pay back previous shipping on orders being bundled together if all orders in the bundle go over the free shipping limit. We can only do this when a certain shipping method is present. Shipping is already being discounted to free for this shipping method, and this is an additional discount.
As for line item properties, we built many of our reporting processes around line item properties we add via scripts.
For line item properties, you would need to do this client-side via a UI extension or Theme extension or with a custom cart in your theme.
A workaround for informing your Discount Function’s cart lines target about the selected shipping method would also involve client-side code, using a UI extension or Theme extension to set a cart attribute when you observe a change to the shipping method.