0

I would like to add an additional fee to a product. This fee will then be calculated on top of the product's price. So in the catalog the regular product price will be displayed, and in the cart/checkout/emails/etc the price+addedfee will be displayed. Any specials or discounts will have to apply to the product's price only, and not the additional fee.

so basically I want the final price to be:

price = (magentos-calculated-product-price) + added-fee + tax-over-both

and in the cart I want to display for each item:

name | amount | unit price | added fee | subtotal

I know how to create a custom product attribute and how to sync that attribute to a quote and then an order. Also, editing the templates is not a problem.

What I would like to know is how and where should I do the price calculation? Should I use an event (which one?) or should I overwrite a core model?

There seem to be many different ways to accomplish this, and I don't want to break discount calculation or admin functionality.

3

Well if your fee is flat using a shopping cart price rule may be a good option.

Otherwise you can use catalog_product_get_final_price event.

  • looks like this might be the way to go. For some reason however, in my even observer, the product gotten from $observer->getEvent()->getProduct() does not contain a custom attribute that I have added. Do you know why this might be? (the attribute works fine everywhere else) – Maurice May 27 '14 at 12:38
  • This sounds like a new question ;) – user487772 May 27 '14 at 12:57
  • lol fair enough. Thanks for your answer, it looks like it's the way to go and if I can get this attribute thing working, I will mark it as accepted. For anyone interested, i asked the question here: magento.stackexchange.com/questions/21570/… – Maurice May 27 '14 at 13:15
  • Someone helped me out with that and now it all works. Cheers for the help! – Maurice May 27 '14 at 14:16
0

You can extend the Mage_Catalog_Model_Product_Type_Price model and overwrite the getFinalPrice() method.

  • I have just tested this and it seems to work fine. Is there any event that you know of that I could use instead? (So I won't have to modify core files) – Maurice May 27 '14 at 10:11
0

It is not the same question, but I think the same answer:

If you want to have this fee on order level, you might want to implement your own total model for this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.