2015-10-19 41 views

回答

0

有同样的问题数量。 请尝试在文件app /代码/核心/法师/销售/型号/ Quote.php 改变_addCatalogProduct功能下一码

protected function _addCatalogProduct(Mage_Catalog_Model_Product $product, $qty = 1) 
{ 
    /*$newItem = false; 
    $item = $this->getItemByProduct($product); 
    if (!$item) {*/ 
     $item = Mage::getModel('sales/quote_item'); 
     $item->setQuote($this); 
     if (Mage::app()->getStore()->isAdmin()) { 
      $item->setStoreId($this->getStore()->getId()); 
     } 
     else { 
      $item->setStoreId(Mage::app()->getStore()->getId()); 
     } 
     $newItem = true; 
    //} 

    /** 
    * We can't modify existing child items 
    */ 
    if ($item->getId() && $product->getParentProductId()) { 
     return $item; 
    } 

    $item->setOptions($product->getCustomOptions()) 
     ->setProduct($product); 

    // Add only item that is not in quote already (there can be other new or already saved item 
    if ($newItem) { 
     $this->addItem($item); 
    } 

    return $item; 
} 

对我来说这些变化的工作是正确的。 如果这些更改也适用于您,那么您可以使用自定义模块重写此函数,并且不要对Core进行更改。

+0

此代码使所有项目新的购物车,所以如果我有购物车中的项目,并试图添加相同的项目我没有得到数量增加,但我得到另一个相同的项目在购物车http://shot.qip.ru/00LU8g -6Kzjldg9v /但还是谢谢。 – Cheezone

相关问题