-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathproduct-to-new-website.php
More file actions
31 lines (27 loc) · 714 Bytes
/
product-to-new-website.php
File metadata and controls
31 lines (27 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
*
* Copyright (c) 2017.
* product-to-new-website.php
* Code compiled by: @dbashyal 'damu' on 18/09/17 2:01 PM
* Visit http://dltr.org for Magento Tips and Tricks
*
*/
require_once '../abstract.php';
class Mage_Shell_Lowes_ProductToNewWebsite extends Mage_Shell_Abstract
{
public function run()
{
$websiteIds = array(1,3,4);
$productIds= Mage::getResourceModel('catalog/product_collection')->getAllIds();
Mage::getModel('catalog/product_website')->addProducts($websiteIds, $productIds);
}
}
$shell = new Mage_Shell_Lowes_ProductToNewWebsite();
try{
// fetch new data
$shell->run();
} catch (Exception $e){
echo $e->__toString();
}
echo "done!\n";