Magento Magmi:Import";“未登录”;定价

Magento Magmi:Import";“未登录”;定价,magento,magmi,Magento,Magmi,我正在尝试使用magmi为未登录的组导入组和层定价,并且不确定我的csv标题的格式或在哪里可以找到它 我在所有(sku,price,tier\u price:\u all)、无(sku,group\u price:none,tier\u price:none)和我拥有的其他自定义组上成功地使用了带有magmi的组和层价格导入。A(sku,组价格:A,层价格:A),B(sku,组价格:B,层价格:B)等等 这只是未登录的格式,我搞不懂,而且我似乎在数据库中找不到任何内容 以下是我到目前为止所做的尝

我正在尝试使用magmi为未登录的组导入组和层定价,并且不确定我的csv标题的格式或在哪里可以找到它

我在所有(
sku,price,tier\u price:\u all
)、无(
sku,group\u price:none,tier\u price:none
)和我拥有的其他自定义组上成功地使用了带有magmi的组和层价格导入。A(
sku,组价格:A,层价格:A
),B(
sku,组价格:B,层价格:B
)等等

这只是未登录的格式,我搞不懂,而且我似乎在数据库中找不到任何内容

以下是我到目前为止所做的尝试

  • sku、组\价格:未登录、层\价格:未登录
  • sku,组价格:'未登录',层价格:'未登录'
  • sku,集团价格:\u非,层级价格:\u非
  • sku、组\价格:一般、层\价格:一般

有什么想法吗?

我从进一步的测试中发现,tier pricing magmi插件与上述csv格式配合得很好。最初的插件我做了一些代码更改,但后来决定检查更新

在搜索的过程中,我找到了一个替代的magmi插件,用于group price importer,它起了作用

将magmi/plugins/extra/itemprocessors/groupprice文件夹中的当前文件替换为以下文件

如果您想查看更多信息,请访问此处。

是的,它可以正常工作。。创建目录/var/www/html/。/magmi/plugins/extra/itemprocessors/groupprice
yes it is works.. create directory /var/www/html/../magmi/plugins/extra/itemprocessors/groupprice 
put this grouppriceprocessor.php on this directory , 
select this profile in magmi .. group_price:NOT LOGGED IN
this is header in csv file put value for this and it works .. 

code of grouppriceprocessor.php  

    <?php
/**
 * Class Tier price processor
 * @author dweeves
 *
 * This imports tier prices for columns names called "group_price:"
 */
class GrouppriceProcessor extends Magmi_ItemProcessor
{
    protected $_tpcol=array();
    protected $_singlestore=0;
    protected $__pricescope=2;

    public function getPluginInfo()
    {
        return array(
            "name" => "Group price importer",
            "author" => "Dweeves,bepixeld,Jason",
            "version" => "0.0.1",
            );
    }

    /**
     * you can add/remove columns for the item passed since it is passed by reference
     * @param Magmi_Engine $mmi : reference to magmi engine instance (convenient to perform database operations)
     * @param unknown_type $item : modifiable reference to item before import
     * the $item is a key/value array with column names as keys and values as read from csv file.
     * @return bool :
     *      true if you want the item to be imported after your custom processing
     *      false if you want to skip item import after your processing
     */



    public function processItemAfterId(&$item,$params=null)
    {

        $pid=$params["product_id"];

        $tpn=$this->tablename("catalog_product_entity_group_price");
        $tpcol=array_intersect(array_keys($this->_tpcol),array_keys($item));
        //do nothing if item has no group price info or has not change
        if(count($tpcol)==0  )
        {
            return true;
        }
        else
        {

         //it seems that magento does not handle "per website" tier price on single store deployments , so force it to "default"
          //so we test wether we have single store deployment or not.
          //bepixeld patch : check pricescope from general config
          if($this->_singlestore==0 && $this->_pricescope!=0)
          {
            $wsids=$this->getItemWebsites($item);
          }
          else
          {
            $wsids=array(0);
          }
          $wsstr=$this->arr2values($wsids);
            //clear all existing tier price info for existing customer groups in csv
           $cgids=array();
            foreach($tpcol as $k)
            {
                $tpinf=$this->_tpcol[$k];
                if($tpinf["id"]!=null)
                {
                    $cgids[]=$tpinf["id"];
                }
                else
                {
                    $cgids=array();
                    break;
                }

            }

            //if we have specific customer groups
            if(count($cgids)>0)
            {
                //delete only for thos customer groups
                $instr=$this->arr2values($cgids);

                //clear tier prices for selected tier price columns
                $sql="DELETE FROM $tpn WHERE entity_id=? AND customer_group_id IN ($instr) AND website_id IN ($wsstr)";
                $this->delete($sql,array_merge(array($pid),$cgids,$wsids));
            }
            else
            {
                //delete for all customer groups
                $sql="DELETE FROM $tpn WHERE entity_id=? AND website_id IN ($wsstr)";
                $this->delete($sql,array_merge(array($pid),$wsids));
            }
        }

        foreach($tpcol as $k)
        {

        //get tier price column info
          $tpinf=$this->_tpcol[$k];
          //now we've got a customer group id
          $cgid=$tpinf["id"];
          //add tier price
          $sql="INSERT INTO $tpn
            (entity_id,all_groups,customer_group_id,value,website_id) VALUES ";
          $inserts=array();
          $data=array();

          if($item[$k]=="")
          {
            continue;
          }
          $tpvals=explode(";",$item[$k]);

          foreach($wsids as $wsid)
          {
                //for each tier price value definition
                foreach($tpvals as $tpval)
                {
                    $tpprice=str_replace(",",".",$tpval);
                    if($tpprice=="")
                    {
                        continue;
                    }
                    if(substr($tpprice,-1)=="%")
                    {
                        //if no reference price,skip % tier price
                        if(!isset($item["price"]))
                        {
                            $this->warning("No price define, cannot apply % on group price");
                            continue;
                        }
                        $fp=(float)(str_replace(",",".",$item["price"]));
                        $pc=(float)(substr($tpprice,0,-1));
                        $m=($pc<0?(100+$pc):$pc);
                        $tpprice=strval(($fp*($m))/100.0);
                    }
                    $inserts[]="(?,?,?,?,?)";
                    $data[]=$pid;
                    //if all , set all_groups flag
                    $data[]=(isset($cgid)?0:1);
                    $data[]=(isset($cgid)?$cgid:0);
                    $data[]=$tpprice;
                    $data[]=$wsid;
                }
          }
          if(count($inserts)>0)
          {
            $sql.=implode(",",$inserts);
            $sql.=" ON DUPLICATE KEY UPDATE `value`=VALUES(`value`)";
            $this->insert($sql,$data);
          }
         }
        return true;
    }

    public function processColumnList(&$cols,$params=null)
    {
       //inspect column list for getting tier price columns info
        foreach($cols as $col)
        {
            if(preg_match("|group_price:(.*)|",$col,$matches))
            {
                $tpinf=array("name"=>$matches[1],"id"=>null);

                //if specific tier price 
                 if($tpinf["name"]!=="_all_")
                 {
                    //get tier price customer group id
                    $sql="SELECT customer_group_id from ".$this->tablename("customer_group")." WHERE customer_group_code=?";
                    $cgid=$this->selectone($sql,$tpinf["name"],"customer_group_id");
                    $tpinf["id"]=$cgid;
                }
                else
                {
                    $tpinf["id"]=null;
                }
                $this->_tpcol[$col]=$tpinf;
            }
        }
        return true;
    }

    public function initialize($params)
    {
     $sql="SELECT COUNT(store_id) as cnt FROM ".$this->tablename("core_store")." WHERE store_id!=0";
     $ns=$this->selectOne($sql,array(),"cnt");
     if($ns==1)
     {
      $this->_singlestore=1;
     }
     //bepixeld patch : check pricescope from general config
     $sql = "SELECT value FROM ". $this->tablename('core_config_data') ." WHERE path=?";
     $this->_pricescope = intval($this->selectone($sql, array('catalog/price/scope'), 'value')); //0=global, 1=website    

    }
}




thanks 
将这个grouppriceprocessor.php放到这个目录中, 在magmi中选择此配置文件。。组价格:未登录 这是csv文件中的头文件,该文件的put值有效。。 grouppriceprocessor.php的代码
Magmi版本,Magento版本?Magento:1.12.0.2,Magmi:v0.7.17a,三级价格导入器v0.0.9a,集团价格导入器v0.0.1是的,它可以工作。。创建目录/var/www/html/。/magmi/plugins/extra/itemprocessors/groupprice将这个grouppriceprocessor.php放在这个目录下,在magmi中选择这个概要文件。。组价格:常规,组价格:批发这两个都是csv文件中的头文件,输入值,它可以工作。。谢谢