2010-12-06 1 views

答えて

1

このオプションはウェブサイトにリンクされていますが、ストアではリンクされていません。ウェブサイトを取得した後、このウェブサイトにリンクされているすべてのストアを取得する必要があります。

適切なウェブサイトを取得する方法の例があります。

<?php 
$requriedCode = "90034"; 
$requiredCity = "Kyiv"; 

$output = array(); 
$websites = Mage::app()->getWebsites(true, true); 
foreach ($websites as $code => $website) { 
    $postcode = $website->getConfig('shipping/origin/postcode'); 
    $city = $website->getConfig('shipping/origin/city'); 
    if ($postcode == $requriedCode or $city == $requiredCity) { 
     $output[$code] = $website; 
    } 
} 

foreach ($output as $site) { 
    echo $site->getCode()."\r\n"; 
} 
?> 

その他 - データベースから直接取得することができます。しかし、データベースにはデフォルトデータがありません。

$sql = 'select * from core_config_data where (path="shipping/origin/postcode" and value="90034") or (path="shipping/origin/city" and value="Kyiv")'; 

ここで、オブジェクトのスコープタイプは、オブジェクトのWebサイトとscope_id-idが必要です。

関連する問題