Magento - Multiple Stores, get the store the product was added to the cart from?

One possible way would be, to use $_item->getStoreId() to differ the stores of each item within your template at template/checkout/cart/render/default.phtml.

One possible way would be, to use $_item->getStoreId() to differ the stores of each item within your template at template/checkout/cart/render/default.phtml. In the standard Magento default. Phtml template, $_item gets assigned the current item to be rendered (at the very top of the template code).GetItem()?

> Thereafter you can easily assign the items proper store name to a variable, like this: 'Red Store', '2' => 'Green Store', '3' => 'Blue Store', '4' => 'Yummy Store' ); $sStore = $aStore$_item->getStoreId();? > This allows you to output the name wherever you want, using . Another possibility would be to override Mage_Sales_Model_Quote_Item and create a public getter method, returning the store name of the given item.

But that's another story and maybe like using a sledgehammer to crack a nut.

2 An array literal is too inflexible, instead use Mage::app()->getStore($_item->getStoreId())->getName() – clockworkgeek Dec 6 '11 at 17:24 1 I used the array by intention, because we don't know, what exactly the OP wants to display next to the product (maybe logos or whatever). I'd agree though, if he just wants to show the same store names as defined in the backend, so +1. – Jürgen Thelen Dec 6 '11 at 19:46 Thanks for your input guys, I'll try the code out shortly and let you know how it goes!

:-) – daveaspinall Dec 7 '11 at 8:30 Works spot on! Thanks @Jürgen Thelen – daveaspinall Dec 7 '11 at 8:39 And thanks @clockworkgeek for the dynamic version – daveaspinall Dec 7 '11 at 8:39.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions