Created
January 23, 2013 13:27
-
-
Save ceckoslab/4605577 to your computer and use it in GitHub Desktop.
A tool, that copied all Product ( name, description and short_description ) from Engslish to Trukish store view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once('app/Mage.php'); //Path to Magento | |
| umask(0); | |
| Mage::app(); | |
| $englishStoreViewId = 4; | |
| $turkishStoreViewId = 6; | |
| ini_set('display_errors', 1); | |
| $attributes = array('description', 'short_description', 'name'); | |
| $allProductIds = Mage::getModel('catalog/product')->getCollection()->getAllIds(); | |
| foreach($allProductIds as $productId) { | |
| $fromProduct = Mage::getModel('catalog/product') | |
| ->setStoreId($englishStoreViewId) | |
| ->load($productId); | |
| $toProduct = Mage::getModel('catalog/product') | |
| ->setStoreId($turkishStoreViewId) | |
| ->load($productId); | |
| foreach($attributes as $attribute) { | |
| $toProduct->setData($attribute, $fromProduct->getData($attribute)); | |
| $toProduct->getResource()->saveAttribute($toProduct, $attribute); | |
| } | |
| } | |
| echo 'Ta da'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment