1

I've created a custom product type and use it to create products programmatically via SOAP. The strange thing is if I add the product to the cart I can not remove it via the delete link, it alerts me that it "Cannot remove the item.". Manually creating a product of that type gives the same error.

If I create my product via SOAP using the simple product type however it works. I've not come across this issue before. Any ideas?

The delete URL differs:

custom product type: /checkout/cart/delete/id/27994/uenc/aHR0cDovL2Rldi5jb25maXNlcmllLmRvY2tlci9jaGVja291dC9jYXJ0Lw,,/

simple product type: /checkout/cart/delete/id/27995/uenc/aHR0cDovL2Rldi5jb25maXNlcmllLmRvY2tlci9jaGVja291dC9jYXJ0Lw,,/form_key/u8AsmNXOi8nzJ8d0

Company/ConfiguratorProduct/etc/config.xml

<catalog>
    <product>
        <type>
            <configurator translate="label" module="configuratorproduct">
                <label>Configurator Product</label>
                <model>configuratorproduct/product_type</model>
                <is_qty>0</is_qty>
                <price_model>configuratorproduct/product_price</price_model>
                <index_data_retreiver>configuratorproduct/catalogIndex_data_configuratorproduct</index_data_retreiver>
                <composite>0</composite>
                <price_indexer>downloadable/indexer_price</price_indexer>
                <can_use_qty_decimals>0</can_use_qty_decimals>
            </configurator>
        </type>
    </product>
</catalog>

Company/ConfiguratorProduct/Model/Product/Price.php

class Company_ConfiguratorProduct_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Price
{

}

Company/ConfiguratorProduct/Model/Product/Type.php

class Company_ConfiguratorProduct_Model_Product_Type extends Mage_Catalog_Model_Product_Type_Abstract
{
    const TYPE_CONFIGURATOR = 'configurator';
}

Company/ConfiguratorProduct/Model/CatalogIndex/Data/ConfiguratorProduct.php

class Company_ConfiguratorProduct_Model_CatalogIndex_Data_ConfiguratorProduct extends Mage_CatalogIndex_Model_Data_Abstract
{
    public function getTypeCode()
    {
        return Company_ConfiguratorProduct_Model_Product_Type::TYPE_CONFIGURATOR;
    }
}

enter image description here

Magento 1.9.x

Your Answer

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

Browse other questions tagged or ask your own question.