1

I am trying to get the websites ids against each product on cart page like this but didn't work.

 <?php foreach($this->getItems() as $_item):
              echo "<pre/>";
              $product = Mage::getModel('catalog/product')->load($_item->getId());
               print_r($product->getWebsiteIds());
             echo $this->getItemHtml($_item) ?>
            <?php endforeach ?>

It showing output with 1 result.Some product belongs to website 2

Array
(
    [0] => 1
)
  • What is the file you are working on? – Sukeshini Feb 10 '15 at 6:49
1

Change your code as below.

<?php foreach($this->getItems() as $_item):
              echo "<pre/>";
              $product = Mage::getModel('catalog/product')->load($_item->getProductId());
               print_r($product->getWebsiteIds() );
             echo $this->getItemHtml($_item) ?>
            <?php endforeach ?>
| improve this answer | |

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.