Magento product name

Posted by Kudja on Stack Overflow See other posts from Stack Overflow or by Kudja
Published on 2012-07-03T15:12:17Z Indexed on 2012/07/03 15:15 UTC
Read the original article Hit count: 189

Filed under:

I wish to change product name when someone adding this product to cart. All product are simple. Magento v. 1.7.0.0

If I try to change it's name in Mage_Checkout_Model_Cart - addProduct method in that way for example:

if ($request->getMyParam()) {
    $product->setName($product->getName() . ' (' . $request->getMyParam() . ')');
}

than I have message that I added product with MyParam but in cart really I have simple product name from catalog

The same thing happent when I trying to do same thing in Mage_Sales_Model_Quote - addProductAdvanced method

So where I must change this name to save this name in cart and then in order details too. Or maybe I can create some additional custom options on he fly when I adding to cart or saving product.

Thnx for all who can help with this

© Stack Overflow or respective owner

Related posts about magento