使用图像插件的Magento Mass Importer(MAGMI) - php

我正在使用数据泵,一切都很好,但是我需要添加图像处理器。到目前为止没有运气。有人知道怎么做吗?这是docs。这是我正在工作的代码。我没有放vars。

require_once(MAGENTO."/magmi/integration/magmi_datapump.php");
class TestLogger{
    public function log($data,$type){
        $mess.="$type:$data\n";
    }
}
$dp=Magmi_DataPumpFactory::getDataPumpInstance("productimport");
$dp->beginImportSession("default","create",new TestLogger());   
$item=array(
                            "type"=>"simple",
                            "sku"=>$sku,
                            "name"=>$p_name,
                            "short_description"=>$shortdesc,
                            "description"=>$longdesc,
                            "cost"=>$cost,
                            "price"=>$price,
                            "min_qty"=>0,
                            "qty"=>$stock,
                            "tax_class_id"=>2,
                            "status"=>2,

                            "attribute_set"=>$attribute_set,
                            "category_ids"=>implode(",",array_unique($cat_list)),
                            "manufacturer"=>$manufacturer
                        );
//This doesn't seem to be working.
$item["image"]="http://images.domain.com/product_images".$image[0];

$item["store"]="";
$dp->ingest($item);
$dp->endImportSession();                            

现在,我浏览了,但看不到如何加载该插件。关于修复它的任何想法? k

参考方案

为了使图像处理器正常工作,您必须通过magmi配置UI将其添加到“默认”配置文件的选定插件列表中。

PHP Count数组元素 - php

嗨,有人可以解释为什么这会返回“数组由0个元素组成”。 :$arr = array(1,3,5); $count = count($arr); if ($count = 0) { echo "An array is empty."; } else { echo "An array has $count elements.…

PHP:从函数返回值并直接回显它? - php

这可能是一个愚蠢的问题,但是……的PHPfunction get_info() { $something = "test"; return $something; } html<div class="test"><?php echo get_info(); ?></div> 有没有办…

php-printf和sprintf具有不同的输出 - php

我编写了以下微型php程序来测试printf和sprintf:<?php $str_1 = printf("%x%x%x", 65, 127, 245); $str_2 = sprintf("%x%x%x", 65, 127, 245); echo $str_1 . "\n"; echo $s…

PHP-解析当前URL - php

在以下两种情况下,我都需要解析当前网址:http://mydomain.com/abc/ http://www.mydomain.com/abc/ 我可以获得“ abc”的返回值(或该位置的任何文本)。我怎样才能做到这一点? 参考方案 您可以使用parse_url();$url = 'http://www.mydomain.com/abc/…

PHP:如何知道链接是否是有效的YouTube链接? - php

这是例子。www.youtube.com, http://www.youtube.com/, http://www.youtube.com/watch?v=YoB8t0B4jx4 我不在乎它是否具有视频或仅YouTube网址,而只有有效网址。我想做的是,当我知道它是有效的YouTube网址时,我将检查它是否具有视频ID。如果它具有ID,我将为视频添加ifra…