Last active
December 30, 2015 17:49
-
-
Save mattclements/7863196 to your computer and use it in GitHub Desktop.
Magento - Setup Product URL's after Import
This file contains 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 'app/Mage.php'; | |
Mage::app(); | |
$amount = 0; | |
$model = Mage::getModel('catalog/product'); | |
$products = $model->getCollection(); | |
foreach ($products as $product) { | |
$model->load($product->getId()); | |
$product->setUrlKey($model->getName())->save(); | |
set_time_limit(); | |
$amount++; | |
} |
This file contains 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
INSERT IGNORE INTO cataloginventory_stock_status (product_id, website_id, stock_id, qty, stock_status) | |
SELECT entity_id as product_id, 1 as website_id, 1 as stock_id, 10000.0000 as qty, 1 as stock_status | |
FROM catalog_product_entity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment