本文整理汇总了PHP中producthelper::getGiftcardData方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getGiftcardData方法的具体用法?PHP producthelper::getGiftcardData怎么用?PHP producthelper::getGiftcardData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getGiftcardData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rsCarthelper
switch ($output_view) {
case 'simple':
if ($count) {
$output = '<div class="mod_cart_extend_total_pro_value" id="mod_cart_total_txt_product" >';
$output .= JText::_('COM_REDSHOP_TOTAL_PRODUCT') . ':' . ' ' . $cartTotalProduct . ' ' . JText::_('COM_REDSHOP_PRODUCTS_IN_CART');
$output .= '</div>';
}
break;
case 'extended':
$output = '<div class="mod_cart_products" id="mod_cart_products">';
if ($count) {
$cartTotalProduct = $idx;
for ($i = 0; $i < $idx; $i++) {
$carthelper = new rsCarthelper();
if ($carthelper->rs_multi_array_key_exists('giftcard_id', $cart[$i]) && $cart[$i]['giftcard_id']) {
$giftcardData = $producthelper->getGiftcardData($cart[$i]['giftcard_id']);
$name = $giftcardData->giftcard_name;
} else {
$product_detail = $producthelper->getProductById($cart[$i]['product_id']);
$name = $product_detail->product_name;
}
$output .= '<div class="mod_cart_product">';
$output .= '<div class="mod_cart_product_name">' . $name . ' x ' . $cart[$i]['quantity'] . '</div>';
if (!DEFAULT_QUOTATION_MODE || DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE) {
$output .= '<div class="mod_cart_product_price">';
if ($show_with_vat) {
$output .= $producthelper->getProductFormattedPrice($cart[$i]['product_price'], true);
} else {
$output .= $producthelper->getProductFormattedPrice($cart[$i]['product_price_excl_vat'], true);
}
$output .= '</div>';
示例2: 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'];
//.........这里部分代码省略.........
示例3:
}
}
$cart_mdata = '';
$subtotal_excl_vat = 0;
for ($i = 0; $i < count($quotationProducts); $i++) {
$cart_mdata .= $template_middle;
$wrapper_name = "";
if ($quotationProducts[$i]->product_wrapperid) {
$wrapper = $producthelper->getWrapper($quotationProducts[$i]->product_id, $quotationProducts[$i]->product_wrapperid);
if (count($wrapper) > 0) {
$wrapper_name = JText::_('COM_REDSHOP_WRAPPER') . ":<br/>" . $wrapper[0]->wrapper_name . "(" . $producthelper->getProductFormattedPrice($quotationProducts[$i]->wrapper_price) . ")";
}
}
if ($quotationProducts[$i]->is_giftcard == 1) {
$product_userfields = $quotationHelper->displayQuotationUserfield($quotationProducts[$i]->quotation_item_id, 13);
$giftcardData = $producthelper->getGiftcardData($quotationProducts[$i]->product_id);
$product_number = "";
} else {
$product_userfields = $quotationHelper->displayQuotationUserfield($quotationProducts[$i]->quotation_item_id, 12);
$product = $producthelper->getProductById($quotationProducts[$i]->product_id);
$product_number = $product->product_number;
$product_image_path = "";
if ($product->product_full_image) {
if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $product->product_full_image)) {
$product_image_path = $product->product_full_image;
} else {
if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) {
$product_image_path = PRODUCT_DEFAULT_IMAGE;
}
}
} else {