29

Preconditions Magento already created a default website on installation (in your case mystore1.com). Step 1 - Creation Go to System->Manage Stores. Click on Create Website. Fill in the the form with desired values and save. Example: Name - Website 2 Code - site2 Sort Order: 2 Click on Create Store. In the form fill in the values and save. Example: ...


25

Create a static block for each language, all with the same identifier. Render the block with the cms/block block. It will automatically add the store ID to load the correct version of the block. Here's an easy way to load and render the block directly in the template file: <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('...


24

Assuming the store id for the french store is 2, you should run the below mysql queries: DELETE FROM `catalog_product_entity_text` where store_id = 2; DELETE FROM `catalog_product_entity_datetime` where store_id = 2; DELETE FROM `catalog_product_entity_decimal` where store_id = 2; DELETE FROM `catalog_product_entity_int` where store_id = 2; DELETE FROM `...


17

Use getStoreLabel() ,instead of getFrontendLabel()


16

/** * @var $config Mage_Eav_Model_Config * @var $options Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection */ $storeId = 3; $config = Mage::getModel('eav/config'); $attribute = $config->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'color'); $values = $attribute->setStoreId($storeId)->getSource()-&...


15

To add a store use the code below: //#addWebsite /** @var $website Mage_Core_Model_Website */ $website = Mage::getModel('core/website'); $website->setCode('<your_website_code_here>') ->setName('<your_website_name>') ->save(); //#addStoreGroup /** @var $storeGroup Mage_Core_Model_Store_Group */ $storeGroup = Mage::getModel('core/...


12

What I usually do to add russian language: Add store view and assign russian locale to it like it is done in your link Download russian translation by us (ET) from this topic (Niro comment) and install it manually That's it! I know that there are some cases similar to yours and usually it means that you have tried to install translation from Magento ...


12

The problem is a bug in the model Mage_Core_Model_Url_Rewrite_Request (Magento 1.8) and Mage_Core_Model_Url_Rewrite (earlier versions). The section of core code in 1.8 looks like this: // Section from Mage_Core_Model_Url_Rewrite_Request::_rewriteDb() $fromStore = $this->_request->getQuery('___from_store'); if (!$this->_rewrite->...


11

core_config_data table contain two important fields scope and scope_id. There are three scope types default websites stores If scope is set to default then scope_id is always 0. If scope is set to websites then scope_id is website_id. If scope is set to stores then scope_id is store_id(store view). Imagine that we need to get some config value. How ...


11

One of the biggest feature Magento is famous for is its capabilities to develop multi-store and multi-language web stores. Each store can be completely different from its fellow stores. Store Emulation helps developers to emulate any store programmatically. Suppose you want to send custom transactional e-mail for all stores at the same time as cronjob. When ...


11

You should inject class Magento\Store\Model\System\Store in the constructor and declare a global variable. E.g: public function __construct( //..., Magento\Store\Model\System\Store $systemStore ) { //... $this->_systemStore = $systemStore; } protected function _prepareForm() { //... $fieldset->addField( 'store_ids', ...


11

You can fetch the current store id and the store name in phtml file (using ObjectManager) like below : $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface'); $storeID = $storeManager->getStore()->getStoreId(); $storeName = $...


11

Update Things to check: Ensure that store views are not configured as any defaults. Website Scope Store Scope - AKA: Store Group Ensure that config.php is not using the store view https://devdocs.magento.com/guides/v2.2/config-guide/config/config-php.html https://devdocs.magento.com/guides/v2.2/config-guide/config/config-files.html Ensure that the ...


10

You could create a session variable to have a persistent state over several requests like this: $session = Mage::getSingleton("core/session"); $session->setData("your_variable", "your value"); // ... // Now you can retrieve your data elsewhere or even after the next request: $session = Mage::getSingleton("core/session"); $yourVariable = $session->...


10

There's a getStoreIds() method in Mage_Catalog_Model_Product. $_product = Mage::getModel('catalog/product')->load([item_id]); $storeIds = $_product->getStoreIds();


10

Thank you very much Amit Bera. Based on the very helpful suggestions, here is the working code! $_condition = $_product->getAttributeText('condition'); $_coditionDefault = $_product->getResource()->getAttribute('condition')->setStoreId(0)->getFrontend()->getValue($_product);


10

I think you misread the documentation. Basically the following are plugins limitations: Objects that are instantiated before Magento\Framework\Interception is bootstrapped Final methods Final classes Any class that contains at least one final public method Non-public methods Class methods (such as static methods) __construct Virtual types ...


8

First of all you can't have different prices for stores but only for websites (unless you use one of the custom extensions which extends this functionality). This also has to be enabled System > Configuration > Catalog > Catalog > Price. Then you can't show different currencies in admin, only at the frontend. So what you shall do is to create 2 ...


8

The answer below talks about setting the store id prior to loading the model, but, as @benmarks noted in the comment below, this is unnecessary, as that happens in the block's _toHtml(). As with many other mage models, try setting the desired store id before loading the model: $deliveryBlock = Mage::getModel('cms/block') ->...


8

Try this : $store = Mage::getModel('core/store')->load(Mage_Core_Model_App::DISTRO_STORE_ID); $rootId = $store->getRootCategoryId();


8

Question is a little bit older, but i had the same problem! And maybe there are some others :-) So, my solution: Go to Catalog -> Manage Products and edit your super product. Goto Tab Associated products. In Super product attributes configuration check for each configurable attribute the Use default. Then, Magento will use the default translation like ...


8

Just edit the ID of the stores in the store_id column in the core_store database table. Because of the foreign keys, this will get updated in almost all of the other tables. Additionally you should update: default_store_id column in core_store_group table As commented, changing your actual database ID's would be a bit radical. Also you would still have to ...


8

The answer is quite simple: http://localhost/rest/{store code}/V1/categories Just replace the {store code} with yours. For example english: http://localhost/rest/en/V1/categories


8

Complete untested (sorry!). But as long as you have the product ID you should be able to use the getAttributeRawValue function on the resource model. class YourClass { protected $product; public function __construct( \Magento\Catalog\Model\Product $product ) { $this->product = $product; } public function getDescription($...


7

Unfortunately, none of the efficient ways to update a product attribute work in this case. $product->getResource()->saveAttribute() updates the attribute for all store views even if you set the store ID on the $product object. Mage::getSingleton('catalog/product_action')->updateAttributes() only updates the value in a specific store, but it cannot ...


7

Joining a bit late, but I didn't really like either of the above answers. Simons answer of walking over the product collection is insanely slow and inefficient, however it is at least using Magento ParasSood's answer of doing direct modifications on the database is a little scary, and not very usable if you want this wrapped as a bit of automated ...


7

I ended up in using the below solution. I saw it is a quite common configuration for multi-language Magento websites. This solution provides a default language with a redirect from "normal" url (urls without lang subfolder) to urls with the default lang subfolder. For example, if it is the default language, it happen this: example.com/ --> ...


7

You can set Locale as per store view. Admin >> Store >> Configuration >> Select your store from store drop down on top left corner >> Locale Options >> Set your language for store.


6

Use the built-in Custom Variables functionality which gives you editable values from the admin: http://www.magentocommerce.com/knowledge-base/entry/creating-custom-variables When calling from your template: Mage::getModel('core/variable')->loadByCode('my_custom_var')->getValue('plain'); When calling from anywhere else (CMS, emails, etc.): {{...


6

No they are not as far as I know. You could make it available by creating a variable in templates/page/html/head.phtml like this <script type="text/javascript"> //<![CDATA[ var MAGE_STORE_ID = '<?php echo Mage::app()->getStore()->getId();?>'; //]]> </script> This would give you the ability to call "MAGE_STORE_ID" in your ...


Only top voted, non community-wiki answers of a minimum length are eligible