本文整理汇总了PHP中producthelper::updateContainerStock方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::updateContainerStock方法的具体用法?PHP producthelper::updateContainerStock怎么用?PHP producthelper::updateContainerStock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::updateContainerStock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
//.........这里部分代码省略.........
}
$subpropArr = $propArr[$k]['property_childs'];
for ($l = 0; $l < count($subpropArr); $l++) {
$section_vat = 0;
if ($subpropArr[$l]['subproperty_price'] > 0) {
$section_vat = $producthelper->getProducttax($product_id, $subpropArr[$l]['subproperty_price'], $user_id);
}
$subproperty_id = $subpropArr[$l]['subproperty_id'];
/** product subproperty STOCKROOM update start */
$updatestock = $stockroomhelper->updateStockroomQuantity($subproperty_id, $quantity, "subproperty");
$rowattitem =& $this->getTable('order_attribute_item');
$rowattitem->order_att_item_id = 0;
$rowattitem->order_item_id = $rowitem->order_item_id;
$rowattitem->section_id = $subproperty_id;
$rowattitem->section = "subproperty";
$rowattitem->parent_section_id = $property_id;
$rowattitem->section_name = $subpropArr[$l]['subproperty_name'];
$rowattitem->section_price = $subpropArr[$l]['subproperty_price'];
$rowattitem->section_vat = $section_vat;
$rowattitem->section_oprand = $subpropArr[$l]['subproperty_oprand'];
$rowattitem->is_accessory_att = 0;
if ($subproperty_id > 0) {
if (!$rowattitem->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
}
}
}
}
}
// $producthelper->insertProdcutUserfield($i,$item,$rowitem->order_item_id,12);
if (USE_CONTAINER) {
$producthelper->updateContainerStock($product_id, $quantity, $rowitem->container_id);
}
// Store userfields
$userfields = $item[$i]->extrafieldname;
$userfields_id = $item[$i]->extrafieldId;
for ($ui = 0; $ui < count($userfields); $ui++) {
$adminproducthelper->admin_insertProdcutUserfield($userfields_id[$ui], $rowitem->order_item_id, 12, $userfields[$ui]);
}
// redCRM RMA Transaction Entry
if ($iscrm) {
if (ENABLE_RMA && $rowitem->product_final_price < 0) {
// RMA transation log
if (isset($item[$i]->reason)) {
$rmaTrans =& $this->getTable('rma_transaction');
$rmaTrans->rma_transaction_id = 0;
$rmaTrans->rma_number = $postdata['rma_number'];
$rmaTrans->order_item_return_id = $rowitem->order_item_id;
$rmaTrans->order_item_return_reason = $item[$i]->reason;
$rmaTrans->order_item_return_status = $item[$i]->deposition;
$rmaTrans->order_item_return_action = $item[$i]->action;
$rmaTrans->cdate = time();
$rmaTrans->store();
if (ENABLE_ITEM_TRACKING_SYSTEM) {
// Manage supplier order stock
$crmSupplierOrderHelper = new crmSupplierOrderHelper();
$senddata['main_order_number'] = $postdata['main_order_number'];
$senddata['order_status'] = $row->order_status;
$senddata['product_id'] = $rowitem->product_id;
$senddata['property_id'] = $property_id;
$senddata['subproperty_id'] = $subproperty_id;
$senddata['deposition'] = $item[$i]->deposition;
$itemqty = $rowitem->product_quantity;
for ($r = 0; $r < $itemqty; $r++) {
示例2: neworderitem
//.........这里部分代码省略.........
$rowattitem->order_item_id = $orderitemdata->order_item_id;
$rowattitem->section_id = $attribute_id;
$rowattitem->section = "attribute";
$rowattitem->parent_section_id = $product_id;
$rowattitem->section_name = $attArr[$j]['attribute_name'];
$rowattitem->is_accessory_att = 0;
if ($attribute_id > 0) {
if (!$rowattitem->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
}
$propArr = $attArr[$j]['attribute_childs'];
for ($k = 0; $k < count($propArr); $k++) {
$section_vat = 0;
if ($propArr[$k]['property_price'] > 0) {
$section_vat = $producthelper->getProducttax($product_id, $propArr[$k]['property_price'], $usre_id);
}
$property_id = $propArr[$k]['property_id'];
/** product property STOCKROOM update start */
$updatestock = $stockroomhelper->updateStockroomQuantity($property_id, $quantity, "property");
$rowattitem =& $this->getTable('order_attribute_item');
$rowattitem->order_att_item_id = 0;
$rowattitem->order_item_id = $orderitemdata->order_item_id;
$rowattitem->section_id = $property_id;
$rowattitem->section = "property";
$rowattitem->parent_section_id = $attribute_id;
$rowattitem->section_name = $propArr[$k]['property_name'];
$rowattitem->section_price = $propArr[$k]['property_price'];
$rowattitem->section_vat = $section_vat;
$rowattitem->section_oprand = $propArr[$k]['property_oprand'];
$rowattitem->is_accessory_att = 0;
if ($property_id > 0) {
if (!$rowattitem->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
}
$subpropArr = $propArr[$k]['property_childs'];
for ($l = 0; $l < count($subpropArr); $l++) {
$section_vat = 0;
if ($subpropArr[$l]['subproperty_price'] > 0) {
$section_vat = $producthelper->getProducttax($product_id, $subpropArr[$l]['subproperty_price'], $user_id);
}
$subproperty_id = $subpropArr[$l]['subproperty_id'];
/** product subproperty STOCKROOM update start */
$updatestock = $stockroomhelper->updateStockroomQuantity($subproperty_id, $quantity, "subproperty");
$rowattitem =& $this->getTable('order_attribute_item');
$rowattitem->order_att_item_id = 0;
$rowattitem->order_item_id = $orderitemdata->order_item_id;
$rowattitem->section_id = $subproperty_id;
$rowattitem->section = "subproperty";
$rowattitem->parent_section_id = $property_id;
$rowattitem->section_name = $subpropArr[$l]['subproperty_name'];
$rowattitem->section_price = $subpropArr[$l]['subproperty_price'];
$rowattitem->section_vat = $section_vat;
$rowattitem->section_oprand = $subpropArr[$l]['subproperty_oprand'];
$rowattitem->is_accessory_att = 0;
if ($subproperty_id > 0) {
if (!$rowattitem->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
}
}
}
}
}
if (USE_CONTAINER) {
$producthelper->updateContainerStock($product_id, $quantity, $orderitemdata->container_id);
}
// Store userfields
$userfields = $item[$i]->extrafieldname;
$userfields_id = $item[$i]->extrafieldId;
for ($ui = 0; $ui < count($userfields); $ui++) {
$adminproducthelper->admin_insertProdcutUserfield($userfields_id[$ui], $orderitemdata->order_item_id, 12, $userfields[$ui]);
}
}
if ($orderitemdata->order_item_id > 0) {
$totalItemVat = $orderitemdata->product_item_price - $orderitemdata->product_item_price_excl_vat;
$orderdata->order_tax = $orderdata->order_tax + $totalItemVat * $orderitemdata->product_quantity;
$orderdata->order_total = $orderdata->order_total + $orderitemdata->product_final_price;
$orderdata->order_subtotal = $orderdata->order_subtotal + $orderitemdata->product_final_price;
$orderdata->mdate = time();
// Update order detail
if (!$orderdata->store()) {
return false;
}
if (ECONOMIC_INTEGRATION == 1) {
$economic = new economic();
$invoiceHandle = $economic->renewInvoiceInEconomic($orderdata);
}
// Send mail from template
$redshopMail = new redshopMail();
$redshopMail->sendOrderSpecialDiscountMail($this->_id);
} else {
return false;
}
return true;
}