当前位置: 首页>>代码示例>>PHP>>正文


PHP producthelper::getProductPrice方法代码示例

本文整理汇总了PHP中producthelper::getProductPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP producthelper::getProductPrice方法的具体用法?PHP producthelper::getProductPrice怎么用?PHP producthelper::getProductPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在producthelper的用法示例。


在下文中一共展示了producthelper::getProductPrice方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getData

 function getData($number)
 {
     nextendimport('nextend.database.database');
     $db = NextendDatabase::getInstance();
     require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/redshop.cfg.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/configuration.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/template.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/stockroom.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/economic.php';
     require_once JPATH_SITE . '/components/com_redshop/helpers/product.php';
     $Redconfiguration = new Redconfiguration();
     $data = array();
     $where = array();
     $category = array_map('intval', explode('||', $this->_data->get('redshopproductssourcecategory', '')));
     if (!in_array(0, $category) && count($category) > 0) {
         $where[] = 'pr_cat.category_id IN (' . implode(',', $category) . ') ';
     }
     if ($this->_data->get('redshopproductssourcepublished', 1)) {
         $where[] = ' pr.published = 1 ';
     }
     if ($this->_data->get('redshopproductssourcespecial', 0)) {
         $where[] = ' (pr.product_special =  1) ';
     }
     if ($this->_data->get('redshopproductssourceonsale', 0)) {
         $where[] = ' (pr.product_on_sale =  1) ';
     }
     $o = '';
     $order = NextendParse::parse($this->_data->get('redshopproductsorder1', 'pr.product_name|*|asc'));
     if ($order[0]) {
         $o .= 'ORDER BY ' . $order[0] . ' ' . $order[1] . ' ';
         $order = NextendParse::parse($this->_data->get('redshopproductsorder2', 'pr.product_name|*|asc'));
         if ($order[0]) {
             $o .= ', ' . $order[0] . ' ' . $order[1] . ' ';
         }
     }
     $query = "SELECT \r\n                        pr.product_id, \r\n                        pr.published, \r\n                        pr_cat.ordering, \r\n                        pr.product_name as name, \r\n                        pr.product_s_desc as short_description, \r\n                        pr.product_desc as description, \r\n                        man.manufacturer_name as man_name,\r\n                        pr.product_full_image as image, \r\n                        pr.product_thumb_image as image_thumbnail, \r\n                        pr.product_price,\r\n                        cat.category_id,\r\n                        cat.category_name, \r\n                        cat.category_short_description , \r\n                        cat.category_description\r\n                    FROM `#__redshop_product` AS pr\r\n                    LEFT JOIN `#__redshop_product_category_xref` AS pr_cat USING (product_id)\r\n                    LEFT JOIN `#__redshop_category` AS cat USING (category_id)\r\n                    LEFT JOIN `#__redshop_manufacturer` AS man USING(manufacturer_id)\r\n                    WHERE pr.product_parent_id=0 " . (count($where) ? ' AND ' . implode(' AND ', $where) : '') . " " . $o . " LIMIT 0, " . $number;
     $db->setQuery($query);
     $result = $db->loadAssocList();
     $uri = str_replace(array('http://', 'https://'), '//', NextendUri::getBaseUri());
     for ($i = 0; $i < count($result); $i++) {
         $product = new producthelper();
         $result[$i]['title'] = $result[$i]['name'];
         $result[$i]['price'] = $product->getProductFormattedPrice($product->getProductPrice($result[$i]['product_id']));
         $result[$i]['addtocart'] = $result[$i]['url'] = 'index.php?option=com_redshop&view=product&pid=' . $result[$i]['product_id'] . '&cid=' . $result[$i]['category_id'];
         $result[$i]['addtocart_label'] = 'View product';
         $result[$i]['category_url'] = 'index.php?option=com_redshop&view=category&cid=' . $result[$i]['category_id'] . '&layout=detail';
         $result[$i]['thumbnail'] = $result[$i]['image_thumbnail'] = $uri . REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $result[$i]['image_thumbnail'];
         $result[$i]['image'] = $uri . REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $result[$i]['image'];
     }
     return $result;
 }
开发者ID:pguilford,项目名称:vcomcc,代码行数:51,代码来源:generator.php

示例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>&nbsp;";
        echo $addtocartdata = $producthelper->replaceCartTemplate($row->product_id);
        echo "<div>" . $addtocartdata . "</div>";
    }
}
开发者ID:,项目名称:,代码行数:39,代码来源:

示例3: getProductDetail

 private static function getProductDetail($id)
 {
     $component = JComponentHelper::getComponent("com_redshop");
     if (!isset($component->id)) {
         JError::raiseError('500', 'redShop Component is not installed');
     }
     if (!defined('TABLE_PREFIX')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/redshop.cfg.php';
     }
     require_once JPATH_SITE . '/components/com_redshop/helpers/helper.php';
     $objhelper = new redhelper();
     $producthelper = new producthelper();
     $ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $id);
     if (count($ItemData) > 0) {
         $pItemid = $ItemData->id;
     } else {
         $pItemid = $objhelper->getItemid($id);
     }
     $link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $id . '&Itemid=' . $pItemid);
     $product = $producthelper->getProductById($id);
     $product->product_price = $producthelper->getProductPrice($id);
     $product->link = $link;
     return $product;
 }
开发者ID:,项目名称:,代码行数:24,代码来源:

示例4: renderLayout


//.........这里部分代码省略.........
                     } else {
                         if ($rs_mode == TRUE && $vm_mode == FALSE && $k2_mode == FALSE) {
                             $ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $this->content['ID'][$i]);
                             $id = $this->content['ID'][$i];
                             $cid = $producthelper->getCategoryProduct($this->content['ID'][$i]);
                             $Itemid = $redhelper->getItemid($this->content['ID'][$i]);
                             $product = $producthelper->getProductById($this->content['ID'][$i]);
                             // GENERATING HEADER
                             if ($this->config['news_header_enabled'] == 1) {
                                 $news_header = $renderer->header_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['title'][$i], $Itemid);
                             }
                             // GENERATING IMAGE
                             if ($this->config['news_image_enabled'] == 1) {
                                 $news_image = $renderer->image_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['product_image'][$i], $this->content['title'][$i], $Itemid);
                             }
                             // GENERATING READMORE
                             if ($this->config['news_readmore_enabled'] == 1) {
                                 $news_readmore = $renderer->readMore_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $Itemid);
                             }
                             // GENERATING TEXT
                             if ($this->config['news_text_enabled'] == 1) {
                                 $news_textt = $renderer->text_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['text'][$i], $news_readmore, $Itemid);
                             }
                             // GENERATE NEWS INFO
                             if ($this->config['news_info_enabled'] == 1) {
                                 $news_infoo = $renderer->info_rs($this->config, $this->content['ID'][$i], $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['manufacturer'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $Itemid, $this->content['manufacturer_id'][$i], 1);
                             }
                             // GENERATE NEWS INFO2
                             if ($this->config['news_info2_enabled'] == 1) {
                                 $news_infoo2 = $renderer->info_rs($this->config, $this->content['ID'][$i], $this->content['cat_name'][$i], $this->content['CID'][$i], $this->content['manufacturer'][$i], $this->config['date_publish'] == TRUE ? $this->content['date_publish'][$i] : $this->content['date'][$i], $Itemid, $this->content['manufacturer_id'][$i], 2);
                             }
                             // COMPUTE PRICE DEPENDS OF USER ID
                             $user =& JFactory::getUser();
                             $price = $producthelper->getProductPrice($this->content['ID'][$i], $this->config['rs_price_with_vat'], $user->id);
                             $price = $producthelper->getProductFormattedPrice($price, true);
                             if ($this->config['rs_add_to_cart'] == 1) {
                                 $addToCart = $producthelper->replaceCartTemplate($this->content['ID'][$i], 0, 0, 0, "", false, array(), 0, 0, 0);
                                 $addToCart = str_replace('&', '&amp;', $addToCart);
                                 if ($this->config['rs_show_default_cart_button'] == 0) {
                                     $btnCode = '<a class=\'nspAddToCart\' onclick="if(displayAddtocartForm(\'addtocart_prd_' . $this->content['ID'][$i];
                                     $btnCode .= '\',\'' . $id . '\',\'0\',\'0\', \'user_fields_form\'))';
                                     $btnCode .= '{checkAddtocartValidation(\'addtocart_prd_' . $id . '\',\'' . $id . '\',\'0\',\'0\', \'user_fields_form\',\'0\',\'0\',\'0\');}"><span style=\'cursor: pointer;\' id=\'pdaddtocartprd' . $id . '\' title=\'\' class=\'\'>' . JText::_('MOD_NEWS_PRO_GK4_ADD_TO_CART') . '</span></a>';
                                     $addToCart = preg_replace('/\\<img.*?\\>/i', $btnCode, $addToCart);
                                 }
                             }
                             // GET THE CURRENCY
                             $bool = preg_match('/[^0-9]/u', $price, $currency);
                             $currency = $currency[0];
                             $bool = preg_match('/[0-9]+/u', $price, $price);
                             $price = $price[0];
                             // GENERATE RedSHOP STORE INFO
                             $news_rs_store = $renderer->store_rs($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $price, $this->content['discount_start'][$i], $this->content['discount_end'][$i], $this->content['tax'][$i], $this->content['discount_price'][$i], $currency, $Itemid, $addToCart);
                         } else {
                             if ($vm_mode == TRUE) {
                                 // GENERATING HEADER
                                 if ($this->config['news_header_enabled'] == 1) {
                                     $news_header = $renderer->header_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['title'][$i]);
                                 }
                                 // GENERATING IMAGE
                                 if ($this->config['news_image_enabled'] == 1) {
                                     $news_image = $renderer->image_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i], $this->content['product_image'][$i], $this->content['title'][$i]);
                                 }
                                 // GENERATING READMORE
                                 if ($this->config['news_readmore_enabled'] == 1) {
                                     $news_readmore = $renderer->readMore_vm($this->config, $this->content['ID'][$i], $this->content['CID'][$i]);
                                 }
开发者ID:shuramita,项目名称:anhquanggffl,代码行数:67,代码来源:helper.php

示例5: foreach

     $tag = '{product_thumb_image}';
     $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;
开发者ID:,项目名称:,代码行数:31,代码来源:


注:本文中的producthelper::getProductPrice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。