本文整理汇总了PHP中producthelper类的典型用法代码示例。如果您正苦于以下问题:PHP producthelper类的具体用法?PHP producthelper怎么用?PHP producthelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了producthelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: check
/**
* Check for the product ID
*/
public function check()
{
$producthelper = new producthelper();
$unit = $producthelper->getUnitConversation("m", $discount_calc_unit[$c]);
$converted_area_start = $this->area_start * $unit * $unit;
$converted_area_end = $this->area_end * $unit * $unit;
$query = "SELECT *\n\t\t\t\t\tFROM `" . $this->_table_prefix . "product_discount_calc`\n\t\t\t\t\tWHERE product_id = " . (int) $this->product_id . " AND (" . (int) $converted_area_start . "\n\t\t\t\t\tBETWEEN `area_start_converted`\n\t\t\t\t\tAND `area_end_converted` || " . (int) $converted_area_end . "\n\t\t\t\t\tBETWEEN `area_start_converted`\n\t\t\t\t\tAND `area_end_converted` )";
$this->_db->setQuery($query);
$xid = intval($this->_db->loadResult());
if ($xid) {
$this->_error = JText::_('COM_REDSHOP_SAME_RANGE');
return false;
}
return true;
}
示例3: display
function display($tpl = null)
{
$app = JFactory::getApplication();
$producthelper = new producthelper();
$pathway = $app->getPathway();
$document = JFactory::getDocument();
$user = JFactory::getUser();
// Preform security checks
if ($user->id == 0) {
echo JText::_('COM_REDSHOP_ALERTNOTAUTH_REVIEW');
return;
}
$model = $this->getModel('product_rating');
$userinfo = $model->getuserfullname($user->id);
$params = $app->getParams('com_redshop');
$Itemid = JRequest::getInt('Itemid');
$product_id = JRequest::getInt('product_id');
$category_id = JRequest::getInt('category_id');
$user = JFactory::getUser();
$model = $this->getModel('product_rating');
$rate = JRequest::getInt('rate');
$already_rated = $model->checkRatedProduct($product_id, $user->id);
if ($already_rated == 1) {
if ($rate == 1) {
$msg = JText::_('COM_REDSHOP_YOU_CAN_NOT_REVIEW_SAME_PRODUCT_AGAIN');
$link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $product_id . '&cid=' . $category_id . '&Itemid=' . $Itemid);
$app->redirect($link, $msg);
} else {
echo JText::_('COM_REDSHOP_YOU_CAN_NOT_REVIEW_SAME_PRODUCT_AGAIN');
?>
<span id="closewindow"><input type="button" value="Close Window" onclick="window.parent.redBOX.close();"/></span>
<script>
setTimeout("window.parent.redBOX.close();", 2000);
</script>
<?php
return;
}
}
$productinfo = $producthelper->getProductById($product_id);
$this->user = $user;
$this->userinfo = $userinfo;
$this->product_id = $product_id;
$this->rate = $rate;
$this->category_id = $category_id;
$this->productinfo = $productinfo;
$this->params = $params;
parent::display($tpl);
}
示例4: sendMailForReview
public function sendMailForReview($data)
{
$this->store($data);
$producthelper = new producthelper();
$redshopMail = new redshopMail();
$user = JFactory::getUser();
$url = JURI::base();
$option = JRequest::getVar('option');
$Itemid = JRequest::getVar('Itemid');
$mailbcc = null;
$fromname = $data['username'];
$from = $user->email;
$subject = "";
$message = $data['title'];
$comment = $data['comment'];
$username = $data['username'];
$product_id = $data['product_id'];
$mailbody = $redshopMail->getMailtemplate(0, "review_mail");
$data_add = $message;
if (count($mailbody) > 0) {
$data_add = $mailbody[0]->mail_body;
$subject = $mailbody[0]->mail_subject;
if (trim($mailbody[0]->mail_bcc) != "") {
$mailbcc = explode(",", $mailbody[0]->mail_bcc);
}
}
$product = $producthelper->getProductById($product_id);
$link = JRoute::_($url . "index.php?option=" . $option . "&view=product&pid=" . $product_id . '&Itemid=' . $Itemid);
$product_url = "<a href=" . $link . ">" . $product->product_name . "</a>";
$data_add = str_replace("{product_link}", $product_url, $data_add);
$data_add = str_replace("{product_name}", $product->product_name, $data_add);
$data_add = str_replace("{title}", $message, $data_add);
$data_add = str_replace("{comment}", $comment, $data_add);
$data_add = str_replace("{username}", $username, $data_add);
if (ADMINISTRATOR_EMAIL != "") {
$sendto = explode(",", ADMINISTRATOR_EMAIL);
if (JFactory::getMailer()->sendMail($from, $fromname, $sendto, $subject, $data_add, $mode = 1, null, $mailbcc)) {
return true;
} else {
return false;
}
}
}
示例5: sendProductMailToFriend
public function sendProductMailToFriend($your_name, $friend_name, $product_id, $email)
{
$producthelper = new producthelper();
$redshopMail = new redshopMail();
$url = JURI::base();
$option = JRequest::getVar('option');
$mailinfo = $redshopMail->getMailtemplate(0, "product");
$data_add = "";
$subject = "";
$mailbcc = null;
if (count($mailinfo) > 0) {
$data_add = $mailinfo[0]->mail_body;
$subject = $mailinfo[0]->mail_subject;
if (trim($mailinfo[0]->mail_bcc) != "") {
$mailbcc = explode(",", $mailinfo[0]->mail_bcc);
}
} else {
$data_add = "<p>Hi {friend_name} ,</p>\r\n<p>New Product : {product_name}</p>\r\n<p>{product_desc} Please check this link : {product_url}</p>\r\n<p> </p>\r\n<p> </p>";
$subject = "Send to friend";
}
$data_add = str_replace("{friend_name}", $friend_name, $data_add);
$data_add = str_replace("{your_name}", $your_name, $data_add);
$product = $producthelper->getProductById($product_id);
$data_add = str_replace("{product_name}", $product->product_name, $data_add);
$data_add = str_replace("{product_desc}", $product->product_desc, $data_add);
$rlink = JRoute::_($url . "index.php?option=" . $option . "&view=product&pid=" . $product_id);
$product_url = "<a href=" . $rlink . ">" . $rlink . "</a>";
$data_add = str_replace("{product_url}", $product_url, $data_add);
$config = JFactory::getConfig();
$from = $config->getValue('mailfrom');
$fromname = $config->getValue('fromname');
$subject = str_replace("{product_name}", $product->product_name, $subject);
$subject = str_replace("{shopname}", SHOP_NAME, $subject);
if ($email != "") {
if (JFactory::getMailer()->sendMail($from, $fromname, $email, $subject, $data_add, 1, null, $mailbcc)) {
echo "<div class='' align='center'>" . JText::_('COM_REDSHOP_EMAIL_HAS_BEEN_SENT_SUCCESSFULLY') . "</div>";
} else {
echo "<div class='' align='center'>" . JText::_('COM_REDSHOP_EMAIL_HAS_NOT_BEEN_SENT_SUCCESSFULLY') . "</div>";
}
}
exit;
}
示例6: display
public function display($tpl = null)
{
$producthelper = new producthelper();
$option = JRequest::getVar('option');
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_REDSHOP_ANSWER'));
$uri = JFactory::getURI();
$lists = array();
$model = $this->getModel();
$detail = $this->get('data');
$qdetail = $producthelper->getQuestionAnswer($detail->parent_id);
if (count($qdetail) > 0) {
$qdetail = $qdetail[0];
}
$isNew = $detail->question_id < 1;
$text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
JToolBarHelper::title(JText::_('COM_REDSHOP_ANSWER_DETAIL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_question48');
JToolBarHelper::save();
JToolBarHelper::custom('send', 'send.png', 'send.png', JText::_('COM_REDSHOP_SEND'), false);
if ($isNew) {
JToolBarHelper::cancel();
} else {
JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
}
$option = $model->getProduct();
$optionsection = array();
$optionsection[0]->product_id = 0;
$optionsection[0]->product_name = JText::_('COM_REDSHOP_SELECT');
if (count($option) > 0) {
$optionsection = @array_merge($optionsection, $option);
}
$lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published);
$lists['product_id'] = JHTML::_('select.genericlist', $optionsection, 'product_id', 'class="inputbox" size="1" ', 'product_id', 'product_name', $detail->product_id);
$this->assignRef('lists', $lists);
$this->assignRef('detail', $detail);
$this->assignRef('qdetail', $qdetail);
$this->assignRef('request_url', $uri->toString());
parent::display($tpl);
}
示例7: sendMailForAskQuestion
public function sendMailForAskQuestion($data)
{
$this->store($data);
$producthelper = new producthelper();
$redshopMail = new redshopMail();
$url = JURI::base();
$option = JRequest::getVar('option');
$Itemid = JRequest::getVar('Itemid');
$mailbcc = null;
$fromname = $data['your_name'];
$from = $data['your_email'];
$subject = "";
$message = $data['your_question'];
$product_id = $data['pid'];
$mailbody = $redshopMail->getMailtemplate(0, "ask_question_mail");
$data_add = $message;
if (count($mailbody) > 0) {
$data_add = $mailbody[0]->mail_body;
$subject = $mailbody[0]->mail_subject;
if (trim($mailbody[0]->mail_bcc) != "") {
$mailbcc = explode(",", $mailbody[0]->mail_bcc);
}
}
$product = $producthelper->getProductById($product_id);
$data_add = str_replace("{product_name}", $product->product_name, $data_add);
$data_add = str_replace("{product_desc}", $product->product_desc, $data_add);
// Init required properties
$data['address'] = isset($data['address']) ? $data['address'] : null;
$data['telephone'] = isset($data['telephone']) ? $data['telephone'] : null;
$link = JRoute::_($url . "index.php?option=" . $option . "&view=product&pid=" . $product_id . '&Itemid=' . $Itemid);
$product_url = "<a href=" . $link . ">" . $product->product_name . "</a>";
$data_add = str_replace("{product_link}", $product_url, $data_add);
$data_add = str_replace("{user_question}", $message, $data_add);
$data_add = str_replace("{answer}", "", $data_add);
$subject = str_replace("{user_question}", $message, $subject);
$subject = str_replace("{shopname}", SHOP_NAME, $subject);
$data_add = str_replace("{user_address}", $data['address'], $data_add);
$data_add = str_replace("{user_telephone}", $data['telephone'], $data_add);
$data_add = str_replace("{user_telephone_lbl}", JText::_('COM_REDSHOP_USER_PHONE_LBL'), $data_add);
$data_add = str_replace("{user_address_lbl}", JText::_('COM_REDSHOP_USER_ADDRESS_LBL'), $data_add);
if (ADMINISTRATOR_EMAIL != "") {
$sendto = explode(",", ADMINISTRATOR_EMAIL);
if (JFactory::getMailer()->sendMail($from, $fromname, $sendto, $subject, $data_add, $mode = 1, null, $mailbcc)) {
return true;
} else {
return false;
}
}
}
示例8: 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;
}
示例9: 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>";
}
}
示例10: defined
* @subpackage Template
*
* @copyright Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die;
require_once JPATH_ROOT . '/administrator/components/com_redshop/helpers/images.php';
JHTML::_('behavior.tooltip');
$editor = JFactory::getEditor();
JHTMLBehavior::modal();
$uri = JURI::getInstance();
$url = $uri->root();
JHTML::_('behavior.calendar');
jimport('joomla.html.pane');
$objhelper = new redhelper();
$producthelper = new producthelper();
?>
<script language="javascript" type="text/javascript">
Joomla.submitbutton = function (pressbutton) {
submitbutton(pressbutton);
}
submitbutton = function (pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform(pressbutton);
return;
}
if (form.category_name.value == "") {
alert("<?php
echo JText::_('COM_REDSHOP_CATEGORY_ITEM_MUST_HAVE_A_NAME', true);
示例11: onRSProductSearch
/**
* Generate product search output
*/
public function onRSProductSearch()
{
if (count($this->search) > 0) {
$app = JFactory::getApplication();
require_once JPATH_COMPONENT . '/helpers/product.php';
require_once JPATH_COMPONENT . '/helpers/pagination.php';
require_once JPATH_COMPONENT . '/helpers/extra_field.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/text_library.php';
$dispatcher = JDispatcher::getInstance();
$redTemplate = new Redtemplate();
$Redconfiguration = new Redconfiguration();
$producthelper = new producthelper();
$extraField = new extraField();
$texts = new text_library();
$stockroomhelper = new rsstockroomhelper();
$Itemid = JRequest::getInt('Itemid');
$search_type = JRequest::getCmd('search_type');
$cid = JRequest::getInt('category_id');
$manisrch = $this->search;
$manufacture_id = $manisrch[0]->manufacturer_id;
$templateid = JRequest::getInt('templateid');
// Cmd removes space between to words
$keyword = JRequest::getWord('keyword');
$layout = JRequest::getCmd('layout', 'default');
$db = JFactory::getDbo();
$query = 'SELECT category_name' . ' FROM #__redshop_category ' . 'WHERE category_id=' . JRequest::getInt('cid');
$db->setQuery($query);
$cat_name = null;
if ($catname_array = $db->loadObjectList()) {
$cat_name = $catname_array[0]->category_name;
}
$session = JFactory::getSession();
$model = $this->getModel('search');
$limit = $this->limit;
$limitstart = JRequest::getInt('limitstart', 0);
$total = $model->_total;
JHTML::_('behavior.tooltip');
JHTMLBehavior::modal();
$url = JURI::base();
if ($this->params->get('page_title') != "") {
$pagetitle = $this->params->get('page_title');
} else {
$pagetitle = JText::_('COM_REDSHOP_SEARCH');
}
if ($this->params->get('show_page_heading', 1)) {
echo '<h1 class="componentheading' . $this->escape($this->params->get('pageclass_sfx')) . '">';
echo $pagetitle;
echo '</h1>';
}
echo '<div style="clear:both"></div>';
$category_tmpl = "";
if (count($this->templatedata) > 0 && $this->templatedata[0]->template_desc != "") {
$template_desc = $this->templatedata[0]->template_desc;
} else {
$template_desc = "<div class=\"category_print\">{print}</div>\r\n<div style=\"clear: both;\"></div>\r\n<div class=\"category_main_description\">{category_main_description}</div>\r\n<p>{if subcats} {category_loop_start}</p>\r\n<div id=\"categories\">\r\n<div style=\"float: left; width: 200px;\">\r\n<div class=\"category_image\">{category_thumb_image}</div>\r\n<div class=\"category_description\">\r\n<h2 class=\"category_title\">{category_name}</h2>\r\n{category_description}</div>\r\n</div>\r\n</div>\r\n<p>{category_loop_end} {subcats end if}</p>\r\n<div style=\"clear: both;\"></div>\r\n<div id=\"category_header\">\r\n<div class=\"category_order_by\">{order_by}</div>\r\n</div>\r\n<div class=\"category_box_wrapper\">{product_loop_start}\r\n<div class=\"category_box_outside\">\r\n<div class=\"category_box_inside\">\r\n<div class=\"category_product_image\">{product_thumb_image}</div>\r\n<div class=\"category_product_title\">\r\n<h3>{product_name}</h3>\r\n</div>\r\n<div class=\"category_product_price\">{product_price}</div>\r\n<div class=\"category_product_readmore\">{read_more}</div>\r\n<div>{product_rating_summary}</div>\r\n<div class=\"category_product_addtocart\">{form_addtocart:add_to_cart1}</div>\r\n</div>\r\n</div>\r\n{product_loop_end}\r\n<div class=\"category_product_bottom\" style=\"clear: both;\"></div>\r\n</div>\r\n<div class=\"category_pagination\">{pagination}</div>";
}
if (strstr($template_desc, "{product_display_limit}")) {
$endlimit = $model->getProductPerPage();
$limit = JRequest::getInt('limit', $endlimit, '', 'int');
}
$template_org = $template_desc;
$template_d1 = explode("{category_loop_start}", $template_org);
if (count($template_d1) > 1) {
$template_d2 = explode("{category_loop_end}", $template_d1[1]);
if (count($template_d2) > 0) {
$category_tmpl = $template_d2[0];
}
}
$template_org = str_replace($category_tmpl, "", $template_org);
$template_org = str_replace("{category_loop_start}", "", $template_org);
$template_org = str_replace("{category_loop_end}", "", $template_org);
$print = JRequest::getInt('print');
$p_url = @explode('?', $_SERVER['REQUEST_URI']);
$print_tag = '';
if ($print) {
$print_tag = "<a onclick='window.print();' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' ><img src=" . JSYSTEM_IMAGES_PATH . "printButton.png alt='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' /></a>";
} else {
$print_url = $url . "index.php?option=com_redshop&view=search&print=1&tmpl=component";
$print_tag = "<a href='#' onclick='window.open(\"{$print_url}\",\"mywindow\",\"scrollbars=1\",\"location=1\")' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' ><img src=" . JSYSTEM_IMAGES_PATH . "printButton.png alt='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' /></a>";
}
$template_org = str_replace("{total_product}", count($this->search), $template_org);
$template_org = str_replace("{total_product_lbl}", JText::_('COM_REDSHOP_TOTAL_PRODUCT'), $template_org);
if (strstr($template_org, "{compare_product_div}")) {
$compare_product_div = "";
if (PRODUCT_COMPARISON_TYPE != "") {
$comparediv = $producthelper->makeCompareProductDiv();
$compareUrl = JRoute::_('index.php?option=com_redshop&view=product&layout=compare&Itemid=' . $Itemid);
$compare_product_div = "<form name='frmCompare' method='post' action='" . $compareUrl . "' >";
$compare_product_div .= "<a href='javascript:compare();' >" . JText::_('COM_REDSHOP_COMPARE') . "</a>";
$compare_product_div .= "<div id='divCompareProduct'>" . $comparediv . "</div>";
$compare_product_div .= "</form>";
}
$template_org = str_replace("{compare_product_div}", $compare_product_div, $template_org);
}
// Skip html if nosubcategory
if (strstr($template_org, "{if subcats}")) {
$template_d1 = explode("{if subcats}", $template_org);
//.........这里部分代码省略.........
示例12: store
public function store($postdata)
{
$redshopMail = new redshopMail();
$order_functions = new order_functions();
$helper = new redhelper();
$producthelper = new producthelper();
$rsCarthelper = new rsCarthelper();
$shippinghelper = new shipping();
$adminproducthelper = new adminproducthelper();
$stockroomhelper = new rsstockroomhelper();
// For barcode generation
$barcode_code = $order_functions->barcode_randon_number(12, 0);
$postdata['barcode'] = $barcode_code;
$row = $this->getTable('order_detail');
if (!$row->bind($postdata)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$row->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
$iscrm = $helper->isredCRM();
if ($iscrm) {
$postdata['order_id'] = $row->order_id;
$postdata['debitor_id'] = $postdata['user_info_id'];
JTable::addIncludePath(REDCRM_ADMIN . '/tables');
$crmorder =& $this->getTable('crm_order');
if (!$crmorder->bind($postdata)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
if (!$crmorder->store()) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Update rma table entry
if (ENABLE_RMA && isset($postdata['rmanotes'])) {
$rmaInfo = $this->getTable('rma_orders');
$rmaInfo->rma_number = $postdata['rma_number'];
$rmaInfo->original_order_id = $postdata['main_order_id'];
$rmaInfo->credit_note_order_id = $row->order_id;
$rmaInfo->rma_note = $postdata['rmanotes'];
$rmaInfo->store();
}
JTable::addIncludePath(REDSHOP_ADMIN . '/tables');
}
$order_shipping = explode("|", $shippinghelper->decryptShipping(str_replace(" ", "+", $row->ship_method_id)));
$rowOrderStatus =& $this->getTable('order_status_log');
$rowOrderStatus->order_id = $row->order_id;
$rowOrderStatus->order_status = $row->order_status;
$rowOrderStatus->date_changed = time();
$rowOrderStatus->customer_note = $row->customer_note;
$rowOrderStatus->store();
$billingaddresses = $order_functions->getBillingAddress($row->user_id);
if (isset($postdata['billisship']) && $postdata['billisship'] == 1) {
$shippingaddresses = $billingaddresses;
} else {
$key = 0;
$shippingaddresses = $order_functions->getShippingAddress($row->user_id);
$shipp_users_info_id = isset($postdata['shipp_users_info_id']) && $postdata['shipp_users_info_id'] != 0 ? $postdata['shipp_users_info_id'] : 0;
if ($shipp_users_info_id != 0) {
for ($o = 0; $o < count($shippingaddresses); $o++) {
if ($shippingaddresses[$o]->users_info_id == $shipp_users_info_id) {
$key = $o;
break;
}
}
}
$shippingaddresses = $shippingaddresses[$key];
}
// ORDER DELIVERY TIME IS REMAINING
$user_id = $row->user_id;
$item = $postdata['order_item'];
for ($i = 0; $i < count($item); $i++) {
$product_id = $item[$i]->product_id;
$quantity = $item[$i]->quantity;
$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];
$accessory_total_price = $retAccArr[1];
$accessory_vat_price = $retAccArr[2];
$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;
}
}
//.........这里部分代码省略.........
示例13: defined
* @subpackage Template
*
* @copyright Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die;
$uri = JURI::getInstance();
$url = JURI::base();
$redconfig = new Redconfiguration();
$extra_field = new extra_field();
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/order.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/shipping.php';
require_once JPATH_COMPONENT . '/helpers/product.php';
require_once JPATH_COMPONENT . '/helpers/helper.php';
require_once JPATH_COMPONENT . '/helpers/cart.php';
$producthelper = new producthelper();
$redhelper = new redhelper();
$order_functions = new order_functions();
$redTemplate = new Redtemplate();
$shippinghelper = new shipping();
$carthelper = new rsCarthelper();
$Itemid = JRequest::getInt('Itemid');
$oid = JRequest::getInt('oid');
$print = JRequest::getInt('print');
$getshm = $uri->getScheme();
$config = JFactory::getConfig();
$force_ssl = $config->getValue('force_ssl');
if ($getshm == 'https' && $force_ssl > 2) {
$uri->setScheme('http');
}
?>
示例14: _buildQuery
public function _buildQuery($manudata = 0)
{
$app = JFactory::getApplication();
$context = 'search';
$db = JFactory::getDbo();
$keyword = $app->getUserStateFromRequest($context . 'keyword', 'keyword', '');
$defaultSearchType = '';
if (!empty($manudata['search_type'])) {
$defaultSearchType = $manudata['search_type'];
$defaultSearchType_tmp = $manudata['search_type'];
}
if ($defaultSearchType == "") {
$defaultSearchType = 'product_name';
}
if ($defaultSearchType == "name_number") {
$defaultSearchField = "name_number";
$defaultSearchType = '(p.product_name LIKE ' . $db->quote('%' . $keyword . '%') . ' OR p.product_number LIKE ' . $db->quote('%' . $keyword . '%') . ')';
} elseif ($defaultSearchType == "name_desc") {
$defaultSearchField = "name_desc";
$defaultSearchType = '(p.product_name LIKE ' . $db->quote('%' . $keyword . '%') . ' OR p.product_desc LIKE ' . $db->quote('%' . $keyword . '%') . ' OR p.product_s_desc LIKE ' . $db->quote('%' . $keyword . '%') . ')';
} elseif ($defaultSearchType == "virtual_product_num") {
$defaultSearchField = "virtual_product_num";
$defaultSearchType = '(pa.property_number LIKE ' . $db->quote('%' . $keyword . '%') . ' OR ps.subattribute_color_number LIKE ' . $db->quote('%' . $keyword . '%') . ')';
} elseif ($defaultSearchType == "name_number_desc") {
$defaultSearchType = '(p.product_name LIKE ' . $db->quote('%' . $keyword . '%') . ' OR p.product_number LIKE ' . $db->quote('%' . $keyword . '%') . ' OR p.product_desc LIKE ' . $db->quote('%' . $keyword . '%') . ' OR p.product_s_desc LIKE ' . $db->quote('%' . $keyword . '%') . ' OR pa.property_number LIKE ' . $db->quote('%' . $keyword . '%') . ' OR ps.subattribute_color_number LIKE ' . $db->quote('%' . $keyword . '%') . ')';
} elseif ($defaultSearchType == "product_desc") {
$defaultSearchField = $defaultSearchType;
$defaultSearchType = '(p.' . $defaultSearchType . ' LIKE ' . $db->quote('%' . $keyword . '%') . ' OR p.product_s_desc LIKE ' . $db->quote('%' . $keyword . '%') . ' )';
} elseif ($defaultSearchType == "product_name") {
$main_sp_name = explode(" ", $keyword);
$defaultSearchField = $defaultSearchType;
for ($f = 0; $f < count($main_sp_name); $f++) {
$defaultSearchType1[] = " p.product_name LIKE " . $db->quote('%' . $main_sp_name[$f] . '%');
}
$defaultSearchType = "(" . implode("AND", $defaultSearchType1) . ")";
} elseif ($defaultSearchType == "product_number") {
$defaultSearchField = $defaultSearchType;
$defaultSearchType = '(p.product_number LIKE ' . $db->quote('%' . $keyword . '%') . ')';
}
$redconfig = $app->getParams();
$getorderby = urldecode(JRequest::getCmd('order_by', ''));
if (in_array($getorderby, $this->filter_fields)) {
$order_by = $getorderby;
} else {
$order_by = $redconfig->get('order_by', DEFAULT_PRODUCT_ORDERING_METHOD);
}
if ($order_by == 'pc.ordering ASC' || $order_by == 'c.ordering ASC') {
$order_by = 'p.product_id DESC';
}
$layout = JRequest::getVar('layout', 'default');
$category_helper = new product_category();
$producthelper = new producthelper();
$manufacture_id = JRequest::getInt('manufacture_id', 0);
$category_id = JRequest::getInt('category_id', 0);
$cat = $category_helper->getCategoryListArray(0, $category_id);
$cat_group = array();
for ($j = 0; $j < count($cat); $j++) {
$cat_group[$j] = $cat[$j]->category_id;
if ($j == count($cat) - 1) {
$cat_group[$j + 1] = $category_id;
}
}
JArrayHelper::toInteger($cat_group);
if ($cat_group) {
$cat_group = join(',', $cat_group);
} else {
$cat_group = $category_id;
}
$params = JComponentHelper::getParams('com_redshop');
$menu = $app->getMenu();
$item = $menu->getActive();
$days = 0;
$days = isset($item->query['newproduct']) ? $item->query['newproduct'] : 0;
$today = date('Y-m-d H:i:s', time());
$days_before = date('Y-m-d H:i:s', time() - $days * 60 * 60 * 24);
$aclProducts = $producthelper->loadAclProducts();
$whereaclProduct = "";
// Shopper group - choose from manufactures Start
$rsUserhelper = new rsUserhelper();
$shopper_group_manufactures = $rsUserhelper->getShopperGroupManufacturers();
if ($shopper_group_manufactures != "") {
// Sanitize ids
$manufacturerIds = explode(',', $shopper_group_manufactures);
JArrayHelper::toInteger($manufacturerIds);
$whereaclProduct .= " AND p.manufacturer_id IN (" . implode(',', $manufacturerIds) . ") ";
}
// Shopper group - choose from manufactures End
if ($aclProducts != "") {
// Sanitize ids
$productIds = explode(',', $aclProducts);
JArrayHelper::toInteger($productIds);
$whereaclProduct .= " AND p.product_id IN (" . implode(',', $productIds) . ") ";
}
if ($layout == 'productonsale') {
$categoryid = $item->params->get('categorytemplate');
$cat_array = "";
$left_join = "";
if ($categoryid) {
$cat_main = $category_helper->getCategoryTree($categoryid);
$cat_group_main = array();
//.........这里部分代码省略.........
示例15: loadFields
/**
* Load the fields for export
*
* @return void
*/
private function loadFields()
{
$extra_field = new extra_field();
$producthelper = new producthelper();
$db = JFactory::getDbo();
$query = "SELECT * FROM `#__redshop_fields` ORDER BY field_id asc ";
$this->_db->setQuery($query);
$cur = $this->_db->loadObjectList();
$ret = null;
for ($i = 0; $i < count($cur); $i++) {
if ($i == 0) {
echo "field_id,field_title,field_name_field,field_type,field_desc,field_class,field_section,field_maxlength,field_cols,field_rows,field_size,field_show_in_front,required,published,data_id,data_txt,itemid,section,value_id,field_value,field_name,data_number";
echo "\r\n";
}
$query = 'SELECT data_id,`data_txt`,`itemid`,`section` FROM `#__redshop_fields_data` WHERE `fieldid` = ' . $cur[$i]->field_id . ' and section!=""';
$this->_db->setQuery($query);
$data = $this->_db->loadObjectList();
$attr = array();
$datavalue = $extra_field->getFieldValue($cur[$i]->field_id);
$attrvalue = array();
echo $cur[$i]->field_id . "," . $cur[$i]->field_title . "," . $cur[$i]->field_name . "," . $cur[$i]->field_type . "," . $cur[$i]->field_desc . "," . $cur[$i]->field_class . "," . $cur[$i]->field_section . "," . $cur[$i]->field_maxlength . "," . $cur[$i]->field_cols . "," . $cur[$i]->field_rows . "," . $cur[$i]->field_size . "," . $cur[$i]->field_show_in_front . "," . $cur[$i]->required . "," . $cur[$i]->published . "\n";
for ($att = 0; $att < count($data); $att++) {
$product_details = $producthelper->getProductById($data[$att]->itemid);
echo $cur[$i]->field_id . ",,,,,,,,,,,,,," . $data[$att]->data_id . ",\"" . $data[$att]->data_txt . "\"," . $data[$att]->itemid . "," . $data[$att]->section . ",,,," . $product_details->product_number . ",\n";
}
for ($attrvalue = 0; $attrvalue < count($datavalue); $attrvalue++) {
echo $cur[$i]->field_id . ",,,,,,,,,,,,,,,,,," . $datavalue[$attrvalue]->value_id . "," . $datavalue[$attrvalue]->field_value . "," . $datavalue[$attrvalue]->field_name . ",\n";
}
}
}