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
)
1
  • What is the file you are working on?
    – Sukeshini
    Feb 10, 2015 at 6:49

1 Answer 1

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 ?>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.