I have created an attribute price_used and the type is price. I know how to display this price in frontend, i use this method and it works ok:

<?php echo Mage::helper('core')->currency($_product->getPriceUsed(),true,false); ?>

I need to create a separate addtocart for this price, i have tried many things for example overide observer but it will affect also normal price.

What would be the correct method to make this work for my custom price and also not affect the normal price?

I do not want to use magento's custom options for products.

2 Answers 2


You can use the original_custom_price and custom_price attributes of Mage_Sales_Quote_Item.

You could use an observer attaching the checkout_cart_product_add_after:


And, in your observer:

public function checkoutCartProductAddAfter(Varient_Event_Observer $observer) {
    $item = $observer->getQuoteItem();
    $product = $item->getProduct();


This will set used_price as price in the cart, but will leave the product price unvaried.

I did not test the code, but should work. Hope it helps.

  • Thank you @RiccardoT , @Senthil for your answers, now i understand clear that i need to go with the observer method. I know that it might sound stupid, but how i add the product to the cart using the custom function?I tried <a href="<?php echo $_product->getcheckoutCartProductAddAfter(); ?>">add to cart custom </a> Mar 7, 2016 at 5:03
  • You could use a parameter in the querystring and intercept that in the observer. Mar 7, 2016 at 7:29
  • thanks, can you please give me an example for the query string?From what i understand i need new function in observer like Mage::app()->getRequest()->getParam('price_used') == '1') and then encode it in the addtocart querystring url Mar 9, 2016 at 3:03

You can use catalog_product_get_final_price observer. Observer function would be some thing like this.

public function setFinalPrice(Varien_Object $observer){   
$product->$observer->getEvent()->get product();
$price = $product->getCustomPrice();$product->setFinalPrice ($price);

Then have your definition in the config.xml

  • This will affect the standard price, he does not want Mar 7, 2016 at 7:30
  • Thanks Riccardo. He can have a conditional statement in there to check that. That way this can be skipped. Mar 7, 2016 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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