`
kirenenko04
  • 浏览: 152115 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论

Add Related Product

 
阅读更多
 /**
     * 添加关联商品到指定商品
     */
    public function addRelatedProducts($product_id,$skus) {
    	$param = array();
    	
    	foreach ($skus as $key=>$sku) {
    		$related_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
    		if ($related_product) {
    			$param[$related_product->getId()] = array('position'=>$key);
    		}
    	}
    	
    	$product = Mage::getModel('catalog/product')->load($product_id);
    	if ($product) {
    		$product->setRelatedLinkData($param)->save();
    		return true;
    	}
    	return false;
    }

 

分享到:
评论

相关推荐

    亚马逊后台各个按钮功能操作详细讲解.pdf

    2. **Add a Product和Add Products via Upload**:这两个功能分别用于添加单个产品和批量上传产品信息到亚马逊平台。Add a Product适合新上架的商品,而Add Products via Upload则适用于大量产品一次性导入,节省...

    亚马逊后台各个按钮功能操作详解.pdf

    Add a Product功能用于单个添加新产品,而Add Products via Upload则支持批量上传多个产品信息,这对于大量商品上架非常便利。Inventory Report界面可下载包含所有店铺库存的详细报告,便于分析库存状况和制定补货...

    CATIA3D线束设计作图顺序.pdf

    接着,选择功能Exit,退出EHI子模块,并选择功能Related Objects,查看线路的电气连通性。 五、 EWR电气电线铺设模块 在EWR模块中,首先创建新的Product,然后点击Insert / Existing Component,导入EHA模块保存的...

    Addison.Wesley.Real-Time Design Patterns.chm

    The nature of the final product demands that systems be powerful, efficient, and highly reliable. The constraints of processor and memory resources add to this challenge. Sophisticated developers ...

    chart java applet

    RChart is java class library (and applet) that will add charts to your java application or web site. In order to run the example application unzip the file .zip and read the HowToRun.txt file. FILES...

    teraterm-4.93

    Related Product Upgrades Upgraded TTSSH to 2.79. Upgraded CygTerm+ to 1.07_29. Upgraded TTProxy to 1.0.0.24. Upgraded TeraTerm Menu to 1.14. Upgraded TTX KanjiMenu Plug-in to 0.1.7. Upgraded ...

    word自动转化为chm

    Have you ever met such situation that you need to provide product document in print, offer a CHM help file in package, and in order to introduce your products, put these documents on your company's ...

    Duplicate Email Remover 2.7

    - If your query is related to erratic software operation, please provide the following information: - Version number of the software product you are using. We also recommend you to visit our web...

    ssm基于java的水果网上商城的开发与设计论文.doc

    Fruit information management covers adding, editing, and deleting product details, including descriptions, prices, and images. Fruit purchase management deals with tracking inventory and ordering new...

    亚马逊后台各个按钮功能操作详解只是分享.pdf

    3. **Add a Product/Upload Products via Upload**:这两个功能分别用于添加单个产品和批量上传产品信息。添加产品时,你需要提供产品详细信息,如名称、描述、类别、价格等。批量上传则适用于拥有大量产品信息的...

    Essential LINQ

    • Offers developers powerful LINQ query expressions to perform virtually any data-related task • Teaches how to query SQL databases for objects and how to modify those objects • Demonstrates ...

    RealThinClientSDK_v610_BETA

    need to Build and Install all related packages again, after you reinstall the RTC SDK. ------------- 5.) Help ------------- The best place to start learning about RTC SDK is the QuickStart guide. ...

    PC-lint 9.0 -- Gimpel.Software.PC-lint.9.0a

    related documentation) in whole or in part in support of the use of this software. ------ Support for Microsoft through Visual Studio 2008 ------ We currently support Microsoft Visual C/C++ 9.0...

    Araxis Merge Professional 2012.4162 (x86/x64).part1

    Linking lines are drawn between the documents showing clearly how they are related. Point-and-click merging lets you choose the parts of each file that you would like to add to a final merged version...

    Araxis Merge Professional 2012.4162 (x86/x64).part2

    Linking lines are drawn between the documents showing clearly how they are related. Point-and-click merging lets you choose the parts of each file that you would like to add to a final merged version...

    SDAC2.45 1.19

    dacXX.bpl dacvclXX.bpl dcldacXX.bplNote that product compatibility is provided for current build only.In the other words, if you upgrade one of the installed products itmay conflict with older builds...

    SQL Server Data Access Components 2.45.22 for d6

    dacXX.bpl dacvclXX.bpl dcldacXX.bplNote that product compatibility is provided for current build only.In the other words, if you upgrade one of the installed products itmay conflict with older builds...

    spss中英文对照.doc

    SPSS(Statistical Product and Service Solutions)是一款广泛应用于社会科学、商业、医学研究等领域的统计分析软件。由于SPSS至今没有完全汉化的版本,因此对于不熟悉英文的用户来说,理解和操作可能会遇到困难。...

    win 3.11 for workgroup tcpip支持

    to add the Microsoft TCP/IP-32 drivers by following the instructions given in the documentation. Known Problems -------------- There have been a number of reports on IBM TokenRing, EtherLink III ...

Global site tag (gtag.js) - Google Analytics