2

I need to to include links to categories/CMS pages in another store in my navigation menu. So it would look something like this:

             <li><a href="<?php echo Mage::helper('cms/page')->getPageUrl('home'); ?>" <?php if ($currentUrl == Mage::helper('cms/page')->getPageUrl('home') || $currentUrl == Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)) { ?>class="active" <?php } ?>>Home</a></li>
                <li><a href="<?php echo Mage::helper('cms/page')->getPageUrl('our-products'); ?>" <?php if ($currentUrl == Mage::helper('cms/page')->getPageUrl('our-products')) { ?>class="active" <?php } ?>>Our Products</a></li>
    <?php
    switch_to_another_store($store_id_2); ?>
     <li><a href="<?php echo Mage::helper('cms/page')->getPageUrl('home'); ?>" <?php if ($currentUrl == Mage::helper('cms/page')->getPageUrl('home') || $currentUrl == Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)) { ?>class="active" <?php } ?>>Home</a></li>
                <li><a href="<?php echo Mage::helper('cms/page')->getPageUrl('our-products'); ?>" <?php if ($currentUrl == Mage::helper('cms/page')->getPageUrl('our-products')) { ?>class="active" <?php } ?>>Our Products</a></li>
<?php 
switch_to_another_store($store_id_1); ?>

Don't know if this will work or not, but some help would be awesome

I found a Solution

$appEmulation = Mage::getSingleton('core/app_emulation');
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation([the other store ID]);

$product= Mage::getModel('catalog/product')->load([product ID]);
echo '<a href="'.$product->getProductUrl().'">Shop now!</a>';

$appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);

1 Answer 1

2

You can add ?__store=<storecode> to the links.

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.