本文整理汇总了PHP中producthelper::getProductMediaName方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getProductMediaName方法的具体用法?PHP producthelper::getProductMediaName怎么用?PHP producthelper::getProductMediaName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getProductMediaName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
//.........这里部分代码省略.........
// STOCKROOM update
$updatestock = $stockroomhelper->updateStockroomQuantity($product_id, $quantity);
$stockroom_id_list = $updatestock['stockroom_list'];
$stockroom_quantity_list = $updatestock['stockroom_quantity_list'];
$rowitem->stockroom_id = $stockroom_id_list;
$rowitem->stockroom_quantity = $stockroom_quantity_list;
$rowitem->order_item_id = 0;
$rowitem->order_id = $row->order_id;
$rowitem->user_info_id = $row->user_info_id;
$rowitem->supplier_id = $product->manufacturer_id;
$rowitem->product_id = $product_id;
$rowitem->order_item_sku = $product->product_number;
$rowitem->order_item_name = $product->product_name;
$rowitem->product_quantity = $quantity;
$rowitem->product_item_price = $product_price;
$rowitem->product_item_price_excl_vat = $product_excl_price;
$rowitem->product_final_price = $product_price * $quantity;
$rowitem->order_item_currency = REDCURRENCY_SYMBOL;
$rowitem->order_status = $row->order_status;
$rowitem->cdate = $row->cdate;
$rowitem->mdate = $row->cdate;
$rowitem->product_attribute = $product_attribute;
$rowitem->product_accessory = $product_accessory;
$rowitem->wrapper_id = $item[$i]->wrapper_data;
$rowitem->wrapper_price = $wrapper_price;
$rowitem->is_giftcard = 0;
// RedCRM product purchase price
if ($iscrm) {
$crmProductHelper = new crmProductHelper();
$crmproduct = $crmProductHelper->getProductById($product_id);
$rowitem->product_purchase_price = $crmproduct->product_purchase_price > 0 ? $crmproduct->product_purchase_price : $crmproduct->product_price;
}
if ($producthelper->checkProductDownload($product_id)) {
$medianame = $producthelper->getProductMediaName($product_id);
for ($j = 0; $j < count($medianame); $j++) {
$product_serial_number = $producthelper->getProdcutSerialNumber($product_id);
$producthelper->insertProductDownload($product_id, $user_id, $rowitem->order_id, $medianame[$j]->media_name, $product_serial_number->serial_number);
}
}
if (!$rowitem->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 = $rowitem->order_item_id;
$rowattitem->section_id = $attribute_id;
$rowattitem->section = "attribute";
$rowattitem->parent_section_id = $accessory_id;
示例2: 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;
//.........这里部分代码省略.........