0

I have set up a custom product type for my configurator in magento. Now everything seems to be fine. If I do a second conf with the existing product, not a second "row" is added to the cart. It does sum up the cart item to be an amount of 2.

How can I prevent this?

This is the code in config.xml:

<product>
            <type>
                <econfigurator translate="label" module="econfigurator">
                    <label>Econfigurator Product</label>
                    <model>econfigurator/product_type</model>
                    <price_model>econfigurator/product_price</price_model>
                    <is_qty>1</is_qty>
                    <composite>1</composite>
                    <can_use_qty_decimals>0</can_use_qty_decimals>
                </econfigurator>
            </type>
        </product>

Thank you!

1

The simplest way to do it is to override the Mage_Sales_Model_Quote_Item::representProduct method.

add this at the top of it.

$itemProduct = $this->getProduct();
if ($itemProduct->getTypeId() == '`econfigurator ') {
    reutrn false;
}
// original code here

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.