Search code examples
magento-1.4magento-1.5magento

Added product not showing in magento shopping cart


I made a custom module that sell used product along with original product and in that i added an "Add to Cart" Button like this,

    <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getUrl('checkout/cart/add',array('product'=>$_marketplace["entity_id"],'qty'=>1)) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
    <?php echo $this->getChildHtml('', true, true) ?>

So when I add the product to shopping cart, it is showing "product was added to your shopping cart." along with "You have no items in your shopping cart." ie, product added is not getting reflected in cart. But if i navigate to checkout and come back or if I add another original product, the used product and original product is getting reflected.

This happens only when we checkout the used product 1st time to the empty cart. If cart have any other product we can checkout the used product without a problem.

Do anyone have any idea?

Note: I added some custom attribute to products such as is_used, p_id ( formerly it was parent_product_id, which was causing problem.) etc


Solution

  • After a few days of debugging, I solved it by just changing the custom attribute field name from parent_product_id to p_id.