Magento 批量修改产品description内容

admin   ·   发表于 1个月前   ·   网站运维

修改/shell/webp.php

<?php

require_once(dirname(__FILE__) . '/../app/Mage.php');

umask(0);

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

Mage::app();

$Products = Mage::getModel('catalog/product')

    ->getCollection()->addAttributeToSelect('description');


foreach ($Products as $product) {

    $desc = $product->getDescription();

    $desc = str_replace('查找内容', '修改内容', $desc);

    $product->setDescription($desc);

    $product->save();

}

SSH到网址更目录 执行php shell/webp.php

0 Reply   |  Until 1个月前 | 58 View
LoginCan Publish Content