rramiii
rramiii

Reputation: 1186

how to force magento to use my custom price

Hi and thanks for reading, I'm working on magento EE 1.13, here I added new price fields to product edit page (offer price and deal price) beside the original price and special price fields. and here the problem come: I need to make magento use deal price or offer price when they are set, I find it complicated and not easy to find. what I think is maybe I can override addFinalPrice method or override getFinalPrice method, but I'm not sure if it's right, need your help guys in this. any idea will be appreciated, thanks in advance. update: is there any way to save final price in database after saving finishing editing the product?

Upvotes: 1

Views: 1263

Answers (2)

Kandarp B Patel
Kandarp B Patel

Reputation: 1061

you need to add observer on event catalog_product_get_final_price. please check my below answer.

Magento : Add Product to cart with custom price

Upvotes: 3

Michael Leiss
Michael Leiss

Reputation: 5660

you misunderstood the concept i guess:

the purpose of the getFinalPrice method is to find the price respecting tier price, special price, and the regular price.

If you just want a final price, give the product a regular price and don't use tier_prices, special prices for the product. It is not for saving but for loading...

Update:

"is there any way to save final price in database after saving finishing editing the product?"

You don´t save the final price, the final price is built dynamically. If you want additional prices you need to add a price attribute and use the final price event to check your additional prices and use them - if needed - as final price.

Upvotes: 0

Related Questions