Script Editor - Discount in Line items basead in Shipping rate name

Solved

Script Editor - Discount in Line items basead in Shipping rate name

igormarcondes
Tourist
4 0 2

I need to apply discount on cart items based on delivery method, is it possible to do this? if yes, how can i do it?

Accepted Solution (1)
Stephen_Baker
Shopify Partner
7 1 4

This is an accepted solution.

It's a bit hacky, but you could create a product called "Pick up in store" (or whatever wording you prefer) that costs $0.

Create a Line Item script to apply a discount to the whole cart if the cart includes that product.

Create a Shipping script to show only the "Pick up in store" shipping method if that item is in cart, and hide that shipping method and show all others if the cart does not include the item.

View solution in original post

Replies 4 (4)

playwright-mike
Shopify Partner
72 18 33

Hi Igor,

Only shipping scripts have access to shipping rate names. And shipping scripts can only discount the shipping rate amount (not line item amounts). 

Can it work to discount the shipping rate?

 

Matthew

Playwright | Create Shopify Scripts without writing code | https://playwrightapp.com
- Was my reply helpful? Please Like and Accept Solution.

igormarcondes
Tourist
4 0 2

unfortunately no, I need to discount a percentage of the value of the items in the cart, as the customer will get a discount when they pick it up at the store.

Is there another way to give a discount when picking up?

Stephen_Baker
Shopify Partner
7 1 4

This is an accepted solution.

It's a bit hacky, but you could create a product called "Pick up in store" (or whatever wording you prefer) that costs $0.

Create a Line Item script to apply a discount to the whole cart if the cart includes that product.

Create a Shipping script to show only the "Pick up in store" shipping method if that item is in cart, and hide that shipping method and show all others if the cart does not include the item.

igormarcondes
Tourist
4 0 2

great solution, thank you very much