0

Customers have to be able to buy from the category page configurable products. The issue is that the configurable block is created just once for the first product. So no matter what product I add to cart, it is always the first product of the category that ends in cart.

I tried the solution here with no success: Mage::registry not updating

I am following the tutorial here: http://inchoo.net/magento/display-multiple-configurable-products-with-options-on-one-page-in-magento/

I tried something like this:

//foreach loop
<?php Mage::unregister('product') ?>
<?php Mage::register('product', $_product); ?>
<?php 
    echo $this->getLayout()->createBlock('catalog/product_view_type_configurable')
      ->setTemplate('catalog/product/view/type/options/configurable_category.phtml')
      ->setProduct($_product)
      ->toHtml();

with no success. If I try getBlock() method I get false and an error (setTemplate called on a non-object).

How can I create that block for each configurable product? Or is there a better way? This solution with Mage::unregister('product') looks hacky.

1 Answer 1

1

I just finished doing this and it was not trivial. In the end this was the approach which worked for me:

Configurable Options in Related Products - Fatal error: Call to a member function getAttributeCode() on a > non-object

(although I spent some time calling the form option block as its own seperate block whereas weddar copy pasts the add to cart options form directly into configurable.php) If you follow his posts, he runs into an issue with undefined renderers which i solved based on this post:

http://inchoo.net/magento/display-html-code-blocks-of-product-options-in-magento/

And using the top comment by fassl to get it working with 1.9

1

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.