本文整理汇总了PHP中producthelper::makeAttributeCart方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::makeAttributeCart方法的具体用法?PHP producthelper::makeAttributeCart怎么用?PHP producthelper::makeAttributeCart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::makeAttributeCart方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayProductaddprice
/**
* Display Product add price
*
* @return void
*/
public function displayProductaddprice()
{
ob_clean();
$get = JRequest::get('get');
$producthelper = new producthelper();
$carthelper = new rsCarthelper();
$total_attribute = 0;
$product_id = $get['product_id'];
$quantity = $get['qunatity'];
$data = array();
$data['attribute_data'] = str_replace("::", "##", $get['attribute_data']);
$data['property_data'] = str_replace("::", "##", $get['property_data']);
$data['subproperty_data'] = str_replace("::", "##", $get['subproperty_data']);
$data['accessory_data'] = $get['accessory_data'];
$data['acc_quantity_data'] = $get['acc_quantity_data'];
$data['acc_attribute_data'] = str_replace("::", "##", $get['acc_attribute_data']);
$data['acc_property_data'] = str_replace("::", "##", $get['acc_property_data']);
$data['acc_subproperty_data'] = str_replace("::", "##", $get['acc_subproperty_data']);
$data['quantity'] = $quantity;
$cartdata = $carthelper->generateAttributeArray($data);
$retAttArr = $producthelper->makeAttributeCart($cartdata, $product_id, 0, '', $quantity);
$ProductPriceArr = $producthelper->getProductNetPrice($product_id, 0, $quantity);
$acccartdata = $carthelper->generateAccessoryArray($data);
$retAccArr = $producthelper->makeAccessoryCart($acccartdata, $product_id);
$accessory_price = $retAccArr[1];
$accessory_vat = $retAccArr[2];
$product_price = ($retAttArr[1] + $retAttArr[2]) * $quantity + $accessory_price + $accessory_vat;
$product_main_price = ($retAttArr[1] + $retAttArr[2]) * $quantity + $accessory_price + $accessory_vat;
$product_old_price = $ProductPriceArr['product_old_price'] * $quantity;
$product_price_saving = $ProductPriceArr['product_price_saving'] * $quantity;
$product_discount_price = $ProductPriceArr['product_discount_price'] * $quantity;
$product_price_novat = $retAttArr[1] * $quantity + $accessory_price;
$product_price_incl_vat = $ProductPriceArr['product_price_incl_vat'] * $quantity + $accessory_price + $accessory_vat;
$price_excluding_vat = $retAttArr[1] * $quantity + $accessory_price;
$seoProductPrice = $ProductPriceArr['seoProductPrice'] * $quantity;
$seoProductSavingPrice = $ProductPriceArr['seoProductSavingPrice'] * $quantity;
echo $product_price . ":" . $product_main_price . ":" . $product_old_price . ":" . $product_price_saving . ":" . $product_discount_price . ":" . $product_price_novat . ":" . $product_price_incl_vat . ":" . $price_excluding_vat . ":" . $seoProductPrice . ":" . $seoProductSavingPrice;
exit;
}
示例2: store
public function store($data)
{
$extra_field = new extra_field();
$quotationHelper = new quotationHelper();
$producthelper = new producthelper();
$rsCarthelper = new rsCarthelper();
$stockroomhelper = new rsstockroomhelper();
$extra_field->extra_field_save($data, 16, $data['user_info_id'], $data['user_email']);
$row = $this->getTable('quotation_detail');
if ($data['quotation_discount'] > 0) {
$data['order_total'] = $data['order_total'] - $data['quotation_discount'] - $data['order_total'] * $data['quotation_special_discount'] / 100;
}
$data['quotation_number'] = $quotationHelper->generateQuotationNumber();
$data['quotation_encrkey'] = $quotationHelper->randomQuotationEncrkey();
$data['quotation_cdate'] = time();
$data['quotation_mdate'] = time();
$data['quotation_total'] = $data['order_total'];
$data['quotation_subtotal'] = $data['order_subtotal'];
$data['quotation_tax'] = $data['order_tax'];
$data['quotation_ipaddress'] = !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'unknown';
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$row->quotation_status = 2;
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$quotation_item = array();
$user_id = $row->user_id;
$item = $data['order_item'];
for ($i = 0; $i < count($item); $i++) {
$product_id = $item[$i]->product_id;
$quantity = $item[$i]->quantity;
$product_excl_price = $item[$i]->prdexclprice;
$product_price = $item[$i]->productprice;
// Attribute price added
$generateAttributeCart = $rsCarthelper->generateAttributeArray((array) $item[$i], $user_id);
$retAttArr = $producthelper->makeAttributeCart($generateAttributeCart, $product_id, $user_id, 0, $quantity);
$product_attribute = $retAttArr[0];
// Accessory price
$generateAccessoryCart = $rsCarthelper->generateAccessoryArray((array) $item[$i], $user_id);
$retAccArr = $producthelper->makeAccessoryCart($generateAccessoryCart, $product_id, $user_id);
$product_accessory = $retAccArr[0];
$wrapper_price = 0;
$wrapper_vat = 0;
$wrapper = $producthelper->getWrapper($product_id, $item[$i]->wrapper_data);
if (count($wrapper) > 0) {
if ($wrapper[0]->wrapper_price > 0) {
$wrapper_vat = $producthelper->getProducttax($product_id, $wrapper[0]->wrapper_price, $user_id);
}
$wrapper_price = $wrapper[0]->wrapper_price + $wrapper_vat;
}
$rowitem =& $this->getTable('quotation_item_detail');
$product = $producthelper->getProductById($product_id);
$quotation_item[$i]->quotation_id = $row->quotation_id;
$quotation_item[$i]->product_id = $product_id;
$quotation_item[$i]->is_giftcard = 0;
$quotation_item[$i]->product_name = $product->product_name;
$quotation_item[$i]->actualitem_price = $product_price;
$quotation_item[$i]->product_price = $product_price;
$quotation_item[$i]->product_excl_price = $product_excl_price;
$quotation_item[$i]->product_final_price = $product_price * $quantity;
$quotation_item[$i]->product_attribute = $product_attribute;
$quotation_item[$i]->product_accessory = $product_accessory;
$quotation_item[$i]->product_wrapperid = $item[$i]->wrapper_data;
$quotation_item[$i]->wrapper_price = $wrapper_price;
$quotation_item[$i]->product_quantity = $quantity;
if (!$rowitem->bind($quotation_item[$i])) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$rowitem->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Store userfields
$userfields = JRequest::getVar('extrafields' . $product_id);
$userfields_id = JRequest::getVar('extrafields_id_' . $product_id);
for ($ui = 0; $ui < count($userfields); $ui++) {
$quotationHelper->insertQuotationUserfield($userfields_id[$ui], $rowitem->quotation_item_id, 12, $userfields[$ui]);
}
/** my accessory save in table start */
if (count($generateAccessoryCart) > 0) {
$attArr = $generateAccessoryCart;
for ($a = 0; $a < count($attArr); $a++) {
$accessory_vat_price = 0;
$accessory_attribute = "";
$accessory_id = $attArr[$a]['accessory_id'];
$accessory_name = $attArr[$a]['accessory_name'];
$accessory_price = $attArr[$a]['accessory_price'];
$accessory_org_price = $accessory_price;
if ($accessory_price > 0) {
$accessory_vat_price = $producthelper->getProductTax($rowitem->product_id, $accessory_price, $user_id);
}
$attchildArr = $attArr[$a]['accessory_childs'];
for ($j = 0; $j < count($attchildArr); $j++) {
$attribute_id = $attchildArr[$j]['attribute_id'];
$accessory_attribute .= urldecode($attchildArr[$j]['attribute_name']) . ":<br/>";
//.........这里部分代码省略.........
示例3: store
public function store($postdata)
{
$redshopMail = new redshopMail();
$order_functions = new order_functions();
$helper = new redhelper();
$producthelper = new producthelper();
$rsCarthelper = new rsCarthelper();
$shippinghelper = new shipping();
$adminproducthelper = new adminproducthelper();
$stockroomhelper = new rsstockroomhelper();
// For barcode generation
$barcode_code = $order_functions->barcode_randon_number(12, 0);
$postdata['barcode'] = $barcode_code;
$row = $this->getTable('order_detail');
if (!$row->bind($postdata)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$iscrm = $helper->isredCRM();
if ($iscrm) {
$postdata['order_id'] = $row->order_id;
$postdata['debitor_id'] = $postdata['user_info_id'];
JTable::addIncludePath(REDCRM_ADMIN . '/tables');
$crmorder =& $this->getTable('crm_order');
if (!$crmorder->bind($postdata)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$crmorder->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Update rma table entry
if (ENABLE_RMA && isset($postdata['rmanotes'])) {
$rmaInfo = $this->getTable('rma_orders');
$rmaInfo->rma_number = $postdata['rma_number'];
$rmaInfo->original_order_id = $postdata['main_order_id'];
$rmaInfo->credit_note_order_id = $row->order_id;
$rmaInfo->rma_note = $postdata['rmanotes'];
$rmaInfo->store();
}
JTable::addIncludePath(REDSHOP_ADMIN . '/tables');
}
$order_shipping = explode("|", $shippinghelper->decryptShipping(str_replace(" ", "+", $row->ship_method_id)));
$rowOrderStatus =& $this->getTable('order_status_log');
$rowOrderStatus->order_id = $row->order_id;
$rowOrderStatus->order_status = $row->order_status;
$rowOrderStatus->date_changed = time();
$rowOrderStatus->customer_note = $row->customer_note;
$rowOrderStatus->store();
$billingaddresses = $order_functions->getBillingAddress($row->user_id);
if (isset($postdata['billisship']) && $postdata['billisship'] == 1) {
$shippingaddresses = $billingaddresses;
} else {
$key = 0;
$shippingaddresses = $order_functions->getShippingAddress($row->user_id);
$shipp_users_info_id = isset($postdata['shipp_users_info_id']) && $postdata['shipp_users_info_id'] != 0 ? $postdata['shipp_users_info_id'] : 0;
if ($shipp_users_info_id != 0) {
for ($o = 0; $o < count($shippingaddresses); $o++) {
if ($shippingaddresses[$o]->users_info_id == $shipp_users_info_id) {
$key = $o;
break;
}
}
}
$shippingaddresses = $shippingaddresses[$key];
}
// ORDER DELIVERY TIME IS REMAINING
$user_id = $row->user_id;
$item = $postdata['order_item'];
for ($i = 0; $i < count($item); $i++) {
$product_id = $item[$i]->product_id;
$quantity = $item[$i]->quantity;
$product_excl_price = $item[$i]->prdexclprice;
$product_price = $item[$i]->productprice;
// Attribute price added
$generateAttributeCart = $rsCarthelper->generateAttributeArray((array) $item[$i], $user_id);
$retAttArr = $producthelper->makeAttributeCart($generateAttributeCart, $product_id, $user_id, 0, $quantity);
$product_attribute = $retAttArr[0];
// Accessory price
$generateAccessoryCart = $rsCarthelper->generateAccessoryArray((array) $item[$i], $user_id);
$retAccArr = $producthelper->makeAccessoryCart($generateAccessoryCart, $product_id, $user_id);
$product_accessory = $retAccArr[0];
$accessory_total_price = $retAccArr[1];
$accessory_vat_price = $retAccArr[2];
$wrapper_price = 0;
$wrapper_vat = 0;
if ($item[$i]->wrapper_data != 0 && $item[$i]->wrapper_data != '') {
$wrapper = $producthelper->getWrapper($product_id, $item[$i]->wrapper_data);
if (count($wrapper) > 0) {
if ($wrapper[0]->wrapper_price > 0) {
$wrapper_vat = $producthelper->getProducttax($product_id, $wrapper[0]->wrapper_price, $user_id);
}
$wrapper_price = $wrapper[0]->wrapper_price + $wrapper_vat;
}
}
//.........这里部分代码省略.........
示例4: neworderitem
public function neworderitem($data, $quantity, $order_item_id)
{
$adminproducthelper = new adminproducthelper();
$producthelper = new producthelper();
$rsCarthelper = new rsCarthelper();
$stockroomhelper = new rsstockroomhelper();
// Get Order Info
$orderdata = $this->getTable('order_detail');
$orderdata->load($this->_id);
$item = $data['order_item'];
// Get product Info
// Set Order Item Info
$orderitemdata = $this->getTable('order_item_detail');
$orderitemdata->load($order_item_id);
$user_id = $orderdata->user_id;
for ($i = 0; $i < count($item); $i++) {
$product_id = $item[$i]->product_id;
$product_excl_price = $item[$i]->prdexclprice;
$product_price = $item[$i]->productprice;
// Attribute price added
$generateAttributeCart = $rsCarthelper->generateAttributeArray((array) $item[$i], $user_id);
$retAttArr = $producthelper->makeAttributeCart($generateAttributeCart, $product_id, $user_id, 0, $quantity);
$product_attribute = $retAttArr[0];
// Accessory price
$generateAccessoryCart = $rsCarthelper->generateAccessoryArray((array) $item[$i], $user_id);
$retAccArr = $producthelper->makeAccessoryCart($generateAccessoryCart, $product_id, $user_id);
$product_accessory = $retAccArr[0];
$wrapper_price = 0;
$wrapper_vat = 0;
if ($item[$i]->wrapper_data != 0 && $item[$i]->wrapper_data != '') {
$wrapper = $producthelper->getWrapper($product_id, $item[$i]->wrapper_data);
if (count($wrapper) > 0) {
if ($wrapper[0]->wrapper_price > 0) {
$wrapper_vat = $producthelper->getProducttax($product_id, $wrapper[0]->wrapper_price, $user_id);
}
$wrapper_price = $wrapper[0]->wrapper_price + $wrapper_vat;
}
}
$product = $producthelper->getProductById($product_id);
$updatestock = $stockroomhelper->updateStockroomQuantity($product_id, $quantity);
$stockroom_id_list = $updatestock['stockroom_list'];
$stockroom_quantity_list = $updatestock['stockroom_quantity_list'];
$orderitemdata->stockroom_id = $stockroom_id_list;
$orderitemdata->stockroom_quantity = $stockroom_quantity_list;
$orderitemdata->order_item_id = 0;
$orderitemdata->order_id = $this->_id;
$orderitemdata->user_info_id = $orderdata->user_info_id;
$orderitemdata->supplier_id = $product->manufacturer_id;
$orderitemdata->product_id = $product_id;
$orderitemdata->order_item_sku = $product->product_number;
$orderitemdata->order_item_name = $product->product_name;
$orderitemdata->product_quantity = $quantity;
$orderitemdata->product_item_price = $product_price;
$orderitemdata->product_item_price_excl_vat = $product_excl_price;
$orderitemdata->product_final_price = $product_price * $quantity;
$orderitemdata->order_item_currency = REDCURRENCY_SYMBOL;
$orderitemdata->order_status = "P";
$orderitemdata->cdate = time();
$orderitemdata->mdate = time();
$orderitemdata->product_attribute = $product_attribute;
$orderitemdata->product_accessory = $product_accessory;
$orderitemdata->wrapper_id = $item[$i]->wrapper_data;
$orderitemdata->wrapper_price = $wrapper_price;
if ($producthelper->checkProductDownload($product_id)) {
$medianame = $producthelper->getProductMediaName($product_id);
for ($j = 0; $j < count($medianame); $j++) {
$sql = "INSERT INTO " . $this->_table_prefix . "product_download " . "(product_id, user_id, order_id, end_date, download_max, download_id, file_name) " . "VALUES('" . $product_id . "', '" . $user_id . "', '" . $this->_id . "', " . "'" . (time() + PRODUCT_DOWNLOAD_DAYS * 23 * 59 * 59) . "', '" . PRODUCT_DOWNLOAD_LIMIT . "', " . "'" . md5(uniqid(mt_rand(), true)) . "', '" . $medianame[$j]->media_name . "')";
$this->_db->setQuery($sql);
$this->_db->query();
}
}
if (!$orderitemdata->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
/** my accessory save in table start */
if (count($generateAccessoryCart) > 0) {
$attArr = $generateAccessoryCart;
for ($a = 0; $a < count($attArr); $a++) {
$accessory_vat_price = 0;
$accessory_attribute = "";
$accessory_id = $attArr[$a]['accessory_id'];
$accessory_name = $attArr[$a]['accessory_name'];
$accessory_price = $attArr[$a]['accessory_price'];
$accessory_org_price = $accessory_price;
if ($accessory_price > 0) {
$accessory_vat_price = $producthelper->getProductTax($product_id, $accessory_price, $user_id);
}
$attchildArr = $attArr[$a]['accessory_childs'];
for ($j = 0; $j < count($attchildArr); $j++) {
$attribute_id = $attchildArr[$j]['attribute_id'];
$accessory_attribute .= urldecode($attchildArr[$j]['attribute_name']) . ":<br/>";
$rowattitem =& $this->getTable('order_attribute_item');
$rowattitem->order_att_item_id = 0;
$rowattitem->order_item_id = $orderitemdata->order_item_id;
$rowattitem->section_id = $attribute_id;
$rowattitem->section = "attribute";
$rowattitem->parent_section_id = $accessory_id;
$rowattitem->section_name = $attchildArr[$j]['attribute_name'];
$rowattitem->is_accessory_att = 1;
//.........这里部分代码省略.........
示例5: store
public function store($data, $post)
{
$this->_loadData();
$quotationHelper = new quotationHelper();
$producthelper = new producthelper();
$extra_field = new extra_field();
$user = JFactory::getUser();
$user_id = 0;
$user_info_id = 0;
$user_email = $post['user_email'];
if ($user->id) {
$user_id = $user->id;
$user_info_id = $this->_data->user_info_id;
$user_email = $user->email;
}
$res = $this->getUserIdByEmail($user_email);
if (count($res) > 0) {
$user_id = $res->user_id;
$user_info_id = $res->users_info_id;
}
$list_field = $extra_field->extra_field_save($post, 16, $user_info_id, $user_email);
$data['quotation_number'] = $quotationHelper->generateQuotationNumber();
$data['user_id'] = $user_id;
$data['user_info_id'] = $user_info_id;
$data['user_email'] = $user_email;
$data['quotation_total'] = $data['total'];
$data['quotation_subtotal'] = $data['subtotal'];
$data['quotation_tax'] = $data['tax'];
$data['quotation_status'] = 1;
$data['quotation_cdate'] = time();
$data['quotation_mdate'] = time();
$data['quotation_note'] = $data['quotation_note'];
$data['quotation_ipaddress'] = $_SERVER['REMOTE_ADDR'];
$data['quotation_encrkey'] = $quotationHelper->randomQuotationEncrkey();
$data['quotation_discount'] = isset($data['discount2']) ? $data['discount2'] : 0;
$totalitem = $data['idx'];
$quotation_item = array();
$row = $this->getTable('quotation_detail');
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
for ($i = 0; $i < $totalitem; $i++) {
$rowitem = $this->getTable('quotation_item_detail');
$quotation_item[$i] = new stdClass();
$quotation_item[$i]->quotation_id = $row->quotation_id;
if (isset($data[$i]['giftcard_id']) && $data[$i]['giftcard_id'] != 0) {
$quotation_item[$i]->product_id = $data[$i]['giftcard_id'];
$giftcardData = $producthelper->getGiftcardData($data[$i]['giftcard_id']);
$quotation_item[$i]->is_giftcard = 1;
$quotation_item[$i]->product_name = $giftcardData->giftcard_name;
$section = 13;
} else {
$product = $producthelper->getProductById($data[$i]['product_id']);
$retAttArr = $producthelper->makeAttributeCart($data[$i]['cart_attribute'], $data[$i]['product_id'], 0, 0, $data[$i]['quantity']);
$cart_attribute = $retAttArr[0];
$retAccArr = $producthelper->makeAccessoryCart($data[$i]['cart_accessory'], $data[$i]['product_id']);
$cart_accessory = $retAccArr[0];
$quotation_item[$i]->product_id = $data[$i]['product_id'];
$quotation_item[$i]->is_giftcard = 0;
$quotation_item[$i]->product_name = $product->product_name;
$quotation_item[$i]->actualitem_price = $data[$i]['product_price'];
$quotation_item[$i]->product_price = $data[$i]['product_price'];
$quotation_item[$i]->product_excl_price = $data[$i]['product_price_excl_vat'];
$quotation_item[$i]->product_final_price = $data[$i]['product_price'] * $data[$i]['quantity'];
$quotation_item[$i]->product_attribute = $cart_attribute;
$quotation_item[$i]->product_accessory = $cart_accessory;
$quotation_item[$i]->product_wrapperid = $data[$i]['wrapper_id'];
$quotation_item[$i]->wrapper_price = $data[$i]['wrapper_price'];
$section = 12;
}
$quotation_item[$i]->product_quantity = $data[$i]['quantity'];
if (!$rowitem->bind($quotation_item[$i])) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$rowitem->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
/** my accessory save in table start */
if (count($data[$i]['cart_accessory']) > 0) {
$attArr = $data[$i]['cart_accessory'];
for ($a = 0; $a < count($attArr); $a++) {
$accessory_vat_price = 0;
$accessory_attribute = "";
$accessory_id = $attArr[$a]['accessory_id'];
$accessory_name = $attArr[$a]['accessory_name'];
$accessory_price = $attArr[$a]['accessory_price'];
$accessory_org_price = $accessory_price;
if ($accessory_price > 0) {
$accessory_vat_price = $producthelper->getProductTax($rowitem->product_id, $accessory_price);
}
$attchildArr = $attArr[$a]['accessory_childs'];
for ($j = 0; $j < count($attchildArr); $j++) {
$attribute_id = $attchildArr[$j]['attribute_id'];
//.........这里部分代码省略.........
示例6: newQuotationItem
public function newQuotationItem($data)
{
$quotationHelper = new quotationHelper();
$rsCarthelper = new rsCarthelper();
$producthelper = new producthelper();
$stockroomhelper = new rsstockroomhelper();
$item = $data['quotation_item'];
// Get Order Info
$quotationdata = $this->getTable('quotation_detail');
$quotationdata->load($this->_id);
$user_id = $quotationdata->user_id;
// Set Order Item Info
$qitemdata = $this->getTable('quotation_item_detail');
for ($i = 0; $i < count($item); $i++) {
$product_id = $item[$i]->product_id;
$quantity = $item[$i]->quantity;
$product_excl_price = $item[$i]->prdexclprice;
$product_price = $item[$i]->productprice;
$product = $producthelper->getProductById($product_id);
$generateAttributeCart = $rsCarthelper->generateAttributeArray((array) $item[$i], $user_id);
$retAttArr = $producthelper->makeAttributeCart($generateAttributeCart, $product_id, $user_id, 0, $quantity);
$product_attribute = $retAttArr[0];
$generateAccessoryCart = $rsCarthelper->generateAccessoryArray((array) $item[$i], $user_id);
$retAccArr = $producthelper->makeAccessoryCart($generateAccessoryCart, $product_id, $user_id);
$product_accessory = $retAccArr[0];
$wrapper_price = 0;
$wrapper_vat = 0;
$wrapper = $producthelper->getWrapper($product_id, $item[$i]->wrapper_data);
if (count($wrapper) > 0) {
if ($wrapper[0]->wrapper_price > 0) {
$wrapper_vat = $producthelper->getProducttax($product_id, $wrapper[0]->wrapper_price, $user_id);
}
$wrapper_price = $wrapper[0]->wrapper_price + $wrapper_vat;
}
$qitemdata =& $this->getTable('quotation_item_detail');
$qitemdata->quotation_item_id = 0;
$qitemdata->quotation_id = $this->_id;
$qitemdata->product_id = $product_id;
$qitemdata->is_giftcard = 0;
$qitemdata->product_name = $product->product_name;
$qitemdata->actualitem_price = $product_price;
$qitemdata->product_price = $product_price;
$qitemdata->product_excl_price = $product_excl_price;
$qitemdata->product_final_price = $product_price * $quantity;
$qitemdata->product_attribute = $product_attribute;
$qitemdata->product_accessory = $product_accessory;
$qitemdata->product_wrapperid = $item[$i]->wrapper_data;
$qitemdata->wrapper_price = $wrapper_price;
$qitemdata->product_quantity = $quantity;
if (!$qitemdata->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
/** my accessory save in table start */
if (count($generateAccessoryCart) > 0) {
$attArr = $generateAccessoryCart;
for ($a = 0; $a < count($attArr); $a++) {
$accessory_vat_price = 0;
$accessory_attribute = "";
$accessory_id = $attArr[$a]['accessory_id'];
$accessory_name = $attArr[$a]['accessory_name'];
$accessory_price = $attArr[$a]['accessory_price'];
$accessory_org_price = $accessory_price;
if ($accessory_price > 0) {
$accessory_vat_price = $producthelper->getProductTax($qitemdata->product_id, $accessory_price, $user_id);
}
$attchildArr = $attArr[$a]['accessory_childs'];
for ($j = 0; $j < count($attchildArr); $j++) {
$attribute_id = $attchildArr[$j]['attribute_id'];
$accessory_attribute .= urldecode($attchildArr[$j]['attribute_name']) . ":<br/>";
$rowattitem =& $this->getTable('quotation_attribute_item');
$rowattitem->quotation_att_item_id = 0;
$rowattitem->quotation_item_id = $qitemdata->quotation_item_id;
$rowattitem->section_id = $attribute_id;
$rowattitem->section = "attribute";
$rowattitem->parent_section_id = $accessory_id;
$rowattitem->section_name = $attchildArr[$j]['attribute_name'];
$rowattitem->is_accessory_att = 1;
if ($attribute_id > 0) {
if (!$rowattitem->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
}
$propArr = $attchildArr[$j]['attribute_childs'];
for ($k = 0; $k < count($propArr); $k++) {
$section_vat = 0;
if ($propArr[$k]['property_price'] > 0) {
$section_vat = $producthelper->getProducttax($qitemdata->product_id, $propArr[$k]['property_price'], $user_id);
}
$property_id = $propArr[$k]['property_id'];
$accessory_attribute .= urldecode($propArr[$k]['property_name']) . " (" . $propArr[$k]['property_oprand'] . $producthelper->getProductFormattedPrice($propArr[$k]['property_price'] + $section_vat) . ")<br/>";
$subpropArr = $propArr[$k]['property_childs'];
$rowattitem =& $this->getTable('quotation_attribute_item');
$rowattitem->quotation_att_item_id = 0;
$rowattitem->quotation_item_id = $qitemdata->quotation_item_id;
$rowattitem->section_id = $property_id;
$rowattitem->section = "property";
$rowattitem->parent_section_id = $attribute_id;
$rowattitem->section_name = $propArr[$k]['property_name'];
//.........这里部分代码省略.........