Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Multistore, different prices per store
 
dnnijmeijer
Jr. Member
 
Total Posts:  27
Joined:  2011-08-30
 

Hello,

Currently I’m working on a Multistore setup. Everything works fine, but now I encounter a problem while developing a script that outputs a xml datafeed.

I’ve got two stores on two different domains. We had a store running for a few months but added the second store recently. Both stores use the same database. I’ve set the price attribute scope to website in order to have two different prices. All of this works and in the front end it is working just fine.

However in the data feed it keeps displaying the price from the original store. For example the price of a product in store 1 is 250 euros, in store 2 it is 210 euros. Below you can find some of the code outputting the feed.

echo sprintf("<prijs>%s</prijs>\n",  number_format ($price2','''));

Als I have these references in the data feed regarding price:

function get_grouped_prices($_product){
    $sum 
$max $min 0;
    
$products $_product->getTypeInstance()->getAssociatedProducts();
    foreach (
$products as $product){
        $pr 
$product->getPrice();
        if(
$min <= 0){$min $pr;
        
}else{$min min($min$pr);
        
}
        $sum 
+= $pr;$max max($max$pr);
    
}
    
return array('min' => $min'max' => $max);
}

switch($product->getTypeId()){
                
case 'bundle':
                    
$price $bundlePrice->getMinimalPrice($product);
                    
                break;
                case 
'grouped':
                    
$prices get_grouped_prices($product);
                    
$price $prices['min'];
                break;
                
                default:
                    
                    
$price $product->getFinalPrice();
            
}

Can someone help me solving this problem?

Thank you in advance.

Daniël

 
Magento Community Magento Community
Magento Community
Magento Community
 
serpyre
Enthusiast
 
Avatar
Total Posts:  771
Joined:  2013-05-20
 

Can you post screenshots of the product price tab in store1 view and the product price tab in store2 view.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dnnijmeijer
Jr. Member
 
Total Posts:  27
Joined:  2011-08-30
 

Thank you for your reply serpyre.

http://s12.postimg.org/jbfg4jba5/storeview_1.png

http://s12.postimg.org/shxqrtgil/storeview_2.png

 
Magento Community Magento Community
Magento Community
Magento Community
 
serpyre
Enthusiast
 
Avatar
Total Posts:  771
Joined:  2013-05-20
 

Images do not show on the forum, nice. Anyway, most likely you are not doing the product load with the store code, add a store filter to the collection or sometimes you can pass the store id in the function call (you need to check), then it will work..

$product = Mage::getModel(\’catalog/product\’)
->setStoreId($storeId)
->load($key);

Google really is your friend for these types of things.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dnnijmeijer
Jr. Member
 
Total Posts:  27
Joined:  2011-08-30
 

Thank you for you reply! I’m gonna test it. I added a link to the screenshots. I know Google is my friend, but if I don’t know what to search for wink haha.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top