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


PHP producthelper::getProductFormattedPrice方法代码示例

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


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

示例1: 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,代码来源:

示例2: 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

示例3: newsletterEntry

 public function newsletterEntry($cid = array(), $userid = array(), $username = array())
 {
     $producthelper = new producthelper();
     $jconfig = new jconfig();
     $db = JFactory::getDbo();
     $newsletter_id = JRequest::getVar('newsletter_id');
     $uri = JURI::getInstance();
     $url = $uri->root();
     $mailfrom = $jconfig->mailfrom;
     $fromname = $jconfig->fromname;
     if (NEWS_MAIL_FROM != "") {
         $mailfrom = NEWS_MAIL_FROM;
     }
     if (NEWS_FROM_NAME != "") {
         $fromname = NEWS_FROM_NAME;
     }
     // Getting newsletter content
     $newsbody = $this->getnewsletter_content($newsletter_id);
     $subject = "";
     $newsletter_body = "";
     $newsletter_template = "";
     if (count($newsbody) > 0) {
         $subject = $newsbody[0]->subject;
         $newsletter_body = $newsbody[0]->body;
         $newsletter_template = $newsbody[0]->template_desc;
     }
     $o = new stdClass();
     $o->text = $newsletter_body;
     JPluginHelper::importPlugin('content');
     $dispatcher = JDispatcher::getInstance();
     $x = array();
     $results = $dispatcher->trigger('onPrepareContent', array(&$o, &$x, 1));
     $newsletter_template2 = $o->text;
     $content = str_replace("{data}", $newsletter_template2, $newsletter_template);
     $product_id_list = $this->getProductIdList();
     for ($i = 0; $i < count($product_id_list); $i++) {
         $product_id = $product_id_list[$i]->product_id;
         if (strstr($content, '{redshop:' . $product_id . '}')) {
             $content = str_replace('{redshop:' . $product_id . '}', "", $content);
         }
         if (strstr($content, '{Newsletter Products:' . $product_id . '}')) {
             $product_id = $product_id_list[$i]->product_id;
             $newsproductbody = $this->getnewsletterproducts_content();
             $np_temp_desc = $newsproductbody[0]->template_desc;
             $thum_image = "";
             if ($product_id_list[$i]->product_full_image) {
                 $thumbUrl = RedShopHelperImages::getImagePath($product_id_list[$i]->product_full_image, '', 'thumb', 'product', PRODUCT_MAIN_IMAGE, PRODUCT_MAIN_IMAGE, USE_IMAGE_SIZE_SWAPPING);
                 $thum_image = "<a id='a_main_image' href='" . REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $product_id_list[$i]->product_full_image . "' title='' rel=\"lightbox[product7]\">";
                 $thum_image .= "<img id='main_image' src='" . $thumbUrl . "'>";
                 $thum_image .= "</a>";
             }
             $np_temp_desc = str_replace("{product_thumb_image}", $thum_image, $np_temp_desc);
             $np_temp_desc = str_replace("{product_price}", $producthelper->getProductFormattedPrice($product_id_list[$i]->product_price), $np_temp_desc);
             $np_temp_desc = str_replace("{product_name}", $product_id_list[$i]->product_name, $np_temp_desc);
             $np_temp_desc = str_replace("{product_desc}", $product_id_list[$i]->product_desc, $np_temp_desc);
             $np_temp_desc = str_replace("{product_s_desc}", $product_id_list[$i]->product_s_desc, $np_temp_desc);
             $content = str_replace("{Newsletter Products:" . $product_id . "}", $np_temp_desc, $content);
         }
     }
     // Replacing the Text library texts
     $texts = new text_library();
     $content = $texts->replace_texts($content);
     // If the template contains the images, then revising the path of the images,
     // So the full URL goes with the mail, so images are visible in the mails.
     $data1 = $data = $content;
     preg_match_all("/\\< *[img][^\\>]*[.]*\\>/i", $data, $matches);
     $imagescurarray = array();
     foreach ($matches[0] as $match) {
         preg_match_all("/(src|height|width)*= *[\"\\']{0,1}([^\"\\'\\ \\>]*)/i", $match, $m);
         $images[] = array_combine($m[1], $m[2]);
         $imagescur = array_combine($m[1], $m[2]);
         $imagescurarray[] = $imagescur['src'];
     }
     $imagescurarray = array_unique($imagescurarray);
     if ($imagescurarray) {
         foreach ($imagescurarray as $change) {
             if (strpos($change, 'http') === false) {
                 $data1 = str_replace($change, $url . $change, $data1);
             }
         }
     }
     $retsubscriberid = array();
     for ($j = 0; $j < count($cid); $j++) {
         $subscriberinfo = $this->subscribersinfo($cid[$j]);
         if (count($subscriberinfo) > 0) {
             $today = time();
             $subscribe_email = trim($subscriberinfo[0]->email);
             $unsub_link = $url . 'index.php?option=com_redshop&view=newsletter&task=unsubscribe&email1=' . $subscribe_email;
             $query = "INSERT INTO `" . $this->_table_prefix . "newsletter_tracker` " . "(`tracker_id`, `newsletter_id`, `subscription_id`, `subscriber_name`, `user_id` , `read`, `date`)  " . "VALUES ('', '" . $newsletter_id . "', '" . $cid[$j] . "', '" . $username[$j] . "', '" . $userid[$j] . "',0, '" . $today . "')";
             $db->setQuery($query);
             $db->query();
             $content = '<img  src="' . $url . 'components/com_redshop/helpers/newsletteropener.php?tracker_id=' . $db->insertid() . '" style="display:none;" />';
             // Replacing the tags with the values
             $content .= str_replace("{username}", $subscriberinfo[0]->username, $data1);
             $content = str_replace("{email}", $subscribe_email, $content);
             $unsubscriberlink = "<a href='" . $unsub_link . "'>" . JText::_('COM_REDSHOP_UNSUBSCRIBE') . "</a>";
             $content = str_replace("{unsubscribe_link}", $unsubscriberlink, $content);
             $message = $content;
             if ($subscribe_email != "") {
                 if (JUtility::sendMail($mailfrom, $fromname, $subscribe_email, $subject, $message, 1)) {
//.........这里部分代码省略.........
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:101,代码来源:newsletter.php

示例4: explode

        $template_edata = explode('{product_loop_end}', $template_sdata[1]);
        if (count($template_edata) > 1) {
            $template_end = $template_edata[1];
            $template_middle = $template_edata[0];
        }
    }
}
$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 {
开发者ID:,项目名称:,代码行数:31,代码来源:

示例5:

					</td>
					<td align="center"><?php 
    echo $row->shopper_group_name;
    ?>
</td>
					<td align="center"><?php 
    echo $row->price_quantity_start;
    ?>
</td>
					<td align="center"><?php 
    echo $row->price_quantity_end;
    ?>
</td>
					<td align="center"
					    width="5%"><?php 
    echo $producthelper->getProductFormattedPrice($row->product_price);
    ?>
</td>
					<td align="center"
					    width="5%"><?php 
    echo $producthelper->getProductFormattedPrice($row->discount_price);
    ?>
</td>
				</tr>
				<?php 
    $k = 1 - $k;
}
?>
			<tfoot>
			<td colspan="8"><?php 
echo $this->pagination->getListFooter();
开发者ID:,项目名称:,代码行数:31,代码来源:

示例6: store


//.........这里部分代码省略.........
                 $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;
                     $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($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('order_attribute_item');
                         $rowattitem->order_att_item_id = 0;
                         $rowattitem->order_item_id = $rowitem->order_item_id;
                         $rowattitem->section_id = $property_id;
                         $rowattitem->section = "property";
                         $rowattitem->parent_section_id = $attribute_id;
                         $rowattitem->section_name = $propArr[$k]['property_name'];
                         $rowattitem->section_price = $propArr[$k]['property_price'];
                         $rowattitem->section_vat = $section_vat;
                         $rowattitem->section_oprand = $propArr[$k]['property_oprand'];
                         $rowattitem->is_accessory_att = 1;
                         if ($property_id > 0) {
                             if (!$rowattitem->store()) {
                                 $this->setError($this->_db->getErrorMsg());
                                 return false;
                             }
                         }
                         for ($l = 0; $l < count($subpropArr); $l++) {
                             $section_vat = 0;
                             if ($subpropArr[$l]['subproperty_price'] > 0) {
                                 $section_vat = $producthelper->getProducttax($rowitem->product_id, $subpropArr[$l]['subproperty_price'], $user_id);
                             }
                             $subproperty_id = $subpropArr[$l]['subproperty_id'];
                             $accessory_attribute .= urldecode($subpropArr[$l]['subproperty_name']) . " (" . $subpropArr[$l]['subproperty_oprand'] . $producthelper->getProductFormattedPrice($subpropArr[$l]['subproperty_price'] + $section_vat) . ")<br/>";
                             $rowattitem =& $this->getTable('order_attribute_item');
                             $rowattitem->order_att_item_id = 0;
                             $rowattitem->order_item_id = $rowitem->order_item_id;
                             $rowattitem->section_id = $subproperty_id;
                             $rowattitem->section = "subproperty";
                             $rowattitem->parent_section_id = $property_id;
                             $rowattitem->section_name = $subpropArr[$l]['subproperty_name'];
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:67,代码来源:addorder_detail.php

示例7: replaceSubPropertyData

 public function replaceSubPropertyData($product_id = 0, $accessory_id = 0, $attribute_id = 0, $property_id = 0, $user_id, $uniqueid = "")
 {
     $producthelper = new producthelper();
     $subproperty = array();
     if ($property_id != 0 && $attribute_id != 0) {
         $attributes = $producthelper->getProductAttribute(0, 0, $attribute_id);
         $attributes = $attributes[0];
         $subproperty = $producthelper->getAttibuteSubProperty(0, $property_id);
     }
     if ($accessory_id != 0) {
         $prefix = $uniqueid . "acc_";
     } else {
         $prefix = $uniqueid . "prd_";
     }
     $attributelist = "";
     if (count($subproperty) > 0) {
         $commonid = $prefix . $product_id . '_' . $accessory_id . '_' . $attribute_id . '_' . $property_id;
         $subpropertyid = 'subproperty_id_' . $commonid;
         for ($i = 0; $i < count($subproperty); $i++) {
             $attributes_subproperty_vat = 0;
             if ($subproperty[$i]->subattribute_color_price > 0) {
                 $attributes_subproperty_vat = $producthelper->getProducttax($product_id, $subproperty[$i]->subattribute_color_price);
                 $subproperty[$i]->subattribute_color_price += $attributes_subproperty_vat;
                 $subproperty[$i]->text = urldecode($subproperty[$i]->subattribute_color_name) . " (" . $subproperty[$i]->oprand . $producthelper->getProductFormattedPrice($subproperty[$i]->subattribute_color_price) . ")";
             } else {
                 $subproperty[$i]->text = urldecode($subproperty[$i]->subattribute_color_name);
             }
             $attributelist .= '<input type="hidden" id="' . $subpropertyid . '_oprand' . $subproperty[$i]->value . '" value="' . $subproperty[$i]->oprand . '" />';
             $attributelist .= '<input type="hidden" id="' . $subpropertyid . '_protax' . $subproperty[$i]->value . '" value="' . $attributes_subproperty_vat . '" />';
             $attributelist .= '<input type="hidden" id="' . $subpropertyid . '_proprice' . $subproperty[$i]->value . '" value="' . $subproperty[$i]->subattribute_color_price . '" />';
         }
         $tmp_array = array();
         $tmp_array[0]->value = 0;
         $tmp_array[0]->text = JText::_('COM_REDSHOP_SELECT') . "&nbsp;" . urldecode($subproperty[0]->property_name);
         $new_subproperty = array_merge($tmp_array, $subproperty);
         $chklist = "";
         if ($attributes->allow_multiple_selection) {
             for ($chk = 0; $chk < count($subproperty); $chk++) {
                 $chklist .= "<br /><input type='checkbox' value='" . $subproperty[$chk]->value . "' name='" . $subpropertyid . "[]'  id='" . $subpropertyid . "' class='inputbox' onchange='javascript:calculateOfflineTotalPrice(\"" . $uniqueid . "\");' />&nbsp;" . $subproperty[$chk]->text;
             }
         } else {
             $chklist = JHTML::_('select.genericlist', $new_subproperty, $subpropertyid . '[]', ' id="' . $subpropertyid . '" class="inputbox" size="1" onchange="javascript:calculateOfflineTotalPrice(\'' . $uniqueid . '\');" ', 'value', 'text', '');
         }
         $lists['subproperty_id'] = $chklist;
         $attributelist .= "<tr><td>" . urldecode($subproperty[0]->property_name) . " : " . $lists['subproperty_id'];
     }
     return $attributelist;
 }
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:48,代码来源:addquotation_detail.php

示例8: sprintf

		</form>';
$cart_data = str_replace("{empty_cart}", $empty_cart, $cart_data);
$discount = $producthelper->getDiscountId(0);
if (count($discount) > 0) {
    $text = '';
    if ($discount->discount_type == 0) {
        $discount_amount = $discount->discount_amount;
        $discount_sign = " " . REDCURRENCY_SYMBOL;
    } else {
        $discount_amount = $discount->amount * $discount->discount_amount / 100;
        $discount_sign = " %";
    }
    $diff = $discount->amount - $cart['product_subtotal'];
    $price = number_format($discount->discount_amount, PRICE_DECIMAL, PRICE_SEPERATOR, THOUSAND_SEPERATOR);
    if ($diff > 0) {
        $text = sprintf(JText::_('COM_REDSHOP_DISCOUNT_TEXT'), $producthelper->getProductFormattedPrice($diff, true), $producthelper->getProductFormattedPrice($discount_amount, true), $price . $discount_sign);
    }
    /*
     *  Discount type =  1 // Discount/coupon/voucher
     *  Discount type =  2 // Discount + coupon/voucher
     *  Discount type =  3 // Discount + coupon + voucher
     *  Discount type =  4 // Discount + coupons + voucher
     */
    if (DISCOUNT_TYPE && DISCOUNT_ENABLE == 1) {
        $cart_data = str_replace("{discount_rule}", $text, $cart_data);
    } else {
        $cart_data = str_replace("{discount_rule}", '', $cart_data);
    }
} else {
    $cart_data = str_replace("{discount_rule}", '', $cart_data);
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例9: oneStepCheckoutProcess

 /**
  * One Step checkout process
  *
  * @return void
  */
 public function oneStepCheckoutProcess()
 {
     $producthelper = new producthelper();
     $redTemplate = new Redtemplate();
     $carthelper = new rsCarthelper();
     $order_functions = new order_functions();
     $model = $this->getModel('checkout');
     $post = JRequest::get('post');
     $user = JFactory::getUser();
     $session = JFactory::getSession();
     $cart = $session->get('cart');
     $users_info_id = $post['users_info_id'];
     $shipping_box_id = $post['shipping_box_id'];
     $shipping_rate_id = $post['shipping_rate_id'];
     $customer_note = $post['customer_note'];
     $req_number = $post['requisition_number'];
     $customer_message = $post['rs_customer_message_ta'];
     $referral_code = $post['txt_referral_code'];
     $payment_method_id = $post['payment_method_id'];
     $order_total = $cart['total'];
     $total_discount = $cart['cart_discount'] + $cart['voucher_discount'] + $cart['coupon_discount'];
     $order_subtotal = SHIPPING_AFTER == 'total' ? $cart['product_subtotal'] - $total_discount : $cart['product_subtotal_excl_vat'];
     $Itemid = $post['Itemid'];
     $objectname = $post['objectname'];
     $rate_template_id = $post['rate_template_id'];
     $cart_template_id = $post['cart_template_id'];
     $onestep_template_desc = "";
     $rate_template_desc = "";
     if ($objectname == "users_info_id" || $objectname == "shipping_box_id") {
         if ($users_info_id > 0) {
             $shipping_template = $redTemplate->getTemplate("redshop_shipping", $rate_template_id);
             if (count($shipping_template) > 0) {
                 $rate_template_desc = $shipping_template[0]->template_desc;
             }
             $returnarr = $carthelper->replaceShippingTemplate($rate_template_desc, $shipping_rate_id, $shipping_box_id, $user->id, $users_info_id, $order_total, $order_subtotal);
             $rate_template_desc = $returnarr['template_desc'];
             $shipping_rate_id = $returnarr['shipping_rate_id'];
         } else {
             $rate_template_desc = JText::_('COM_REDSHOP_FILL_SHIPPING_ADDRESS');
         }
     }
     if ($shipping_rate_id != "") {
         $shipArr = $model->calculateShipping($shipping_rate_id);
         $cart['shipping'] = $shipArr['order_shipping_rate'];
         $cart['shipping_vat'] = $shipArr['shipping_vat'];
         $cart = $carthelper->modifyDiscount($cart);
     }
     if ($cart_template_id != 0) {
         $templatelist = $redTemplate->getTemplate("checkout", $cart_template_id);
         $onestep_template_desc = $templatelist[0]->template_desc;
         $onestep_template_desc = $model->displayShoppingCart($onestep_template_desc, $users_info_id, $shipping_rate_id, $payment_method_id, $Itemid, $customer_note, $req_number, '', $customer_message, $referral_code);
     }
     $display_shippingrate = '<div id="onestepshiprate">' . $rate_template_desc . '</div>';
     $display_cart = '<div id="onestepdisplaycart">' . $onestep_template_desc . '</div>';
     $description = $display_shippingrate . $display_cart;
     $lang = JFactory::getLanguage();
     $Locale = $lang->getLocale();
     if (in_array('ru', $Locale)) {
         // Commented because redshop currency symbole has been changed because of ajax response
         $description = html_entity_decode($description, ENT_QUOTES, 'KOI8-R');
     }
     $cart_total = $producthelper->getProductFormattedPrice($cart['mod_cart_total']);
     echo "`_`" . $description . "`_`" . $cart_total;
     die;
 }
开发者ID:,项目名称:,代码行数:70,代码来源:

示例10: neworderitem


//.........这里部分代码省略.........
                 $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;
                     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($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('order_attribute_item');
                         $rowattitem->order_att_item_id = 0;
                         $rowattitem->order_item_id = $orderitemdata->order_item_id;
                         $rowattitem->section_id = $property_id;
                         $rowattitem->section = "property";
                         $rowattitem->parent_section_id = $attribute_id;
                         $rowattitem->section_name = $propArr[$k]['property_name'];
                         $rowattitem->section_price = $propArr[$k]['property_price'];
                         $rowattitem->section_vat = $section_vat;
                         $rowattitem->section_oprand = $propArr[$k]['property_oprand'];
                         $rowattitem->is_accessory_att = 1;
                         if ($property_id > 0) {
                             if (!$rowattitem->store()) {
                                 $this->setError($this->_db->getErrorMsg());
                                 return false;
                             }
                         }
                         for ($l = 0; $l < count($subpropArr); $l++) {
                             $section_vat = 0;
                             if ($subpropArr[$l]['subproperty_price'] > 0) {
                                 $section_vat = $producthelper->getProducttax($rowitem->product_id, $subpropArr[$l]['subproperty_price'], $user_id);
                             }
                             $subproperty_id = $subpropArr[$l]['subproperty_id'];
                             $accessory_attribute .= urldecode($subpropArr[$l]['subproperty_name']) . " (" . $subpropArr[$l]['subproperty_oprand'] . $producthelper->getProductFormattedPrice($subpropArr[$l]['subproperty_price'] + $section_vat) . ")<br/>";
                             $rowattitem =& $this->getTable('order_attribute_item');
                             $rowattitem->order_att_item_id = 0;
                             $rowattitem->order_item_id = $orderitemdata->order_item_id;
                             $rowattitem->section_id = $subproperty_id;
                             $rowattitem->section = "subproperty";
                             $rowattitem->parent_section_id = $property_id;
                             $rowattitem->section_name = $subpropArr[$l]['subproperty_name'];
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:67,代码来源:order_detail.php

示例11: strtolower

    $template_desc = str_replace('{bulkorder_link}', $bulkorder_link, $template_desc);
} else {
    $template_desc = str_replace('{bulkorder_image}', "", $template_desc);
    $template_desc = str_replace('{bulkorder_title}', "", $template_desc);
    $template_desc = str_replace('{bulkorder_link}', "", $template_desc);
}
$is_company = $this->userdata->is_company;
if ($is_company == 1) {
    $extrafields = $extra_field->list_all_field_display(8, $this->userdata->users_info_id);
} else {
    $extrafields = $extra_field->list_all_field_display(7, $this->userdata->users_info_id);
}
$template_desc = str_replace('{customer_custom_fields}', $extrafields, $template_desc);
if (strstr($template_desc, "{reserve_discount}")) {
    $reserve_discount = $model->getReserveDiscount();
    $reserve_discount = $producthelper->getProductFormattedPrice($reserve_discount);
    $template_desc = str_replace('{reserve_discount}', $reserve_discount, $template_desc);
    $template_desc = str_replace('{reserve_discount_lbl}', JText::_('COM_REDSHOP_RESERVED_DISCOUNT_LBL'), $template_desc);
}
if (strstr($template_desc, "{order_loop_start}") && strstr($template_desc, "{order_loop_end}")) {
    $oder_image = '<img src="' . REDSHOP_ADMIN_IMAGES_ABSPATH . 'order16.png" align="absmiddle">';
    $template_desc = str_replace('{order_image}', $oder_image, $template_desc);
    $template_desc = str_replace('{order_title}', JText::_('COM_REDSHOP_ORDER_INFORMATION'), $template_desc);
    $orderslist = $order_functions->getUserOrderDetails($user->id);
    // More Order information
    if (count($orderslist) > 0) {
        $ordermoreurl_1 = JRoute::_('index.php?option=com_redshop&view=orders&Itemid=' . $Itemid);
        $ordermoreurl = strtolower($ordermoreurl_1);
        $template_desc = str_replace('{more_orders}', "<a href='" . $ordermoreurl . "'>" . JText::_('COM_REDSHOP_MORE') . "</a>", $template_desc);
    } else {
        $template_desc = str_replace('{more_orders}', "", $template_desc);
开发者ID:,项目名称:,代码行数:31,代码来源:

示例12: array

 $template_end = $template_edata[1];
 $template_middle = $template_edata[0];
 $cart_mdata = "";
 for ($i = 0; $i < count($this->detail); $i++) {
     $prolist = $order_function->getOrderItemDetail($this->detail[$i]->order_id);
     $statusname = $order_function->getOrderStatusTitle($this->detail[$i]->order_status);
     $order_item_name = array();
     for ($j = 0; $j < count($prolist); $j++) {
         $order_item_name[$j] = $prolist[$j]->order_item_name;
     }
     $orderdetailurl = JRoute::_('index.php?option=com_redshop&view=order_detail&oid=' . $this->detail[$i]->order_id);
     $reorderurl = JUri::root() . 'index.php?option=com_redshop&view=order_detail&order_id=' . $this->detail[$i]->order_id . '&task=reorder&tmpl=component';
     $order_number = "<div class='order_number'>" . $this->detail[$i]->order_number . "</div>";
     $order_id = "<div class='order_id'>" . $this->detail[$i]->order_id . "</div>";
     $order_products = "<div class='order_products'>" . implode(',<br/>', $order_item_name) . "</div>";
     $order_total = "<div class='order_total'>" . $producthelper->getProductFormattedPrice($this->detail[$i]->order_total) . "</div>";
     $order_date = "<div class='order_date'>" . $redconfig->convertDateFormat($this->detail[$i]->cdate) . "</div>";
     $order_status = "<div class='order_status'>" . $statusname . "</div>";
     $order_detail_link = "<div class='order_detail_link'><a href='" . $orderdetailurl . "'>" . JText::_('COM_REDSHOP_ORDER_DETAIL') . "</a></div>";
     $reorder_link = "<div class='reorder_link'><a href='javascript:if(confirm(\"" . JText::_('COM_REDSHOP_CONFIRM_CART_EMPTY') . "\")){window.location=\"" . $reorderurl . "\";}'>" . JText::_('COM_REDSHOP_REORDER') . "</a></div>";
     $cart_mdata .= $template_middle;
     $cart_mdata = str_replace("{order_number}", $order_number, $cart_mdata);
     $cart_mdata = str_replace("{order_id}", $order_id, $cart_mdata);
     $cart_mdata = str_replace("{order_products}", $order_products, $cart_mdata);
     $cart_mdata = str_replace("{order_total}", $order_total, $cart_mdata);
     $cart_mdata = str_replace("{order_date}", $order_date, $cart_mdata);
     $cart_mdata = str_replace("{order_status}", $order_status, $cart_mdata);
     $cart_mdata = str_replace("{order_detail_link}", $order_detail_link, $cart_mdata);
     $cart_mdata = str_replace("{reorder_link}", $reorder_link, $cart_mdata);
 }
 $template_desc = str_replace("{product_loop_start}", "", $template_desc);
开发者ID:,项目名称:,代码行数:31,代码来源:

示例13: switch

					</td>
					<td align="center">
						<?php 
    echo JHTML::_('grid.id', $i, $row->id);
    ?>
					</td>
					<td align="center">
						<a href="<?php 
    echo $link;
    ?>
" title="<?php 
    echo JText::_('COM_REDSHOP_EDIT_DISCOUNT');
    ?>
">
							<?php 
    echo $producthelper->getProductFormattedPrice($row->amount);
    //number_format($row->amount,2,PRICE_SEPERATOR,THOUSAND_SEPERATOR).CURRENCY_SYMBOL;
    ?>
</a>
					</td>
					<td align="center">
						<?php 
    switch ($row->condition) {
        case '1':
            echo JText::_('COM_REDSHOP_LOWER');
            break;
        case '2':
            echo JText::_('COM_REDSHOP_EQUAL');
            break;
        case '3':
            echo JText::_('COM_REDSHOP_HIGHER');
开发者ID:,项目名称:,代码行数:31,代码来源:

示例14: submitReorder

$search[] = "{discount_type_lbl}";
$replace[] = JText::_('COM_REDSHOP_CART_DISCOUNT_CODE_TBL');
if ($discount_type) {
    $search[] = "{discount_type}";
    $replace[] = $discount_type;
} else {
    $search[] = "{discount_type}";
    $replace[] = JText::_('COM_REDSHOP_NO_DISCOUNT_AVAILABLE');
}
$statustext = $order_functions->getOrderStatusTitle($OrdersDetail->order_status);
$issplit = $OrdersDetail->split_payment;
$split_amount = $OrdersDetail->order_total - $partialpayment;
$split_amounttext = "";
$payremaininglink = "";
if ($issplit && $split_amount > 0) {
    $split_amounttext = "<br /><br />" . JText::_('COM_REDSHOP_RECEIPT_PARTIALLY_PAID_AMOUNT') . ": " . $producthelper->getProductFormattedPrice($split_amount);
    $payremaininglink = "<br />" . JText::_('COM_REDSHOP_REMAINING_AMOUNT_TOBE_PAID_BEFORE_DEL') . ": " . $producthelper->getProductFormattedPrice($split_amount) . "<a href='" . JRoute::_('index.php?option=com_redshop&view=split_payment&oid=' . $oid . '&Itemid=' . $Itemid) . "'>" . JText::_('COM_REDSHOP_PAY_REMAINING') . "</a>";
}
$frm = '';
$reorder = '';
if ($OrdersDetail->order_status != 'C' && $OrdersDetail->order_status != 'S' && $OrdersDetail->order_status != 'PR' && $OrdersDetail->order_status != 'APP' && $print != 1 && $OrdersDetail->order_payment_status != 'Paid') {
    $frm = "<form method='post'>\n\t<input type='hidden' name='order_id' value='{$oid}'>\n\t<input type='hidden' name='option' value='com_redshop'>\n\t<input type='hidden' name='view' value='order_detail'>\n\t<input type='hidden' name='task' value='payment'>\n\t<input type='submit' name='payment' value='" . JText::_("COM_REDSHOP_PAY") . "'>\n\t</form>";
} else {
    $reorder = "<form method='post' name='frmreorder' id='frmreorder'>";
    $reorder .= "<input type='submit' name='reorder' id='reorder' value='" . JText::_('COM_REDSHOP_REORDER') . "' onclick='return submitReorder();' />";
    $reorder .= "<input type='hidden' name='order_id' value='" . $oid . "'>";
    $reorder .= "<input type='hidden' name='option' value='com_redshop'>";
    $reorder .= "<input type='hidden' name='view' value='order_detail'>";
    $reorder .= "<input type='hidden' name='task' value='reorder'></form>";
}
$search[] = "{order_status}";
开发者ID:,项目名称:,代码行数:31,代码来源:

示例15: replaceShippingMethod

 public function replaceShippingMethod($d = array(), $shipp_users_info_id = 0, $shipping_rate_id = 0, $shipping_box_post_id = 0)
 {
     $producthelper = new producthelper();
     $order_functions = new order_functions();
     if ($shipp_users_info_id > 0) {
         $shippingmethod = $order_functions->getShippingMethodInfo();
         JPluginHelper::importPlugin('redshop_shipping');
         $dispatcher = JDispatcher::getInstance();
         $shippingrate = $dispatcher->trigger('onListRates', array(&$d));
         $ratearr = array();
         $r = 0;
         for ($s = 0; $s < count($shippingmethod); $s++) {
             if (isset($shippingrate[$s]) === false) {
                 continue;
             }
             $rate = $shippingrate[$s];
             if (count($rate) > 0) {
                 $rs = $shippingmethod[$s];
                 for ($i = 0; $i < count($rate); $i++) {
                     $displayrate = $rate[$i]->rate > 0 ? " (" . $producthelper->getProductFormattedPrice($rate[$i]->rate) . " )" : "";
                     $ratearr[$r] = new stdClass();
                     $ratearr[$r]->text = $rs->name . " - " . $rate[$i]->text . $displayrate;
                     $ratearr[$r]->value = $rate[$i]->value;
                     $r++;
                 }
             }
         }
         if (count($ratearr) > 0) {
             if (!$shipping_rate_id) {
                 $shipping_rate_id = $ratearr[0]->value;
             }
             $displayrespoce = JHTML::_('select.genericlist', $ratearr, 'shipping_rate_id', 'class="inputbox" onchange="calculateOfflineShipping();" ', 'value', 'text', $shipping_rate_id);
         } else {
             $displayrespoce = JText::_('COM_REDSHOP_NO_SHIPPING_METHODS_TO_DISPLAY');
         }
     } else {
         $displayrespoce = '<div class="shipnotice">' . JText::_('COM_REDSHOP_FILL_SHIPPING_ADDRESS') . '</div>';
     }
     return $displayrespoce;
 }
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:40,代码来源:product.php


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