通过Magento API批量更新产品和税类
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了通过Magento API批量更新产品和税类相关的知识,希望对你有一定的参考价值。
This script will change the Tax-Class of ALL your products in the $storeId!!<br /> Be careful to use!<br /><br /> <pre> <?php $host = 'me.com'; $proxy = new SoapClient('http://'.$host.'/index.php/api/soap/?wsdl=1'); // Can be added in Magento-Admin -> Web Services $apiUser = '***'; $apiKey = '***'; // the id of the store, which products you want to update $storeId = 0; // the new TaxId, which you want to assign to ALL products $newTaxId = 2; try { $sessionId = $proxy->login($apiUser, $apiKey); foreach ($productList as $product): // just to be sure: check if the product belongs to the store which i want to update echo '<br /><br /><hr /><br /><br />'; endforeach; } catch (Exception $e) { echo "==> Error: ".$e->getMessage(); } ?> </pre>
以上是关于通过Magento API批量更新产品和税类的主要内容,如果未能解决你的问题,请参考以下文章