0
我已根据客户需求定制搜索产品网格(已创建新网格并禁用搜索网格)在销售订单创建页面下。以编程方式在magento admin中添加产品到销售报价
我在“Items Ordered”块之后成功创建了新的网格。
当我点击“添加产品到项目”我的自定义网格的按钮,我在我的自定义控制器文件中获得了所选产品的产品ID和数量。
我试图添加这些产品报价,没有任何更改。我不知道如何在“项目有序”块下的我的自定义网格中添加这些选定的产品。
我试过以下代码来添加产品报价。
$customer_id = 26; // set this to the ID of the customer.
$customerObj = Mage::getModel('customer/customer')->load($customer_id);
$quoteObj=Mage::getModel('sales/quote')->assignCustomer($customerObj);
$quoteObj = $quoteObj->setStoreId(Mage::app()->getStore()->getId());
$productModel=Mage::getModel('catalog/product');
$productObj = $productModel->load($_id);
$quoteItem = Mage::getModel('sales/quote_item')->setProduct($productObj);
$quoteItem->setQty($qty);
$quoteObj->addItem($quoteItem);
$quoteObj->collectTotals();
$quoteObj->save();
我不知道,含报价的产品,否则
该块有什么想法,如何选择产品添加到“项目有序”块销售订单创建页面。
热切期待您的回复!