本文整理汇总了PHP中producthelper::getProductNetPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getProductNetPrice方法的具体用法?PHP producthelper::getProductNetPrice怎么用?PHP producthelper::getProductNetPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类producthelper
的用法示例。
在下文中一共展示了producthelper::getProductNetPrice方法的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: display_products
function display_products($rows)
{
$url = JURI::base();
$extra_data = new producthelper();
$producthelper = new producthelper();
for ($i = 0; $i < count($rows); $i++) {
$row = $rows[$i];
$Itemid = $this->redHelper->getItemid($row->product_id);
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $row->product_id . '&Itemid=' . $Itemid);
$product_price = $producthelper->getProductPrice($row->product_id);
$productArr = $producthelper->getProductNetPrice($row->product_id);
$product_price_discount = $productArr['productPrice'] + $productArr['productVat'];
if ($row->product_full_image) {
echo $thum_image = "<div class='mod_wishlist_product_image' >" . ($thum_image = $producthelper->getProductImage($row->product_id, $link, "100", "100") . "\n\t\t\t</div>");
}
echo "<a href='" . $link . "'>" . $row->product_name . "</a><br>";
if ($row->product_on_sale && $product_price_discount > 0) {
if ($product_price > $product_price_discount) {
$s_price = $product_price - $product_price_discount;
if ($this->show_discountpricelayout) {
echo "<div id='mod_redoldprice' class='mod_redoldprice'><span style='text-decoration:line-through;'>" . $producthelper->getProductFormattedPrice($product_price) . "</span></div>";
$product_price = $product_price_discount;
echo "<div id='mod_redmainprice' class='mod_redmainprice'>" . $producthelper->getProductFormattedPrice($product_price_discount) . "</div>";
echo "<div id='mod_redsavedprice' class='mod_redsavedprice'>" . JText::_('COM_REDSHOP_PRODCUT_PRICE_YOU_SAVED') . ' ' . $producthelper->getProductFormattedPrice($s_price) . "</div>";
} else {
$product_price = $product_price_discount;
echo "<div class='mod_redproducts_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
}
} else {
echo "<div class='mod_redproducts_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
}
} else {
echo "<div class='mod_redproducts_price'>" . $producthelper->getProductFormattedPrice($product_price) . "</div>";
}
echo "<br><a href='" . $link . "'>" . JText::_('COM_REDSHOP_READ_MORE') . "</a> ";
echo $addtocartdata = $producthelper->replaceCartTemplate($row->product_id);
echo "<div>" . $addtocartdata . "</div>";
}
}
示例3: getProductItemInfo
public function getProductItemInfo($product_id = 0, $quantity = 1, $unique_id = "", $user_id = 0, $newproduct_price = 0)
{
$producthelper = new producthelper();
$wrapperlist = "";
$accessorylist = "";
$attributelist = "";
$productuserfield = "";
$product_price = 0;
$product_price_excl_vat = 0;
$producttax = 0;
if ($product_id) {
$productInfo = $producthelper->getProductById($product_id);
if ($newproduct_price != 0) {
$product_price_excl_vat = $newproduct_price;
$producttax = $producthelper->getProductTax($product_id, $newproduct_price, $user_id);
} else {
$productArr = $producthelper->getProductNetPrice($product_id, $user_id, $quantity);
$product_price_excl_vat = $productArr['productPrice'];
$producttax = $productArr['productVat'];
// Attribute start
$attributes_set = array();
if ($productInfo->attribute_set_id > 0) {
$attributes_set = $producthelper->getProductAttribute(0, $productInfo->attribute_set_id, 0, 1);
}
$attributes = $producthelper->getProductAttribute($product_id);
$attributes = array_merge($attributes, $attributes_set);
$attributelist = $this->replaceAttributeData($product_id, 0, $attributes, $user_id, $unique_id);
// Accessory start
$accessory = $producthelper->getProductAccessory(0, $product_id);
$accessorylist = $this->replaceAccessoryData($product_id, $accessory, $user_id, $unique_id);
// Wrapper selection box generate
$wrapperlist = $this->replaceWrapperData($product_id, $user_id, $unique_id);
$productuserfield = $this->replaceUserfield($product_id, $productInfo->product_template, $unique_id);
}
}
$product_price = $product_price_excl_vat + $producttax;
$total_price = $product_price * $quantity;
$totaltax = $producttax * $quantity;
$displayrespoce = "";
$displayrespoce .= "<div id='product_price_excl_vat'>" . $product_price_excl_vat . "</div>";
$displayrespoce .= "<div id='product_tax'>" . $producttax . "</div>";
$displayrespoce .= "<div id='product_price'>" . $product_price . "</div>";
$displayrespoce .= "<div id='total_price'>" . $total_price . "</div>";
$displayrespoce .= "<div id='total_tax'>" . $totaltax . "</div>";
$displayrespoce .= "<div id='attblock'><table>" . $attributelist . "</table></div>";
$displayrespoce .= "<div id='productuserfield'><table>" . $productuserfield . "</table></div>";
$displayrespoce .= "<div id='accessoryblock'><table>" . $accessorylist . "</table></div>";
$displayrespoce .= "<div id='noteblock'>" . $wrapperlist . "</div>";
return $displayrespoce;
}
示例4: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a JError object.
*
* @see fetch()
* @since 11.1
*/
public function display($tpl = null)
{
// Request variables
$prodhelperobj = new producthelper();
$this->redTemplate = new Redtemplate();
$this->redHelper = new redhelper();
$this->textHelper = new text_library();
$this->app = JFactory::getApplication();
$this->input = $this->app->input;
$this->model = $this->getModel('product');
$this->document = JFactory::getDocument();
$this->session = JFactory::getSession();
$pageheadingtag = '';
$params = $this->app->getParams('com_redshop');
$menu_meta_keywords = $params->get('menu-meta_keywords');
$menu_meta_description = $params->get('menu-meta_description');
$menu_robots = $params->get('robots');
$this->data = $this->get('data');
$productTemplate = null;
$this->itemId = $this->input->getInt('Itemid', null);
$this->pid = $this->input->getInt('pid', 0);
$layout = $this->input->getString('layout', 'default');
$template = $this->input->getString('r_template', '');
JPluginHelper::importPlugin('redshop_product');
$this->dispatcher = JDispatcher::getInstance();
if (!$this->pid) {
$this->pid = $params->get('productid');
}
/*
* Include JavaScript.
* But, first check if a plugin wants to use its own jQuery.
*/
$stopJQuery = $this->dispatcher->trigger('stopProductRedshopJQuery', array($this->data, $layout));
if (in_array(true, $stopJQuery, true)) {
$stopJQuery = true;
} else {
$stopJQuery = false;
}
if (!$stopJQuery) {
JHtml::Script('jquery.js', 'components/com_redshop/assets/js/', false);
}
JHtml::Script('redBOX.js', 'components/com_redshop/assets/js/', false);
JHtml::Script('json.js', 'components/com_redshop/assets/js/', false);
JHtml::Script('attribute.js', 'components/com_redshop/assets/js/', false);
JHtml::Script('common.js', 'components/com_redshop/assets/js/', false);
// Lightbox Javascript
JHtml::Stylesheet('style.css', 'components/com_redshop/assets/css/');
JHtml::Stylesheet('scrollable-navig.css', 'components/com_redshop/assets/css/');
if ($layout == "downloadproduct") {
$this->setLayout('downloadproduct');
} elseif ($layout == "compare") {
$this->setLayout('compare');
} elseif ($layout == "viewajaxdetail") {
$this->setLayout('viewajaxdetail');
} elseif ($layout == "searchletter") {
$this->setLayout('searchletter');
} else {
// Ajax box
if ($template == 'cartbox' && AJAX_CART_BOX == 1) {
$this->loadTemplate('cartbox');
exit;
} else {
$this->setLayout('default');
}
$prodhelperobj_array_main = $prodhelperobj->getProductNetPrice($this->data->product_id);
if ($this->data->published == 0) {
JError::raiseError(404, sprintf(JText::_('COM_REDSHOP_PRODUCT_IS_NOT_PUBLISHED'), $this->data->product_name, $this->data->product_number));
}
if ($this->data->canonical_url != "") {
$main_url = JURI::root() . $this->data->canonical_url;
$canonical = '<link rel="canonical" href="' . $main_url . '" />';
$this->document->addCustomTag($canonical);
} elseif ($this->data->product_parent_id != 0 && $this->data->product_parent_id != "") {
$product_parent_data = $prodhelperobj->getProductById($this->data->product_parent_id);
if ($product_parent_data->canonical_url != "") {
$main_url = JURI::root() . $product_parent_data->canonical_url;
$canonical = '<link rel="canonical" href="' . $main_url . '" />';
$this->document->addCustomTag($canonical);
} else {
$main_url = substr_replace(JURI::root(), "", -1);
$main_url .= JRoute::_('index.php?option=com_redshop&view=product&layout=detail&Itemid=' . $this->itemId . '&pid=' . $this->data->product_parent_id, false);
$canonical = '<link rel="canonical" href="' . $main_url . '" />';
$this->document->addCustomTag($canonical);
}
}
$productTemplate = $this->model->getProductTemplate();
/*
* Process the prepare Product plugins
*/
$this->dispatcher->trigger('onPrepareProduct', array(&$productTemplate->template_desc, &$params, $this->data));
//.........这里部分代码省略.........
示例5:
$productInfo = $producthelper->getProductById($row->product_id);
if ($image) {
$thumb = $productInfo->product_full_image;
if (WATERMARK_PRODUCT_IMAGE) {
$thum_image = $redhelper->watermark('product', $thumb, $thumbwidth, $thumbheight, WATERMARK_PRODUCT_THUMB_IMAGE, '0');
echo "<div class='mod_redshop_products_image'><img src=" . $thum_image . "></div>";
} else {
$thum_image = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'product', $thumbwidth, $thumbheight, USE_IMAGE_SIZE_SWAPPING);
echo "<div class='mod_redshop_products_image'><a href='" . $link . "' title='{$row->product_name}'><img src=" . $thum_image . "></a></div>";
}
}
if (!empty($stock_status)) {
echo $stock_status;
}
if (!$row->not_for_sale && $show_price) {
$productArr = $producthelper->getProductNetPrice($row->product_id);
if ($show_vat != '0') {
$product_price = $productArr['product_old_price'];
$product_price_discount = $productArr['productPrice'] + $productArr['productVat'];
} else {
$product_price = $productArr['product_old_price_excl_vat'];
$product_price_discount = $productArr['productPrice'];
}
if (SHOW_PRICE && (!DEFAULT_QUOTATION_MODE || DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE)) {
if (!$product_price) {
$product_price_dis = $producthelper->getPriceReplacement($product_price);
} else {
$product_price_dis = $producthelper->getProductFormattedPrice($product_price);
}
$disply_text = "<div class='mod_redshop_price'><div class='mod_redshop_products_price'>" . $product_price_dis . "</div>";
if ($row->product_on_sale && $product_price_discount > 0) {
示例6: foreach
$h_thumb = THUMB_HEIGHT;
$w_thumb = THUMB_WIDTH;
}
$temp_template = '';
$extraFieldName = $extraField->getSectionFieldNameArray(1, 1, 1);
if (count($MyWishlist) > 0) {
$mainid = null;
$totattid = null;
$totcount_no_user_field = null;
foreach ($MyWishlist as $row) {
$wishlistuserfielddata = $producthelper->getwishlistuserfieldata($row->wishlist_id, $row->product_id);
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $row->product_id . '&Itemid=' . $Itemid);
$link_remove = JRoute::_('index.php?option=com_redshop&view=account&layout=mywishlist&wishlist_id=' . $wishlist_id . '&pid=' . $row->product_id . '&remove=1&Itemid=' . $Itemid);
$thum_image = $producthelper->getProductImage($row->product_id, $link, $w_thumb, $h_thumb);
$product_price = $producthelper->getProductPrice($row->product_id);
$product_price_discount = $producthelper->getProductNetPrice($row->product_id);
$pname = "<a href='" . $link . "' >" . $row->product_name . "</a>";
$wishlist_data = str_replace($tag, $thum_image, $wishlist_desc);
$wishlist_data = str_replace('{product_number}', $row->product_number, $wishlist_data);
$wishlist_data = str_replace('{product_name}', $pname, $wishlist_data);
/*if($product_price > $product_price_discount)
{
$wishlist_data = str_replace('{product_price}', $producthelper->getProductFormattedPrice($product_price_discount) , $wishlist_data);
}else{
$wishlist_data = str_replace('{product_price}', $producthelper->getProductFormattedPrice($product_price) , $wishlist_data);
}*/
$wishlist_data = str_replace('{product_s_desc}', $row->product_s_desc, $wishlist_data);
// Checking for child products start
if (strstr($wishlist_data, "{child_products}")) {
$parentproductid = $row->product_id;
if ($this->data->product_parent_id != 0) {