我必须创建一个简单的Magento 1.6.x导入代理,假设创建/更新产品及其图像.有人可以告诉我如何在不使用magento API的情况下添加产品图片吗?
api表现非常糟糕,我开始有点沮丧.. :-(
我已经找到了一些关于这个问题的其他问题,但是没有一个问题涉及向产品添加图像.
这就是我的意思:
$product->setIsMassupdate(true)
->setExcludeUrlRewrite(true)
->setManufacturer($this->addManufacturers(utf8_encode($record[4])))
->setSku($record[3])
->setAttributeSetId($this->attribute_set)# 9 is for default
->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE)
->setName(utf8_encode($record[5]))
->setCategoryIds($this->getCategories(array($record[0], $record[1], $record[2]))) # some cat id's,
->setWebsiteIDs(array(1)) # Website id, 1 is default
->setDescription(utf8_encode($record[6]))
->setShortDescription($this->shortText(utf8_encode($record[6]), 150))
->setPrice($price) # Set some price
->setSpecialPrice($special_price)
->setWeight($record[12])
->setStatus( Mage_Catalog_Model_Product_Status::STATUS_ENABLED )
->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
->setTaxClassId(2) // default tax class
->setPixmaniaimg($record[10])
->setStockData(array('is_in_stock' => $inStock, 'qty' => $qty))
->setCreatedAt(strtotime('now'));
Run Code Online (Sandbox Code Playgroud)
没有API可以帮助我直接添加图片吗?
谢谢
卢卡斯
我正在使用D3.js进行力导向布局的实验.我需要的是以root(或其他选定节点)为中心布局,并在tick函数完成后将此节点返回到svg(例如canvas)中心(图形alpha为低).可能吗?我找到了一个例子
但我无法使根(当使用aplha或其他自定义滴答函数计算时)返回中心(通过此特定节点居中布局).
任何帮助,将不胜感激.