Change original_line_price?

gina-gregory
Shopify Expert
647 37 141

I am trying to set up tiered pricing on a store using Scripts. When a product goes on sale, we need to calculate the discount based on the compare at price, not the sale price. No problem there. But this also means, the original line price needs to be re-calculated based on the compare price. I tried simplying reassigning the line_item.original_line_price but I got an error (undefined method).

Is there a way to change the original line price in the Script Editor?

I really don't want to have to manually check for this and manually update on the cart and checkout templates...

0 Likes
mayks
Shopify Expert
7 0 2

For the product and cart page, I believe this should be doable. You could try to create a new variable which value is calculated from the original_line_price and have it displayed on the front-end.

The real problem will be when the customer goes to the Checkout, and later on order email, it will display the original_line_price.

In your situation, I wonder if you should make use of the product data export/import feature. It is obviously not going to be as convenient, but probably the safest approach. Using simple formula when opening it on a speadsheet, you can quickly update the pricing and then import the products data back to Shopify.

0 Likes
hossein
New Member
1 0 0

i need something like this too , i made a price calculator with JS in front (it increase the price ),everything is ok till i changing total price of an item in cart and checkout , I tried to approche this in script but could not change original_line_price . any idea pleasss?

0 Likes