What you mentioned already, is correct. The Global scope is the same as the Admin scope. They are not quite the same, but because all other scopes (Store View, Store, Website) are managed from within the Magento Admin Panel, the Magento Admin Panel needs to have the scope Global to work. This also means that the Base URL of your Global Scope needs to point to the Magento admin URL. However, Magento has also introduced the option "Custom Admin URL" as you mentioned - and this complicates things a little bit. As I understand it, the "Custom Admin URL" should be used if the Magento backend should be only accessed through a private URL (for instance, an internal URL for people behind a corporate firewall) - so this would then become privateseparatenode.com
. However, the Magento global scope might still need contacting from the outside world. For instance, if PayPal does an IPN callback, it contacts Magento and this might be on the global scope (don't know if this is actually true or not), and for that reason you would need a public URL like publicseparatenode.com
. So in short, the Custom Admin URL is normally only needed if the Admin needs to be accessed through a private method, while the global scope (Base URL in Global Scope) should be publicly accessible.
In short: Your setup seems completely correct in that the Global Scope is using the domain separatenode.com
(assuming it is publicly accessible). However, I've seen third party modules in the past that did not respect the scoping at all, and simply loaded stuff from the global scope because that seemed easier. So your issue might be with a third party module (?).
The fact that your Magento backend is on a different node is not important. With Magento, it is suggested that you have one "virtual" application instance pointing to one "virtual" database, even though there could be multiple application instances on different nodes pointing to the same database, or multiple database instances because of clustering or alike. Think of it this way: There is one Magento configuration tree, which has values across multiple scopes. That same configuration tree is accessed from your Magento backend node.
Let's say that $product
is the instance of your product loaded in a specific store.
You can check this
$basePrice = $product->getAttributeDefaultValue('price');
if ($basePrice === false) {
//Use default values is checked
} else {
//$basePrice is the price in the default values.
}
Unfortunately this works only if you call load
on the product model, not if you get the product from a collection.
I mean, this works
$product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($productId);
var_dump($product->getAttributeDefaultValue('price'));
This will produce a value if the price is different on the website that contains the store view with the id $storeId
and it will produce false
if "Use default values" is checked.
This won't work.
$collection = Mage::getModel('catalog/product')->setStorId($storeId)->getCollection()
->addAttributeToSelect('entity_id', array('eq' => $productId));
foreach ($collection as $product) {
var_dump($product->getAttributeDefaultValue('price'));
}
This will always produce false
.
Best Answer
Usually, you're not supposed to do this.
Mage::getStoreConfig()
will automatically return the store value, the website value, the global value, or the default value depending on the configuration of the field.However, if you really need to disregard the store value and get the website value, you can do it this way: