public function display($tpl = null) { $Redconfiguration = new Redconfiguration(); $uri = JFactory::getURI(); $lists = array(); $detail = $this->get('data'); $isNew = $detail->zipcode_id < 1; $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT'); JToolBarHelper::title(JText::_('COM_REDSHOP_ZIPCODE_DETAIL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_region_48'); JToolBarHelper::save(); JToolBarHelper::apply(); if ($isNew) { JToolBarHelper::cancel(); } else { JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE')); } $countryarray = $Redconfiguration->getCountryList((array) $detail); $detail->country_code = $countryarray['country_code']; $lists['country_code'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $detail); $lists['state_code'] = $statearray['state_dropdown']; $this->detail = $detail; $this->lists = $lists; $this->request_url = $uri->toString(); parent::display($tpl); }
function getInput() { $db = JFactory::getDbo(); if (!is_dir(JPATH_ADMINISTRATOR . '/components/com_redshop')) { return JText::_('COM_REDSHOP_REDSHOP_IS_NOT_INSTALLED'); } if (!is_array($this->value)) { $this->value = array('' => '1'); } else { foreach ($this->value as $_k => $tmpV) { $this->value[$tmpV] = $tmpV; } } $option = JRequest::getInt('option'); if ($option != 'com_redshop') { require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/redshop.cfg.php'; require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/configuration.php'; $Redconfiguration = new Redconfiguration(); $Redconfiguration->defineDynamicVars(); } require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/category.php'; $product_category = new product_category(); ob_start(); $output = $product_category->list_all('' . $this->name . '[]', '', $this->value, 10, true, true); ob_end_clean(); return $output; }
public function display($tpl = null) { $option = JRequest::getVar('option'); $extra_field = new extra_field(); $order_functions = new order_functions(); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_REDSHOP_QUOTATION_MANAGEMENT')); $document->addScript('components/' . $option . '/assets/js/json.js'); $document->addScript('components/' . $option . '/assets/js/validation.js'); $document->addScript('components/' . $option . '/assets/js/order.js'); $document->addScript('components/' . $option . '/assets/js/common.js'); $document->addScript('components/' . $option . '/assets/js/select_sort.js'); $document->addStyleSheet('components/' . $option . '/assets/css/search.css'); $document->addScript('components/' . $option . '/assets/js/search.js'); $session = JFactory::getSession(); $uri = JFactory::getURI(); $lists = array(); $model = $this->getModel(); $detail = $this->get('Data'); $Redconfiguration = new Redconfiguration(); $user_id = JRequest::getVar('user_id', 0); if ($user_id != 0) { $billing = $order_functions->getBillingAddress($user_id); } else { $billing = $model->setBilling(); } if (!is_object($detail)) { $detail = new stdClass(); } $detail->user_id = $user_id; $session->set('offlineuser_id', $user_id); $userop = array(); $userop[0] = new stdClass(); $userop[0]->user_id = 0; $userop[0]->text = JText::_('COM_REDSHOP_SELECT'); $userlists = $model->getUserData(0, "BT"); $userlist = array_merge($userop, $userlists); $lists['userlist'] = JHTML::_('select.genericlist', $userlist, 'user_id', 'class="inputbox" onchange="showquotationUserDetail();" ', 'user_id', 'text'); JToolBarHelper::title(JText::_('COM_REDSHOP_QUOTATION_MANAGEMENT') . ': <small><small>[ ' . JText::_('COM_REDSHOP_NEW') . ' ]</small></small>', 'redshop_order48'); JToolBarHelper::save(); JToolBarHelper::custom('send', 'send.png', 'send.png', JText::_('COM_REDSHOP_SEND'), false); JToolBarHelper::cancel(); // PRODUCT/ATTRIBUTE STOCK ROOM QUANTITY CHECKING IS IMPLEMENTED $countryarray = $Redconfiguration->getCountryList((array) $billing); $billing->country_code = $countryarray['country_code']; $lists['country_code'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $billing); $lists['state_code'] = $statearray['state_dropdown']; $lists['quotation_extrafield'] = $extra_field->list_all_field(16, $billing->users_info_id); $this->lists = $lists; $this->detail = $detail; $this->billing = $billing; $this->userlist = $userlists; $this->request_url = $uri->toString(); parent::display($tpl); }
public function replaceAccessoryData($product_id = 0, $accessory = array(), $user_id = 0, $uniqueid = "") { $uri = JURI::getInstance(); $url = $uri->root(); $redconfig = new Redconfiguration(); $producthelper = new producthelper(); $product = $producthelper->getProductById($product_id); $totalAccessory = count($accessory); $accessorylist = ""; if ($totalAccessory > 0) { $accessorylist .= "<tr><th>" . JText::_('COM_REDSHOP_ACCESSORY_PRODUCT') . "</th></tr>"; for ($a = 0; $a < count($accessory); $a++) { $ac_id = $accessory[$a]->child_product_id; $c_p_data = $producthelper->getProductById($ac_id); $accessory_name = $redconfig->maxchar($accessory[$a]->product_name, ACCESSORY_PRODUCT_TITLE_MAX_CHARS, ACCESSORY_PRODUCT_TITLE_END_SUFFIX); // Get accessory final price with VAT rules $accessorypricelist = $producthelper->getAccessoryPrice($product_id, $accessory[$a]->newaccessory_price, $accessory[$a]->accessory_main_price); $accessory_price = $accessorypricelist[0]; $accessoryprice_withoutvat = $producthelper->getAccessoryPrice($product_id, $accessory[$a]->newaccessory_price, $accessory[$a]->accessory_main_price, 1); $accessory_price_withoutvat = $accessoryprice_withoutvat[0]; $accessory_price_vat = $accessory_price - $accessory_price_withoutvat; $commonid = $product_id . '_' . $accessory[$a]->accessory_id . $uniqueid; // Accessory attribute Start $attributes_set = array(); if ($c_p_data->attribute_set_id > 0) { $attributes_set = $producthelper->getProductAttribute(0, $c_p_data->attribute_set_id); } $attributes = $producthelper->getProductAttribute($ac_id); $attributes = array_merge($attributes, $attributes_set); $accessory_checkbox = "<input onClick='calculateOfflineTotalPrice(\"" . $uniqueid . "\");' type='checkbox' name='accessory_id_" . $product_id . $uniqueid . "[]' totalattributs='" . count($attributes) . "' accessoryprice='" . $accessory_price . "' accessorypricevat='" . $accessory_price_vat . "' id='accessory_id_" . $commonid . "' value='" . $accessory[$a]->accessory_id . "' />"; $accessorylist .= "<tr><td>" . $accessory_checkbox . " " . $accessory_name . ' : ' . $producthelper->getProductFormattedPrice($accessory_price) . "</td></tr>"; $accessorylist .= $this->replaceAttributeData($product_id, $accessory[$a]->accessory_id, $attributes, $user_id, $uniqueid); } } return $accessorylist; }
public function replaceOrderTemplate($row, $ReceiptTemplate) { $url = JURI::base(); $redconfig = new Redconfiguration(); $order_id = $row->order_id; $session = JFactory::getSession(); $orderitem = $this->_order_functions->getOrderItemDetail($order_id); if (strstr($ReceiptTemplate, "{product_loop_start}") && strstr($ReceiptTemplate, "{product_loop_end}")) { $template_sdata = explode('{product_loop_start}', $ReceiptTemplate); $template_start = $template_sdata[0]; $template_edata = explode('{product_loop_end}', $template_sdata[1]); $template_end = $template_edata[1]; $template_middle = $template_edata[0]; $cartArr = $this->repalceOrderItems($template_middle, $orderitem); $ReceiptTemplate = $template_start . $cartArr[0] . $template_end; } $orderdetailurl = JURI::root() . 'index.php?option=com_redshop&view=order_detail&oid=' . $order_id . '&encr=' . $row->encr_key; $downloadProducts = $this->_order_functions->getDownloadProduct($order_id); $paymentmethod = $this->_order_functions->getOrderPaymentDetail($order_id); $paymentmethod = $paymentmethod[0]; $paymentmethod_detail = $this->_order_functions->getPaymentMethodInfo($paymentmethod->payment_method_class); $paymentmethod_detail = $paymentmethod_detail[0]; $OrderStatus = $this->_order_functions->getOrderStatusTitle($row->order_status); $product_name = ""; $product_price = ""; $subtotal_excl_vat = $cartArr[1]; $barcode_code = $row->barcode; $img_url = REDSHOP_FRONT_IMAGES_ABSPATH . "barcode/" . $barcode_code . ".png"; $bar_replace = '<img alt="" src="' . $img_url . '">'; $total_excl_vat = $subtotal_excl_vat + ($row->order_shipping - $row->order_shipping_tax) - ($row->order_discount - $row->order_discount_vat); $sub_total_vat = $row->order_tax + $row->order_shipping_tax; if (isset($row->voucher_discount) === false) { $row->voucher_discount = 0; } $Total_discount = $row->coupon_discount + $row->order_discount + $row->special_discount + $row->tax_after_discount + $row->voucher_discount; // For Payment and Shipping Extra Fields if (strstr($ReceiptTemplate, '{payment_extrafields}')) { $PaymentExtrafields = $this->_producthelper->getPaymentandShippingExtrafields($row, 18); if ($PaymentExtrafields == "") { $ReceiptTemplate = str_replace("{payment_extrafields_lbl}", "", $ReceiptTemplate); $ReceiptTemplate = str_replace("{payment_extrafields}", "", $ReceiptTemplate); } else { $ReceiptTemplate = str_replace("{payment_extrafields_lbl}", JText::_("COM_REDSHOP_ORDER_PAYMENT_EXTRA_FILEDS"), $ReceiptTemplate); $ReceiptTemplate = str_replace("{payment_extrafields}", $PaymentExtrafields, $ReceiptTemplate); } } if (strstr($ReceiptTemplate, '{shipping_extrafields}')) { $ShippingExtrafields = $this->_producthelper->getPaymentandShippingExtrafields($row, 19); if ($ShippingExtrafields == "") { $ReceiptTemplate = str_replace("{shipping_extrafields_lbl}", "", $ReceiptTemplate); $ReceiptTemplate = str_replace("{shipping_extrafields}", "", $ReceiptTemplate); } else { $ReceiptTemplate = str_replace("{shipping_extrafields_lbl}", JText::_("COM_REDSHOP_ORDER_SHIPPING_EXTRA_FILEDS"), $ReceiptTemplate); $ReceiptTemplate = str_replace("{shipping_extrafields}", $ShippingExtrafields, $ReceiptTemplate); } } // End $ReceiptTemplate = $this->replaceShippingMethod($row, $ReceiptTemplate); if (!APPLY_VAT_ON_DISCOUNT) { $total_for_discount = $subtotal_excl_vat; } else { $total_for_discount = $row->order_subtotal; } $ReceiptTemplate = $this->replaceLabel($ReceiptTemplate); $search[] = "{order_subtotal}"; $chktag = $this->_producthelper->getApplyVatOrNot($ReceiptTemplate); if (!empty($chktag)) { $replace[] = $this->_producthelper->getProductFormattedPrice($row->order_total); } else { $replace[] = $this->_producthelper->getProductFormattedPrice($total_excl_vat); } $search[] = "{subtotal_excl_vat}"; $replace[] = $this->_producthelper->getProductFormattedPrice($total_excl_vat); $search[] = "{product_subtotal}"; if (!empty($chktag)) { $replace[] = $this->_producthelper->getProductFormattedPrice($row->order_subtotal); } else { $replace[] = $this->_producthelper->getProductFormattedPrice($subtotal_excl_vat); } $search[] = "{product_subtotal_excl_vat}"; $replace[] = $this->_producthelper->getProductFormattedPrice($subtotal_excl_vat); $search[] = "{order_subtotal_excl_vat}"; $replace[] = $this->_producthelper->getProductFormattedPrice($total_excl_vat); $search[] = "{order_number_lbl}"; $replace[] = JText::_('COM_REDSHOP_ORDER_NUMBER_LBL'); $search[] = "{order_number}"; $replace[] = $row->order_number; $search[] = "{special_discount}"; $replace[] = $row->special_discount . '%'; $search[] = "{special_discount_amount}"; $replace[] = $this->_producthelper->getProductFormattedPrice($row->special_discount_amount); $search[] = "{order_detail_link}"; $replace[] = "<a href='" . $orderdetailurl . "'>" . JText::_("COM_REDSHOP_ORDER_MAIL") . "</a>"; $dpData = ""; if (count($downloadProducts) > 0) { $dpData .= "<table>"; for ($d = 0; $d < count($downloadProducts); $d++) { $g = $d + 1; $downloadProduct = $downloadProducts[$d]; $downloadfilename = substr(basename($downloadProduct->file_name), 11); $downloadToken = $downloadProduct->download_id; $product_name = $downloadProduct->product_name; $mailtoken = $product_name . ": <a href='" . JUri::root() . "index.php?option=com_redshop&view=product&layout=downloadproduct&tid=" . $downloadToken . "'>" . $downloadfilename . "</a>"; $dpData .= "</tr>"; $dpData .= "<td>(" . $g . ") " . $mailtoken . "</td>"; $dpData .= "</tr>"; } $dpData .= "</table>"; } if ($row->order_status == "C" && $row->order_payment_status == "Paid") { $search[] = "{download_token}"; $replace[] = $dpData; $search[] = "{download_token_lbl}"; if ($dpData != "") { $replace[] = JText::_('COM_REDSHOP_DOWNLOAD_TOKEN'); } else { $replace[] = ""; } } else { $search[] = "{download_token}"; $replace[] = ""; $search[] = "{download_token_lbl}"; $replace[] = ""; } $issplitdisplay = ""; $issplitdisplay2 = ""; if ((strstr($ReceiptTemplate, "{discount_denotation}") || strstr($ReceiptTemplate, "{shipping_denotation}")) && ($Total_discount != 0 || $row->order_shipping != 0)) { $search[] = "{denotation_label}"; $replace[] = JText::_('COM_REDSHOP_DENOTATION_TXT'); } else { $search[] = "{denotation_label}"; $replace[] = ""; } $search[] = "{discount_denotation}"; if (strstr($ReceiptTemplate, "{discount_excl_vat}")) { $replace[] = "*"; } else { $replace[] = ""; } $search[] = "{shipping_denotation}"; if (strstr($ReceiptTemplate, "{shipping_excl_vat}")) { $replace[] = "*"; } else { $replace[] = ""; } $search[] = "{payment_status}"; if (trim($row->order_payment_status) == 'Paid') { $orderPaymentStatus = JText::_('COM_REDSHOP_PAYMENT_STA_PAID'); } elseif (trim($row->order_payment_status) == 'Unpaid') { $orderPaymentStatus = JText::_('COM_REDSHOP_PAYMENT_STA_UNPAID'); } elseif (trim($row->order_payment_status) == 'Partial Paid') { $orderPaymentStatus = JText::_('COM_REDSHOP_PAYMENT_STA_PARTIAL_PAID'); } else { $orderPaymentStatus = $row->order_payment_status; } $replace[] = $orderPaymentStatus . " " . JRequest::getVar('order_payment_log') . $issplitdisplay . $issplitdisplay2; $search[] = "{order_payment_status}"; $replace[] = $orderPaymentStatus . " " . JRequest::getVar('order_payment_log') . $issplitdisplay . $issplitdisplay2; $search[] = "{order_total}"; $replace[] = $this->_producthelper->getProductFormattedPrice($row->order_total); $search[] = "{total_excl_vat}"; $replace[] = $this->_producthelper->getProductFormattedPrice($total_excl_vat); $search[] = "{sub_total_vat}"; $replace[] = $this->_producthelper->getProductFormattedPrice($sub_total_vat); $search[] = "{order_id}"; $replace[] = $order_id; $search[] = "{discount_denotation}"; $replace[] = "*"; $arr_discount_type = array(); $arr_discount = explode('@', $row->discount_type); $discount_type = ''; for ($d = 0; $d < count($arr_discount); $d++) { if ($arr_discount[$d]) { $arr_discount_type = explode(':', $arr_discount[$d]); if ($arr_discount_type[0] == 'c') { $discount_type .= JText::_('COM_REDSHOP_COUPON_CODE') . ' : ' . $arr_discount_type[1] . '<br>'; } if ($arr_discount_type[0] == 'v') { $discount_type .= JText::_('COM_REDSHOP_VOUCHER_CODE') . ' : ' . $arr_discount_type[1] . '<br>'; } } } $search[] = "{discount_type}"; $replace[] = $discount_type; $search[] = "{discount_excl_vat}"; $replace[] = $this->_producthelper->getProductFormattedPrice($row->order_discount - $row->order_discount_vat); $search[] = "{order_status}"; $replace[] = $OrderStatus; $search[] = "{order_id_lbl}"; $replace[] = JText::_('COM_REDSHOP_ORDER_ID_LBL'); $search[] = "{order_date}"; $replace[] = $redconfig->convertDateFormat($row->cdate); $search[] = "{customer_note}"; $replace[] = $row->customer_note; $search[] = "{customer_message}"; $replace[] = $row->customer_message; $search[] = "{referral_code}"; $replace[] = $row->referral_code; $search[] = "{payment_method}"; $replace[] = JText::_($paymentmethod->order_payment_name); $txtextra_info = ''; if ($paymentmethod_detail->element == "rs_payment_banktransfer" || $paymentmethod_detail->element == "rs_payment_banktransfer_discount" || $paymentmethod_detail->element == "rs_payment_banktransfer2" || $paymentmethod_detail->element == "rs_payment_banktransfer3" || $paymentmethod_detail->element == "rs_payment_banktransfer4" || $paymentmethod_detail->element == "rs_payment_banktransfer5") { $paymentpath = JPATH_SITE . '/plugins/redshop_payment/' . $paymentmethod_detail->element . '/' . $paymentmethod_detail->element . '.xml'; $paymentparams = new JRegistry($paymentmethod_detail->params); $txtextra_info = $paymentparams->get('txtextra_info', ''); } $search[] = "{payment_extrainfo}"; $replace[] = $txtextra_info; if (JRequest::getVar('order_delivery')) { $search[] = "{delivery_time_lbl}"; $replace[] = JText::_('COM_REDSHOP_DELIVERY_TIME'); } else { $search[] = "{delivery_time_lbl}"; $replace[] = " "; } $search[] = "{delivery_time}"; $replace[] = JRequest::getVar('order_delivery'); $search[] = "{without_vat}"; $replace[] = ''; $search[] = "{with_vat}"; $replace[] = ''; if (strstr($ReceiptTemplate, '{order_detail_link_lbl}')) { $search[] = "{order_detail_link_lbl}"; $replace[] = JText::_('COM_REDSHOP_ORDER_DETAIL_LINK_LBL'); } if (strstr($ReceiptTemplate, '{product_subtotal_lbl}')) { $search[] = "{product_subtotal_lbl}"; $replace[] = JText::_('COM_REDSHOP_PRODUCT_SUBTOTAL_LBL'); } if (strstr($ReceiptTemplate, '{product_subtotal_excl_vat_lbl}')) { $search[] = "{product_subtotal_excl_vat_lbl}"; $replace[] = JText::_('COM_REDSHOP_PRODUCT_SUBTOTAL_EXCL_LBL'); } if (strstr($ReceiptTemplate, '{shipping_with_vat_lbl}')) { $search[] = "{shipping_with_vat_lbl}"; $replace[] = JText::_('COM_REDSHOP_SHIPPING_WITH_VAT_LBL'); } if (strstr($ReceiptTemplate, '{shipping_excl_vat_lbl}')) { $search[] = "{shipping_excl_vat_lbl}"; $replace[] = JText::_('COM_REDSHOP_SHIPPING_EXCL_VAT_LBL'); } if (strstr($ReceiptTemplate, '{product_price_excl_lbl}')) { $search[] = "{product_price_excl_lbl}"; $replace[] = JText::_('COM_REDSHOP_PRODUCT_PRICE_EXCL_LBL'); } $billingaddresses = $this->_order_functions->getOrderBillingUserInfo($order_id); $shippingaddresses = $this->_order_functions->getOrderShippingUserInfo($order_id); $search[] = "{requisition_number}"; $replace[] = $row->requisition_number ? $row->requisition_number : "N/A"; $search[] = "{requisition_number_lbl}"; $replace[] = JText::_('COM_REDSHOP_REQUISITION_NUMBER'); if (strstr($ReceiptTemplate, '{redcrm_debitornumber_lbl}')) { if ($session->get('isredcrmuser_debitor')) { $search[] = "{redcrm_debitornumber_lbl}"; $replace[] = JText::_('COM_REDSHOP_DEBITOR_NUMBER'); } else { $search[] = "{redcrm_debitornumber_lbl}"; $replace[] = ""; } } if (strstr($ReceiptTemplate, '{redcrm_debitornumber}')) { if ($session->get('isredcrmuser_debitor')) { $search[] = "{redcrm_debitornumber}"; $replace[] = $row->user_info_id; } else { $search[] = "{redcrm_debitornumber}"; $replace[] = ""; } } $ReceiptTemplate = $this->replaceBillingAddress($ReceiptTemplate, $billingaddresses); $ReceiptTemplate = $this->replaceShippingAddress($ReceiptTemplate, $shippingaddresses); $message = str_replace($search, $replace, $ReceiptTemplate); $message = $this->replacePayment($message, $row->payment_discount, 0, $row->payment_oprand); $message = $this->replaceDiscount($message, $row->order_discount, $total_for_discount); $message = $this->replaceTax($message, $row->order_tax + $row->order_shipping_tax, $row->tax_after_discount, 1); return $message; }
*/ defined('_JEXEC') or die; JHTML::_('behavior.tooltip'); JHTML::_('behavior.modal'); require_once JPATH_COMPONENT_SITE . '/helpers/product.php'; require_once JPATH_COMPONENT_SITE . '/helpers/helper.php'; require_once JPATH_COMPONENT_SITE . '/helpers/cart.php'; require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/order.php'; require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/shipping.php'; $producthelper = new producthelper(); $carthelper = new rsCarthelper(); $order_functions = new order_functions(); $redhelper = new redhelper(); $extra_field = new extra_field(); $shippinghelper = new shipping(); $config = new Redconfiguration(); $uri = JURI::getInstance(); $url = $uri->root(); $option = JRequest::getVar('option'); $tmpl = JRequest::getVar('tmpl'); $model = $this->getModel('order_detail'); $session = JFactory::getSession(); $billing = $this->billing; $shipping = $this->shipping; $is_company = $billing->is_company; $order_id = $this->detail->order_id; $products = $order_functions->getOrderItemDetail($order_id); $log_rec = $model->getOrderLog($order_id); if (!$shipping) { $shipping = $billing; }
public function display($tpl = null) { $option = JRequest::getVar('option'); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_REDSHOP_ORDER')); $order_functions = new order_functions(); $redhelper = new redhelper(); $uri = JFactory::getURI(); // Load language file $payment_lang_list = $redhelper->getPlugins("redshop_payment"); $language = JFactory::getLanguage(); $base_dir = JPATH_ADMINISTRATOR; $language_tag = $language->getTag(); for ($l = 0; $l < count($payment_lang_list); $l++) { $extension = 'plg_redshop_payment_' . $payment_lang_list[$l]->element; $language->load($extension, $base_dir, $language_tag, true); } $layout = JRequest::getVar('layout'); $document->addScript('components/' . $option . '/assets/js/order.js'); $document->addScript('components/' . $option . '/assets/js/common.js'); $document->addScript('components/' . $option . '/assets/js/validation.js'); $document->addScript(JURI::base() . 'components/' . $option . '/assets/js/select_sort.js'); $document->addStyleSheet(JURI::base() . 'components/' . $option . '/assets/css/search.css'); $document->addScript(JURI::base() . 'components/' . $option . '/assets/js/search.js'); $document->addScript(JURI::base() . 'components/' . $option . '/assets/js/json.js'); $lists = array(); $model = $this->getModel(); $detail = $this->get('data'); $billing = $order_functions->getOrderBillingUserInfo($detail->order_id); $shipping = $order_functions->getOrderShippingUserInfo($detail->order_id); $task = JRequest::getVar('task'); if ($task == 'ccdetail') { $ccdetail = $model->getccdetail($detail->order_id); $this->ccdetail = $ccdetail; $this->setLayout('ccdetail'); parent::display($tpl); exit; } if ($layout == 'shipping' || $layout == 'billing') { if (!$shipping || $layout == 'billing') { $shipping = $billing; } $this->setLayout($layout); $Redconfiguration = new Redconfiguration(); $countryarray = $Redconfiguration->getCountryList((array) $shipping); $shipping->country_code = $countryarray['country_code']; $lists['country_code'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $shipping); $lists['state_code'] = $statearray['state_dropdown']; $showcountry = count($countryarray['countrylist']) == 1 && count($statearray['statelist']) == 0 ? 0 : 1; $showstate = $statearray['is_states'] <= 0 ? 0 : 1; $this->showcountry = $showcountry; $this->showstate = $showstate; } elseif ($layout == "print_order" || $layout == 'productorderinfo' || $layout == 'creditcardpayment') { $this->setLayout($layout); } else { $this->setLayout('default'); } $payment_detail = $order_functions->getOrderPaymentDetail($detail->order_id); if (count($payment_detail) > 0) { $payment_detail = $payment_detail[0]; } $isNew = $detail->order_id < 1; $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT'); JToolBarHelper::title(JText::_('COM_REDSHOP_ORDER') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_order48'); $redhelper = new redhelper(); $backlink = 'index.php?option=com_redshop&view=order'; $backlink = $redhelper->sslLink($backlink, 0); $new_link = 'index.php?option=com_redshop&view=order'; JToolBarHelper::back(JText::_('COM_REDSHOP_ORDERLIST'), 'javascript:location.href=\'' . $new_link . '\';'); // Section can be added from here $option = array(); $option[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT')); $this->lists = $lists; $this->detail = $detail; $this->billing = $billing; $this->shipping = $shipping; $this->payment_detail = $payment_detail; $this->shipping_rate_id = $detail->ship_method_id; $this->request_url = $uri->toString(); parent::display($tpl); }
<?php /** * @package RedSHOP.Frontend * @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_COMPONENT_ADMINISTRATOR . '/helpers/order.php'; include_once JPATH_COMPONENT . '/helpers/helper.php'; $configobj = new Redconfiguration(); $order_functions = new order_functions(); $redhelper = new redhelper(); $url = JURI::base(); $Itemid = $redhelper->getCheckoutItemid(); $order_id = JRequest::getInt('oid'); $order = $order_functions->getOrderDetails($order_id); $orderitem = $order_functions->getOrderItemDetail($order_id); if ($order->order_total > 0 && !USE_AS_CATALOG) { $paymentmethod = $order_functions->getOrderPaymentDetail($order_id); $paymentmethod = $order_functions->getPaymentMethodInfo($paymentmethod[0]->payment_method_class); $paymentmethod = $paymentmethod[0]; $paymentpath = JPATH_SITE . '/plugins/redshop_payment/' . $paymentmethod->element . '/' . $paymentmethod->element . '.xml'; $paymentparams = new JRegistry($paymentmethod->params); echo '<div>'; $is_creditcard = $paymentparams->get('is_creditcard', ''); $is_redirected = $paymentparams->get('is_redirected', 0); if (!$is_creditcard || $is_redirected == 1) { $adminpath = JPATH_ADMINISTRATOR . '/components/com_redshop';
/** * 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); $template_d2 = explode("{subcats end if}", $template_d1[1]); $template_org = $template_d1[0] . $template_d2[1]; } // End skip html if nosubcategory $template_org = str_replace("{print}", $print_tag, $template_org); $template_org = str_replace("{product_price_slider}", '', $template_org); $template_org = str_replace("{filter_by}", '', $template_org); $template_org = str_replace("{template_selector_category_lbl}", '', $template_org); $template_org = str_replace("{template_selector_category}", '', $template_org); $template_org = str_replace("{category_main_description}", '', $template_org); $template_org = str_replace("{category_main_name}", $cat_name, $template_org); $template_org = str_replace("{category_description}", '', $template_org); $template_org = str_replace("{category_short_desc}", '', $template_org); $template_org = str_replace("{category_name}", '', $template_org); $template_org = str_replace("{if subcats}", '', $template_org); $template_org = str_replace("{subcats end if}", '', $template_org); $template_org = str_replace("{category_main_thumb_image_3}", '', $template_org); $template_org = str_replace("{category_main_short_desc}", '', $template_org); $template_org = str_replace("{category_main_thumb_image_2}", '', $template_org); $template_org = str_replace("{category_main_thumb_image_1}", '', $template_org); $template_org = str_replace("{category_main_thumb_image}", '', $template_org); $template_org = str_replace("{attribute_price_without_vat}", '', $template_org); $template_org = str_replace("{redproductfinderfilter_formstart}", '', $template_org); $template_org = str_replace("{redproductfinderfilter:rp_myfilter}", '', $template_org); $template_org = str_replace("{redproductfinderfilter_formend}", '', $template_org); // Replace redproductfilder filter tag if (strstr($template_org, "{redproductfinderfilter:")) { $redProductFinerHelper = JPATH_SITE . "/components/com_redproductfinder/helpers/redproductfinder_helper.php"; if (file_exists($redProductFinerHelper)) { include_once $redProductFinerHelper; $redproductfinder_helper = new redproductfinder_helper(); $hdnFields = array('texpricemin' => '0', 'texpricemax' => '0', 'manufacturer_id' => $filter_by, 'category_template' => $templateid); $hide_filter_flag = false; if ($this->_id) { $prodctofcat = $producthelper->getProductCategory($this->_id); if (empty($prodctofcat)) { $hide_filter_flag = true; } } $template_org = $redproductfinder_helper->replaceProductfinder_tag($template_org, $hdnFields, $hide_filter_flag); } } // Replace redproductfilder filter tag end here $template_d1 = explode("{product_loop_start}", $template_org); $template_d2 = explode("{product_loop_end}", $template_d1[1]); $template_tmp_desc = $template_d2[0]; $template_desc = $template_d2[0]; // Order By $order_by = ""; $orderby_form = "<form name='orderby_form' action='' method='post' >"; $orderby_form .= $this->lists['order_select']; $orderby_form .= "<input type='hidden' name='view' value='search'>\n\t\t\t<input type='hidden' name='layout' value='{$layout}'>\n\t\t\t<input type='hidden' name='keyword' value='{$keyword}'>\n\t\t\t<input type='hidden' name='category_id' value='{$cid}'>\n\t\t\t<input type='hidden' name='manufacture_id' value='{$manufacture_id}'>\n\t\t\t<input type='hidden' name='templateid' value='{$templateid}'></form>"; if (strstr($template_desc, '{order_by}')) { $order_by = $orderby_form; } $extraFieldName = $extraField->getSectionFieldNameArray(1, 1, 1); $attribute_template = $producthelper->getAttributeTemplate($template_desc); $total_product = $model->_total; $endlimit = $this->limit; $start = JRequest::getInt('limitstart', 0, '', 'int'); if (strstr($template_org, "{pagination}")) { if (strstr($template_org, "{product_display_limit}")) { $endlimit = JRequest::getInt('limit', $endlimit, '', 'int'); } } else { $endlimit = $model->getData(); } if ($endlimit == 0) { $final_endlimit = $total_product; } else { $final_endlimit = $endlimit; } $tagarray = $texts->getTextLibraryTagArray(); $data = ""; $count_no_user_field = 0; for ($i = 0; $i < count($this->search); $i++) { $data_add = ""; $thum_image = ""; $pname = $Redconfiguration->maxchar($this->search[$i]->product_name, CATEGORY_PRODUCT_TITLE_MAX_CHARS, CATEGORY_PRODUCT_TITLE_END_SUFFIX); if ($search_type == 'product_number') { $product_number = str_ireplace($keyword, "<b class='search_hightlight'>" . $keyword . "</b>", $this->search[$i]->product_number); $pro_s_desc = $this->search[$i]->product_s_desc; $pro_desc = $this->search[$i]->product_desc; } else { $product_number = $this->search[$i]->product_number; $pro_s_desc = $this->search[$i]->product_s_desc; $pro_desc = $this->search[$i]->product_desc; if (!in_array($keyword, $tagarray)) { $pname = str_ireplace($keyword, "<b class='search_hightlight'>" . $keyword . "</b>", $pname); $pro_s_desc = str_ireplace($keyword, "<b class='search_hightlight'>" . $keyword . "</b>", $pro_s_desc); $pro_desc = str_ireplace($keyword, "<b class='search_hightlight'>" . $keyword . "</b>", $pro_desc); } } $pro_s_desc = $Redconfiguration->maxchar($pro_s_desc, CATEGORY_PRODUCT_DESC_MAX_CHARS, CATEGORY_PRODUCT_DESC_END_SUFFIX); $link = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $this->search[$i]->product_id . '&Itemid=' . $Itemid); if (strstr($template_desc, '{product_name}')) { $pname = "<a href='" . $link . "'>" . $pname . "</a>"; $data_add = str_replace("{product_name}", $pname, $template_desc); } if (strstr($template_desc, '{product_name_nolink}')) { $data_add = str_replace("{product_name_nolink}", $pname, $template_desc); } $readmore = "<a href='" . $link . "'>" . JText::_('COM_REDSHOP_READ_MORE') . "</a>"; $data_add = str_replace("{read_more}", $readmore, $data_add); $data_add = str_replace("{read_more_link}", $link, $data_add); // RedSHOP Product Plugin JPluginHelper::importPlugin('redshop_product'); $results = $dispatcher->trigger('onPrepareProduct', array(&$data_add, &$params, $this->search[$i])); // End if (strstr($data_add, "{product_delivery_time}")) { $product_delivery_time = $producthelper->getProductMinDeliveryTime($this->search[$i]->product_id); if ($product_delivery_time != "") { $data_add = str_replace("{delivery_time_lbl}", JText::_('DELIVERY_TIME'), $data_add); $data_add = str_replace("{product_delivery_time}", $product_delivery_time, $data_add); } else { $data_add = str_replace("{delivery_time_lbl}", "", $data_add); $data_add = str_replace("{product_delivery_time}", "", $data_add); } } // Product Review/Rating // Fetching reviews $final_avgreview_data = $producthelper->getProductRating($this->search[$i]->product_id); // Attribute ajax chage $data_add = str_replace("{product_rating_summary}", $final_avgreview_data, $data_add); $data_add = $producthelper->getJcommentEditor($this->search[$i], $data_add); $data_add = $producthelper->getExtraSectionTag($extraFieldName, $this->search[$i]->product_id, "1", $data_add, 1); $data_add = str_replace("{product_s_desc}", $pro_s_desc, $data_add); $data_add = str_replace("{product_desc}", $pro_desc, $data_add); $data_add = str_replace("{product_id_lbl}", JText::_('COM_REDSHOP_PRODUCT_ID_LBL'), $data_add); $data_add = str_replace("{product_id}", $this->search[$i]->product_id, $data_add); $data_add = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER_LBL'), $data_add); $data_add = str_replace("{product_number}", $product_number, $data_add); /** * related Product List in Lightbox * Tag Format = {related_product_lightbox:<related_product_name>[:width][:height]} */ if (strstr($data_add, '{related_product_lightbox:')) { $related_product = $producthelper->getRelatedProduct($this->search[$i]->product_id); $rtlnone = explode("{related_product_lightbox:", $data_add); $rtlntwo = explode("}", $rtlnone[1]); $rtlnthree = explode(":", $rtlntwo[0]); $rtln = $rtlnthree[0]; $rtlnfwidth = isset($rtlnthree[1]) ? $rtlnthree[1] : "900"; $rtlnwidthtag = isset($rtlnthree[1]) ? ":" . $rtlnthree[1] : ""; $rtlnfheight = isset($rtlnthree[2]) ? $rtlnthree[2] : "600"; $rtlnheighttag = isset($rtlnthree[2]) ? ":" . $rtlnthree[2] : ""; $rtlntag = "{related_product_lightbox:{$rtln}{$rtlnwidthtag}{$rtlnheighttag}}"; if (count($related_product) > 0) { $linktortln = JUri::root() . "index.php?option=com_redshop&view=product&pid=" . $this->search[$i]->product_id . "&tmpl=component&template=" . $rtln . "&for=rtln"; $rtlna = '<a class="modal" href="' . $linktortln . '" rel="{handler:\'iframe\',size:{x:' . $rtlnfwidth . ',y:' . $rtlnfheight . '}}" >' . JText::_('COM_REDSHOP_RELATED_PRODUCT_LIST_IN_LIGHTBOX') . '</a>'; } else { $rtlna = ""; } $data_add = str_replace($rtlntag, $rtlna, $data_add); } $data_add = $producthelper->replaceVatinfo($data_add); /************************************ * Conditional tag * if product on discount : Yes * {if product_on_sale} This product is on sale {product_on_sale end if} // OUTPUT : This product is on sale * NO : // OUTPUT : Display blank ************************************/ $data_add = $producthelper->getProductOnSaleComment($this->search[$i], $data_add); $data_add = $stockroomhelper->replaceStockroomAmountDetail($data_add, $this->search[$i]->product_id); if (strstr($data_add, "{product_thumb_image_3}")) { $cimg_tag = '{product_thumb_image_3}'; $ch_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT_3; $cw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH_3; } elseif (strstr($data_add, "{product_thumb_image_2}")) { $cimg_tag = '{product_thumb_image_2}'; $ch_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT_2; $cw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH_2; } elseif (strstr($data_add, "{product_thumb_image_1}")) { $cimg_tag = '{product_thumb_image_1}'; $ch_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT; $cw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH; } else { $cimg_tag = '{product_thumb_image}'; $ch_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT; $cw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH; } $hidden_thumb_image = "<input type='hidden' name='prd_main_imgwidth' id='prd_main_imgwidth' value='" . $cw_thumb . "'><input type='hidden' name='prd_main_imgheight' id='prd_main_imgheight' value='" . $ch_thumb . "'>"; $thum_image = $producthelper->getProductImage($this->search[$i]->product_id, $link, $cw_thumb, $ch_thumb); $data_add = str_replace($cimg_tag, $thum_image . $hidden_thumb_image, $data_add); // More documents if (strstr($data_add, "{more_documents}")) { $media_documents = $producthelper->getAdditionMediaImage($this->search[$i]->product_id, "product", "document"); $more_doc = ''; for ($m = 0; $m < count($media_documents); $m++) { $alttext = $producthelper->getAltText("product", $media_documents[$m]->section_id, "", $media_documents[$m]->media_id, "document"); if (!$alttext) { $alttext = $media_documents[$m]->media_name; } if (is_file(REDSHOP_FRONT_DOCUMENT_RELPATH . "product/" . $media_documents[$m]->media_name)) { $downlink = JUri::root() . 'index.php?tmpl=component&option=com_redshop&view=product&pid=' . $this->search[$i]->product_id . '&task=downloadDocument&fname=' . $media_documents[$m]->media_name . '&Itemid=' . $Itemid; $more_doc .= "<div><a href='" . $downlink . "' title='" . $alttext . "'>"; $more_doc .= $alttext; $more_doc .= "</a></div>"; } } $data_add = str_replace("{more_documents}", "<span id='additional_docs" . $this->search[$i]->product_id . "'>" . $more_doc . "</span>", $data_add); } // More documents end /************************************************ user fields*******************************************************/ $hidden_userfield = ""; $returnArr = $producthelper->getProductUserfieldFromTemplate($data_add); $template_userfield = $returnArr[0]; $userfieldArr = $returnArr[1]; $count_no_user_field = 0; if ($template_userfield != "") { $ufield = ""; for ($ui = 0; $ui < count($userfieldArr); $ui++) { $product_userfileds = $extraField->list_all_user_fields($userfieldArr[$ui], 12, '', '', 0, $this->search[$i]->product_id); $ufield .= $product_userfileds[1]; if ($product_userfileds[1] != "") { $count_no_user_field++; } $data_add = str_replace('{' . $userfieldArr[$ui] . '_lbl}', $product_userfileds[0], $data_add); $data_add = str_replace('{' . $userfieldArr[$ui] . '}', $product_userfileds[1], $data_add); } $product_userfileds_form = "<form method='post' action='' id='user_fields_form_" . $this->search[$i]->product_id . "' name='user_fields_form_" . $this->search[$i]->product_id . "'>"; if ($ufield != "") { $data_add = str_replace("{if product_userfield}", $product_userfileds_form, $data_add); $data_add = str_replace("{product_userfield end if}", "</form>", $data_add); } else { $data_add = str_replace("{if product_userfield}", "", $data_add); $data_add = str_replace("{product_userfield end if}", "", $data_add); } } elseif (AJAX_CART_BOX) { $ajax_detail_template_desc = ""; $ajax_detail_template = $producthelper->getAjaxDetailboxTemplate($this->search[$i]); if (count($ajax_detail_template) > 0) { $ajax_detail_template_desc = $ajax_detail_template->template_desc; } $returnArr = $producthelper->getProductUserfieldFromTemplate($ajax_detail_template_desc); $template_userfield = $returnArr[0]; $userfieldArr = $returnArr[1]; if ($template_userfield != "") { $ufield = ""; for ($ui = 0; $ui < count($userfieldArr); $ui++) { $product_userfileds = $extraField->list_all_user_fields($userfieldArr[$ui], 12, '', '', 0, $this->search[$i]->product_id); $ufield .= $product_userfileds[1]; if ($product_userfileds[1] != "") { $count_no_user_field++; } $template_userfield = str_replace('{' . $userfieldArr[$ui] . '_lbl}', $product_userfileds[0], $template_userfield); $template_userfield = str_replace('{' . $userfieldArr[$ui] . '}', $product_userfileds[1], $template_userfield); } if ($ufield != "") { $hidden_userfield = "<div style='display:none;'><form method='post' action='' id='user_fields_form_" . $this->search[$i]->product_id . "' name='user_fields_form_" . $this->search[$i]->product_id . "'>" . $template_userfield . "</form></div>"; } } } $data_add = $data_add . $hidden_userfield; /*************** end user fields ***************/ // ProductFinderDatepicker Extra Field Start $fieldArray = $extraField->getSectionFieldList(17, 0, 0); $data_add = $producthelper->getProductFinderDatepickerValue($data_add, $this->search[$i]->product_id, $fieldArray); // ProductFinderDatepicker Extra Field End /* * manufacturer data */ $manufacturer_id = $this->search[$i]->manufacturer_id; if ($manufacturer_id != 0) { $manufacturer_data = $producthelper->getSection("manufacturer", $manufacturer_id); $manufacturer_link_href = JRoute::_('index.php?option=com_redshop&view=manufacturers&layout=detail&mid=' . $manufacturer_id . '&Itemid=' . $Itemid); $manufacturer_name = ""; if (count($manufacturer_data) > 0) { $manufacturer_name = $manufacturer_data->manufacturer_name; } $manufacturer_link = '<a href="' . $manufacturer_link_href . '" title="' . $manufacturer_name . '">' . $manufacturer_name . '</a>'; if (strstr($data_add, "{manufacturer_link}")) { $data_add = str_replace("{manufacturer_name}", "", $data_add); } else { $data_add = str_replace("{manufacturer_name}", $manufacturer_name, $data_add); } $data_add = str_replace("{manufacturer_link}", $manufacturer_link, $data_add); } else { $data_add = str_replace("{manufacturer_link}", "", $data_add); $data_add = str_replace("{manufacturer_name}", "", $data_add); } // End // Replace wishlistbutton $data_add = $producthelper->replaceWishlistButton($this->search[$i]->product_id, $data_add); // Replace compare product button $data_add = $producthelper->replaceCompareProductsButton($this->search[$i]->product_id, 0, $data_add); // Checking for child products $childproduct = $producthelper->getChildProduct($this->search[$i]->product_id); if (count($childproduct) > 0) { $isChilds = true; $attributes = array(); } else { $isChilds = false; // Get attributes $attributes_set = array(); if ($this->search[$i]->attribute_set_id > 0) { $attributes_set = $producthelper->getProductAttribute(0, $this->search[$i]->attribute_set_id, 0, 1); } $attributes = $producthelper->getProductAttribute($this->search[$i]->product_id); $attributes = array_merge($attributes, $attributes_set); } // Product attribute Start $totalatt = count($attributes); // Check product for not for sale $data_add = $producthelper->getProductNotForSaleComment($this->search[$i], $data_add, $attributes); $data_add = $producthelper->replaceProductInStock($this->search[$i]->product_id, $data_add, $attributes, $attribute_template); $data_add = $producthelper->replaceAttributeData($this->search[$i]->product_id, 0, 0, $attributes, $data_add, $attribute_template, $isChilds); // Cart Template $data_add = $producthelper->replaceCartTemplate($this->search[$i]->product_id, 0, 0, 0, $data_add, $isChilds, $userfieldArr, $totalatt, 0, $count_no_user_field, ""); $data .= $data_add; } $app = JFactory::getApplication(); $router = $app->getRouter(); $getorderby = JRequest::getVar('order_by', DEFAULT_PRODUCT_ORDERING_METHOD); $vars = array('option' => 'com_redshop', 'view' => 'search', 'layout' => $layout, 'keyword' => $keyword, 'manufacture_id' => $manufacture_id, 'order_by' => $getorderby, 'category_id' => $cid, 'Itemid' => $Itemid, 'limit' => $limit); $router->setVars($vars); unset($vars); if (strstr($template_org, "{pagination}")) { $pagination = new redPagination($total_product, $start, $endlimit); $slidertag = $pagination->getPagesLinks(); if (strstr($template_org, "{product_display_limit}")) { $slidertag = "<form action='' method='post'><input type='hidden' name='keyword' value='{$keyword}'>\n\t\t\t<input type='hidden' name='category_id' value='{$cid}'>\n\t\t\t<input type='hidden' name='manufacture_id' value='{$manufacture_id}'>\n\t\t\t<input type='hidden' name='templateid' value='{$templateid}'> " . $pagination->getListFooter() . "</form>"; $template_org = str_replace("{product_display_limit}", $slidertag, $template_org); $template_org = str_replace("{pagination}", '', $template_org); } $template_org = str_replace("{pagination}", $slidertag, $template_org); } $template_org = str_replace("{product_display_limit}", "", $template_org); if (strstr($template_org, "perpagelimit:")) { $perpage = explode('{perpagelimit:', $template_org); $perpage = explode('}', $perpage[1]); $template_org = str_replace("{perpagelimit:" . intval($perpage[0]) . "}", "", $template_org); } $template_org = str_replace("{order_by}", $orderby_form, $template_org); $template_org = str_replace("{order_by_lbl}", JText::_('COM_REDSHOP_SELECT_ORDER_BY'), $template_org); $template_org = str_replace("{filter_by_lbl}", JText::_('COM_REDSHOP_SELECT_FILTER_BY'), $template_org); $template_org = str_replace("{attribute_price_with_vat}", "", $template_org); $template_org = str_replace("{attribute_price_without_vat}", "", $template_org); $template_org = str_replace("{product_loop_start}", "", $template_org); $template_org = str_replace("{product_loop_end}", "", $template_org); $template_org = str_replace($template_tmp_desc, $data, $template_org); $template_org = str_replace("{with_vat}", "", $template_org); $template_org = str_replace("{without_vat}", "", $template_org); $template_org = $redTemplate->parseredSHOPplugin($template_org); $template_org = $texts->replace_texts($template_org); eval("?>" . $template_org . "<?php "); } else { echo "<br><h3>" . JText::_('COM_REDSHOP_MSG_SORRY_NO_RESULT_FOUND') . "</h3>"; } }
<?php /** * @package RedSHOP.Frontend * @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; JHTML::_('behavior.tooltip'); JHTMLBehavior::modal(); $objhelper = new redhelper(); $config = new Redconfiguration(); $producthelper = new producthelper(); $extraField = new extraField(); $redTemplate = new Redtemplate(); $stockroomhelper = new rsstockroomhelper(); $url = JURI::base(); $model = $this->getModel('category'); $loadCategorytemplate = $redTemplate->getTemplate('categoryproduct'); if (count($loadCategorytemplate) > 0 && $loadCategorytemplate[0]->template_desc != "") { $template_desc = $loadCategorytemplate[0]->template_desc; } else { $template_desc = "<div><div>{print}</div>"; $template_desc .= "<div>{filter_by_lbl}{filter_by}</div>"; $template_desc .= "<div>{order_by_lbl}{order_by}</div>"; $template_desc .= "<p>{category_loop_start}</p>"; $template_desc .= "<div style='border: 1px solid;'><div id='categories'><div style='width: 200px;'>"; $template_desc .= "<div class='category_image'>{category_thumb_image}</div><div class='category_description'>"; $template_desc .= "<h4 class='category_title'>{category_name}</h4>{category_description}</div></div></div>";
/** * shipping rate calculator */ public function shippingrate_calc() { $document = JFactory::getDocument(); JHTML::Script('commmon.js', 'components/com_redshop/assets/js/', false); $redConfig = new Redconfiguration(); $countryarray = $redConfig->getCountryList(); $post['country_code'] = $countryarray['country_code']; $conutry = $countryarray['country_dropdown']; $statearray = $redConfig->getStateList($post); $state = $statearray['state_dropdown']; $shipping_calc = "<form name='adminForm' id='adminForm'>"; $shipping_calc .= "<label>" . JText::_('COM_REDSHOP_COUNTRY') . "</label><br />"; $shipping_calc .= $conutry; $shipping_calc .= "<div id='div_state_lbl'><label>" . JText::_('COM_REDSHOP_STATE') . "</label></div>"; $shipping_calc .= "<div id='div_state_txt'>" . $state . "</div>"; $shipping_calc .= "<br />"; $shipping_calc .= "<label>" . JText::_('COM_REDSHOP_ZIPCODE') . "</label><br />"; $shipping_calc .= "<input type='text' name='zipcode' id='zip_code' />"; $shipping_calc .= "<br />"; $shipping_calc .= "<input class='blackbutton' type='button' name='shippingcalc' id='shippingcalc' value='" . JText::_('COM_REDSHOP_UPDATE') . "' onClick='javascript:getShippingrate();' />"; $shipping_calc .= "</form>"; return $shipping_calc; }
<?php /** * @package RedSHOP.Frontend * @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; $producthelper = new producthelper(); $extra_field = new extra_field(); $redTemplate = new Redtemplate(); $redhelper = new redhelper(); $extraField = new extraField(); $Redconfiguration = new Redconfiguration(); JHTML::_('behavior.tooltip'); JHTMLBehavior::modal(); $url = JURI::base(); $user = JFactory::getUser(); $model = $this->getModel('manufacturers'); $Itemid = JRequest::getInt('Itemid'); $print = JRequest::getInt('print'); $order_by_select = JRequest::getString('order_by', DEFAULT_MANUFACTURER_PRODUCT_ORDERING_METHOD); $filter_by_select = JRequest::getString('filter_by', 0); $document = JFactory::getDocument(); $manufacturer = $this->detail[0]; $limit = $model->getProductLimit(); $app = JFactory::getApplication(); $router = $app->getRouter(); $uri = new JURI('index.php?option=com_redshop&view=manufacturers&layout=products&mid=' . $manufacturer->manufacturer_id . '&Itemid=' . $Itemid . '&limit=' . $limit . '&order_by=' . $order_by_select . '&filter_by=' . $filter_by_select);
<?php /** * @package RedSHOP.Backend * @subpackage Template * * @copyright Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ $config = new Redconfiguration(); $option = JRequest::getVar('option'); $lists = $this->lists; ?> <script language="javascript" type="text/javascript"> Joomla.submitbutton = function (pressbutton) { submitbutton(pressbutton); } submitbutton = function (pressbutton) { var form = document.adminForm; if (pressbutton) { form.task.value = pressbutton; } if ((pressbutton == 'add') || (pressbutton == 'edit') || (pressbutton == 'remove') || (pressbutton == 'auto_syncpublish') || (pressbutton == 'auto_syncunpublish') || (pressbutton == 'publish') || (pressbutton == 'unpublish') || (pressbutton == 'usetoallpublish') || (pressbutton == 'usetoallunpublish')) { form.view.value = "xmlexport_detail"; } try { form.onsubmit(); } catch (e) { } form.submit();
<?php /** * @package RedSHOP.Frontend * @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; $redconfig = new Redconfiguration(); $redTemplate = new Redtemplate(); $model = $this->getModel('ratings'); $main_template = $redTemplate->getTemplate("review"); if (count($main_template) > 0 && $main_template[0]->template_desc) { $main_template = $main_template[0]->template_desc; } else { $main_template = "<div>{product_loop_start}<p><strong>{product_title}</strong></p><div>{review_loop_start}<div id=\"reviews_wrapper\"><div id=\"reviews_rightside\"><div id=\"reviews_fullname\">{fullname}</div><div id=\"reviews_title\">{title}</div><div id=\"reviews_comment\">{comment}</div></div><div id=\"reviews_leftside\"><div id=\"reviews_stars\">{stars}</div></div></div>{review_loop_end}<div>{product_loop_end}</div></div></div>\t"; } if ($this->params->get('show_page_heading', 1)) { if ($this->params->get('page_title')) { ?> <h1 class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?> "> <?php echo $this->escape($this->params->get('page_title')); ?> </h1> <?php
function display($tpl = null) { $config = new Redconfiguration(); $redTemplate = new Redtemplate(); $order_functions = new order_functions(); $model = $this->getModel(); $detail = $this->get('data'); $billing = $order_functions->getBillingAddress($detail->user_id); $shipping = $order_functions->getOrderShippingUserInfo($detail->order_id); if (!$shipping) { $shipping = $billing; } $template = $redTemplate->getTemplate("shipping_pdf"); $html_template = $template[0]->template_desc; ob_start(); $order_status = $order_functions->getOrderStatusTitle($detail->order_status); $html_template = str_replace("{order_information_lbl}", JText::_('COM_REDSHOP_ORDER_INFORMATION'), $html_template); $html_template = str_replace("{order_id_lbl}", JText::_('COM_REDSHOP_ORDER_ID'), $html_template); $html_template = str_replace("{order_number_lbl}", JText::_('COM_REDSHOP_ORDER_NUMBER'), $html_template); $html_template = str_replace("{order_date_lbl}", JText::_('COM_REDSHOP_ORDER_DATE'), $html_template); $html_template = str_replace("{order_status_lbl}", JText::_('COM_REDSHOP_ORDER_STATUS'), $html_template); $html_template = str_replace("{shipping_address_info_lbl}", JText::_('COM_REDSHOP_SHIPPING_ADDRESS_INFORMATION'), $html_template); $html_template = str_replace("{shipping_firstname_lbl}", JText::_('COM_REDSHOP_FIRSTNAME'), $html_template); $html_template = str_replace("{shipping_lastname_lbl}", JText::_('COM_REDSHOP_LASTNAME'), $html_template); $html_template = str_replace("{shipping_address_lbl}", JText::_('COM_REDSHOP_ADDRESS'), $html_template); $html_template = str_replace("{shipping_zip_lbl}", JText::_('COM_REDSHOP_ZIP'), $html_template); $html_template = str_replace("{shipping_city_lbl}", JText::_('COM_REDSHOP_CITY'), $html_template); $html_template = str_replace("{shipping_country_lbl}", JText::_('COM_REDSHOP_COUNTRY'), $html_template); $html_template = str_replace("{shipping_state_lbl}", JText::_('COM_REDSHOP_STATE'), $html_template); $html_template = str_replace("{shipping_phone_lbl}", JText::_('COM_REDSHOP_PHONE'), $html_template); $html_template = str_replace("{order_id}", $detail->order_id, $html_template); $html_template = str_replace("{order_number}", $detail->order_number, $html_template); $html_template = str_replace("{order_date}", $config->convertDateFormat($detail->cdate), $html_template); $html_template = str_replace("{order_status}", $order_status, $html_template); $html_template = str_replace("{shipping_firstname}", $shipping->firstname, $html_template); $html_template = str_replace("{shipping_lastname}", $shipping->lastname, $html_template); $html_template = str_replace("{shipping_address}", $shipping->address, $html_template); $html_template = str_replace("{shipping_zip}", $shipping->zipcode, $html_template); $html_template = str_replace("{shipping_city}", $shipping->city, $html_template); $html_template = str_replace("{shipping_country}", JTEXT::_($order_functions->getCountryName($shipping->country_code)), $html_template); $html_template = str_replace("{shipping_state}", $order_functions->getStateName($shipping->state_code, $shipping->country_code), $html_template); $html_template = str_replace("{shipping_phone}", $shipping->zipcode, $html_template); // if user is company than if ($billing->is_company && $billing->company_name != "") { $html_template = str_replace("{company_name}", $billing->company_name, $html_template); $html_template = str_replace("{company_name_lbl}", JText::_('COM_REDSHOP_COMPANY_NAME'), $html_template); } else { $html_template = str_replace("{company_name}", "", $html_template); $html_template = str_replace("{company_name_lbl}", "", $html_template); } $pdfObj = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'A5', true, 'UTF-8', false); $pdfObj->SetTitle("Order :" . $detail->order_id); $pdfObj->SetAuthor('redSHOP'); $pdfObj->SetCreator('redSHOP'); $pdfObj->SetMargins(15, 15, 15); $font = 'times'; $pdfObj->SetHeaderData('', '', '', "Order " . $detail->order_id); $pdfObj->setHeaderFont(array($font, '', 10)); //$pdfObj->setFooterFont(array($font, '', 8)); $pdfObj->SetFont($font, "", 12); //$pdfObj->AliasNbPages(); $pdfObj->AddPage(); $pdfObj->WriteHTML($html_template); $pdfObj->Output("Order_" . $detail->order_id . ".pdf", "D"); exit; }
/** * @package RedSHOP.Frontend * @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; JHTML::_('behavior.tooltip'); JHTMLBehavior::modal(); require_once JPATH_COMPONENT . '/helpers/product.php'; $producthelper = new producthelper(); $redTemplate = new Redtemplate(); $extraField = new extraField(); $config = new Redconfiguration(); $url = JURI::base(); $print = JRequest::getInt('print'); $Itemid = JRequest::getInt('Itemid'); $redhelper = new redhelper(); // Page Title Start $pagetitle = JText::_('COM_REDSHOP_MANUFACTURER'); if ($this->pageheadingtag != '') { $pagetitle = $this->pageheadingtag; } ?> <h1 class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?> "> <?php
<?php /** * @package RedSHOP.Frontend * @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; $producthelper = new producthelper(); $config = new Redconfiguration(); $related_product = $producthelper->getRelatedProduct($this->pid); $template = $this->input->getString('template', ''); $relptemplate = $this->redTemplate->getTemplate("related_product", 0, $template); $related_template = $relptemplate[0]->template_desc; if (count($relptemplate) > 0) { $related_template_data = ''; $product_start = explode("{related_product_start}", $related_template); $product_end = explode("{related_product_end}", $product_start[1]); $tempdata_div_start = $product_start[0]; $tempdata_div_middle = $product_end[0]; $tempdata_div_end = $product_end[1]; $extra_field = new extraField(); $fieldArray = $extra_field->getSectionFieldList(17, 0, 0); $attribute_template = $producthelper->getAttributeTemplate($tempdata_div_middle); /************************************************************ **********************************************/ for ($r = 0; $r < count($related_product); $r++) { $related_template_data .= $tempdata_div_middle; $rlink = JRoute::_('index.php?option=com_redshop&view=product&pid=' . $related_product[$r]->product_id . '&Itemid=' . $this->itemId); if (strstr($related_template_data, "{relproduct_image_3}")) {
public function display($tpl = null) { $db = JFactory::getDbo(); $option = JRequest::getVar('option'); $document = JFactory::getDocument(); $layout = JRequest::getVar('layout'); if ($layout == "resettemplate") { $tpl = "resettemplate"; } $document->setTitle(JText::_('COM_REDSHOP_CONFIG')); $document->addScript('components/' . $option . '/assets/js/validation.js'); $document->addScript('components/' . $option . '/assets/js/select_sort.js'); $document->addStyleSheet('components/' . $option . '/assets/css/search.css'); $document->addScript('components/' . $option . '/assets/js/search.js'); $currency_data = JRequest::getVar('currency_data'); $redhelper = new redhelper(); $config = new Redconfiguration(); $redTemplate = new Redtemplate(); $extra_field = new extra_field(); $userhelper = new rsUserhelper(); $lists = array(); // Load language file $payment_lang_list = $redhelper->getallPlugins("redshop_payment"); $language = JFactory::getLanguage(); $base_dir = JPATH_ADMINISTRATOR; $language_tag = $language->getTag(); for ($l = 0; $l < count($payment_lang_list); $l++) { $extension = 'plg_redshop_payment_' . $payment_lang_list[$l]->element; $language->load($extension, $base_dir, $language_tag, true); } $configpath = JPATH_COMPONENT . '/helpers/redshop.cfg.php'; if (!is_writable($configpath)) { JError::raiseWarning(21, JText::_('COM_REDSHOP_CONFIGURATION_FILE_IS_NOT_WRITABLE')); } JToolBarHelper::title(JText::_('COM_REDSHOP_CONFIG'), 'redshop_icon-48-settings'); if (is_writable($configpath)) { JToolBarHelper::save(); JToolBarHelper::apply(); } JToolBarHelper::cancel(); jimport('joomla.html.pane'); $pane = JPane::getInstance('sliders'); $this->pane = $pane; $uri = JFactory::getURI(); $this->setLayout('default'); $model = $this->getModel('configuration'); $newsletters = $model->getnewsletters(); $templatesel = array(); $templatesel[0] = new stdClass(); $templatesel[0]->template_id = 0; $templatesel[0]->template_name = JText::_('COM_REDSHOP_SELECT'); $product_template = $redTemplate->getTemplate("product"); $compare_template = $redTemplate->getTemplate("compare_product"); $category_template = $redTemplate->getTemplate("category"); $categorylist_template = $redTemplate->getTemplate("frontpage_category"); $manufacturer_template = $redTemplate->getTemplate("manufacturer_products"); $ajax_detail_template = $redTemplate->getTemplate("ajax_cart_detail_box"); $product_template = array_merge($templatesel, $product_template); $compare_template = array_merge($templatesel, $compare_template); $category_template = array_merge($templatesel, $category_template); $categorylist_template = array_merge($templatesel, $categorylist_template); $manufacturer_template = array_merge($templatesel, $manufacturer_template); $ajax_detail_template = array_merge($templatesel, $ajax_detail_template); $shopper_groups = $userhelper->getShopperGroupList(); if (count($shopper_groups) <= 0) { $shopper_groups = array(); } $tmp = array(); $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT')); $new_shopper_group_get_value_from = array_merge($tmp, $shopper_groups); defined('CALCULATION_PRICE_DECIMAL') ? CALCULATION_PRICE_DECIMAL : define('CALCULATION_PRICE_DECIMAL', '4'); defined('NEW_SHOPPER_GROUP_GET_VALUE_FROM') ? NEW_SHOPPER_GROUP_GET_VALUE_FROM : define('NEW_SHOPPER_GROUP_GET_VALUE_FROM', '0'); defined('IMAGE_QUALITY_OUTPUT') ? IMAGE_QUALITY_OUTPUT : define('IMAGE_QUALITY_OUTPUT', '70'); $lists['new_shopper_group_get_value_from'] = JHTML::_('select.genericlist', $new_shopper_group_get_value_from, 'new_shopper_group_get_value_from', 'class="inputbox" ', 'value', 'text', NEW_SHOPPER_GROUP_GET_VALUE_FROM); defined('MANUFACTURER_TITLE_MAX_CHARS') ? MANUFACTURER_TITLE_MAX_CHARS : define('MANUFACTURER_TITLE_MAX_CHARS', ''); defined('MANUFACTURER_TITLE_END_SUFFIX') ? MANUFACTURER_TITLE_END_SUFFIX : define('MANUFACTURER_TITLE_END_SUFFIX', ''); defined('WRITE_REVIEW_IS_LIGHTBOX') ? WRITE_REVIEW_IS_LIGHTBOX : define('WRITE_REVIEW_IS_LIGHTBOX', '0'); $lists['write_review_is_lightbox'] = JHTML::_('select.booleanlist', 'write_review_is_lightbox', 'class="inputbox" ', WRITE_REVIEW_IS_LIGHTBOX); defined('NOOF_SUBATTRIB_THUMB_FOR_SCROLLER') ? NOOF_SUBATTRIB_THUMB_FOR_SCROLLER : define('NOOF_SUBATTRIB_THUMB_FOR_SCROLLER', '3'); defined('ACCESSORY_PRODUCT_IN_LIGHTBOX') ? ACCESSORY_PRODUCT_IN_LIGHTBOX : define('ACCESSORY_PRODUCT_IN_LIGHTBOX', '0'); $lists['accessory_product_in_lightbox'] = JHTML::_('select.booleanlist', 'accessory_product_in_lightbox', 'class="inputbox" ', ACCESSORY_PRODUCT_IN_LIGHTBOX); $show_price_user_group_list = explode(',', SHOW_PRICE_USER_GROUP_LIST); defined('REQUESTQUOTE_IMAGE') ? REQUESTQUOTE_IMAGE : define('REQUESTQUOTE_IMAGE', 'requestquote.gif'); defined('REQUESTQUOTE_BACKGROUND') ? REQUESTQUOTE_BACKGROUND : define('REQUESTQUOTE_BACKGROUND', 'requestquotebg.jpg'); defined('WEBPACK_ENABLE_SMS') ? WEBPACK_ENABLE_SMS : define('WEBPACK_ENABLE_SMS', '1'); $lists['webpack_enable_sms'] = JHTML::_('select.booleanlist', 'webpack_enable_sms', 'class="inputbox" size="1"', WEBPACK_ENABLE_SMS); defined('WEBPACK_ENABLE_EMAIL_TRACK') ? WEBPACK_ENABLE_EMAIL_TRACK : define('WEBPACK_ENABLE_EMAIL_TRACK', '1'); $lists['webpack_enable_email_track'] = JHTML::_('select.booleanlist', 'webpack_enable_email_track', 'class="inputbox" size="1"', WEBPACK_ENABLE_EMAIL_TRACK); defined('DEFAULT_STOCKAMOUNT_THUMB_WIDTH') ? DEFAULT_STOCKAMOUNT_THUMB_WIDTH : define('DEFAULT_STOCKAMOUNT_THUMB_WIDTH', '150'); defined('DEFAULT_STOCKAMOUNT_THUMB_HEIGHT') ? DEFAULT_STOCKAMOUNT_THUMB_HEIGHT : define('DEFAULT_STOCKAMOUNT_THUMB_HEIGHT', '90'); defined('AJAX_DETAIL_BOX_WIDTH') ? AJAX_DETAIL_BOX_WIDTH : define('AJAX_DETAIL_BOX_WIDTH', '500'); defined('AJAX_DETAIL_BOX_HEIGHT') ? AJAX_DETAIL_BOX_HEIGHT : define('AJAX_DETAIL_BOX_HEIGHT', '600'); defined('AJAX_BOX_WIDTH') ? AJAX_BOX_WIDTH : define('AJAX_BOX_WIDTH', '500'); defined('AJAX_BOX_HEIGHT') ? AJAX_BOX_HEIGHT : define('AJAX_BOX_HEIGHT', '150'); $q = "SELECT country_3_code as value,country_name as text,country_jtext from #__" . TABLE_PREFIX . "_country ORDER BY country_name ASC"; $db->setQuery($q); $countries = $db->loadObjectList(); $countries = $redhelper->convertLanguageString($countries); $q = "SELECT stockroom_id as value,stockroom_name as text from #__" . TABLE_PREFIX . "_stockroom ORDER BY stockroom_name ASC"; $db->setQuery($q); $stockroom = $db->loadObjectList(); $country_list = explode(',', COUNTRY_LIST); $tmp = array(); $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT')); $economic_accountgroup = $redhelper->getEconomicAccountGroup(); $economic_accountgroup = array_merge($tmp, $economic_accountgroup); $lists['default_economic_account_group'] = JHTML::_('select.genericlist', $economic_accountgroup, 'default_economic_account_group', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_ECONOMIC_ACCOUNT_GROUP); defined('ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC') ? ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC : define('ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC', '0'); $tmpoption = array(); $tmpoption[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_NO')); $tmpoption[] = JHTML::_('select.option', 1, JText::_('COM_REDSHOP_ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC_LBL')); $tmpoption[] = JHTML::_('select.option', 2, JText::_('COM_REDSHOP_ATTRIBUTE_PLUS_PRODUCT_IN_ECONOMIC_LBL')); $lists['attribute_as_product_in_economic'] = JHTML::_('select.genericlist', $tmpoption, 'attribute_as_product_in_economic', 'class="inputbox" size="1" ', 'value', 'text', ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC); defined('DETAIL_ERROR_MESSAGE_ON') ? DETAIL_ERROR_MESSAGE_ON : define('DETAIL_ERROR_MESSAGE_ON', '1'); $lists['detail_error_message_on'] = JHTML::_('select.booleanlist', 'detail_error_message_on', 'class="inputbox" ', DETAIL_ERROR_MESSAGE_ON); defined('PRODUCT_DETAIL_LIGHTBOX_CLOSE_BUTTON_IMAGE') ? PRODUCT_DETAIL_LIGHTBOX_CLOSE_BUTTON_IMAGE : define('PRODUCT_DETAIL_LIGHTBOX_CLOSE_BUTTON_IMAGE', ''); $lists['newsletters'] = JHTML::_('select.genericlist', $newsletters, 'default_newsletter', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_NEWSLETTER); $lists['currency_data'] = JHTML::_('select.genericlist', $currency_data, 'currency_code', 'class="inputbox" size="1" ', 'value', 'text', CURRENCY_CODE); defined('USE_ENCODING') ? USE_ENCODING : define('USE_ENCODING', '0'); $lists['use_encoding'] = JHTML::_('select.booleanlist', 'use_encoding', 'class="inputbox" ', USE_ENCODING); defined('REQUIRED_VAT_NUMBER') ? REQUIRED_VAT_NUMBER : define('REQUIRED_VAT_NUMBER', '1'); $lists['required_vat_number'] = JHTML::_('select.booleanlist', 'required_vat_number', 'class="inputbox" ', REQUIRED_VAT_NUMBER); $lists['coupons_enable'] = JHTML::_('select.booleanlist', 'coupons_enable', 'class="inputbox" ', COUPONS_ENABLE); $lists['vouchers_enable'] = JHTML::_('select.booleanlist', 'vouchers_enable', 'class="inputbox" ', VOUCHERS_ENABLE); $lists['manufacturer_mail_enable'] = JHTML::_('select.booleanlist', 'manufacturer_mail_enable', 'class="inputbox" ', MANUFACTURER_MAIL_ENABLE); defined('SUPPLIER_MAIL_ENABLE') ? SUPPLIER_MAIL_ENABLE : define('SUPPLIER_MAIL_ENABLE', '0'); defined('COMPARE_PRODUCT_THUMB_WIDTH') ? COMPARE_PRODUCT_THUMB_WIDTH : define('COMPARE_PRODUCT_THUMB_WIDTH', '70'); defined('COMPARE_PRODUCT_THUMB_HEIGHT') ? COMPARE_PRODUCT_THUMB_HEIGHT : define('COMPARE_PRODUCT_THUMB_HEIGHT', '70'); $lists['supplier_mail_enable'] = JHTML::_('select.booleanlist', 'supplier_mail_enable', 'class="inputbox" ', SUPPLIER_MAIL_ENABLE); $lists['splitable_payment'] = JHTML::_('select.booleanlist', 'splitable_payment', 'class="inputbox"', SPLITABLE_PAYMENT); $lists['show_captcha'] = JHTML::_('select.booleanlist', 'show_captcha', 'class="inputbox"', SHOW_CAPTCHA); $lists['create_account_checkbox'] = JHTML::_('select.booleanlist', 'create_account_checkbox', 'class="inputbox"', CREATE_ACCOUNT_CHECKBOX); $lists['show_email_verification'] = JHTML::_('select.booleanlist', 'show_email_verification', 'class="inputbox"', SHOW_EMAIL_VERIFICATION); $lists['quantity_text_display'] = JHTML::_('select.booleanlist', 'quantity_text_display', 'class="inputbox"', QUANTITY_TEXT_DISPLAY); $lists['enable_sef_product_number'] = JHTML::_('select.booleanlist', 'enable_sef_product_number', 'class="inputbox"', ENABLE_SEF_PRODUCT_NUMBER); $lists['enable_sef_number_name'] = JHTML::_('select.booleanlist', 'enable_sef_number_name', 'class="inputbox"', ENABLE_SEF_NUMBER_NAME, 'COM_REDSHOP_NAME', 'COM_REDSHOP_ID'); $lists['category_in_sef_url'] = JHTML::_('select.booleanlist', 'category_in_sef_url', 'class="inputbox"', CATEGORY_IN_SEF_URL); $lists['autogenerated_seo'] = JHTML::_('select.booleanlist', 'autogenerated_seo', 'class="inputbox"', AUTOGENERATED_SEO); $lists['shop_country'] = JHTML::_('select.genericlist', $countries, 'shop_country', 'class="inputbox" size="1" ', 'value', 'text', SHOP_COUNTRY); $lists['default_shipping_country'] = JHTML::_('select.genericlist', $countries, 'default_shipping_country', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_SHIPPING_COUNTRY); // Default_shipping_country $lists['show_shipping_in_cart'] = JHTML::_('select.booleanlist', 'show_shipping_in_cart', 'class="inputbox"', SHOW_SHIPPING_IN_CART); $lists['discount_mail_send'] = JHTML::_('select.booleanlist', 'discount_mail_send', 'class="inputbox"', DISCOUNT_MAIL_SEND); defined('SPECIAL_DISCOUNT_MAIL_SEND') ? SPECIAL_DISCOUNT_MAIL_SEND : define('SPECIAL_DISCOUNT_MAIL_SEND', '1'); $lists['special_discount_mail_send'] = JHTML::_('select.booleanlist', 'special_discount_mail_send', 'class="inputbox"', SPECIAL_DISCOUNT_MAIL_SEND); $lists['economic_integration'] = JHTML::_('select.booleanlist', 'economic_integration', 'class="inputbox"', ECONOMIC_INTEGRATION); $discoupon_percent_or_total = array(JHTML::_('select.option', 0, JText::_('COM_REDSHOP_TOTAL')), JHTML::_('select.option', 1, JText::_('COM_REDSHOP_PERCENTAGE'))); $lists['discoupon_percent_or_total'] = JHTML::_('select.genericlist', $discoupon_percent_or_total, 'discoupon_percent_or_total', 'class="inputbox" size="1"', 'value', 'text', DISCOUPON_PERCENT_OR_TOTAL); $lists['use_container'] = JHTML::_('select.booleanlist', 'use_container', 'class="inputbox" size="1"', USE_CONTAINER); $lists['use_stockroom'] = JHTML::_('select.booleanlist', 'use_stockroom', 'class="inputbox" size="1"', USE_STOCKROOM); $lists['use_blank_as_infinite'] = JHTML::_('select.booleanlist', 'use_blank_as_infinite', 'class="inputbox" size="1"', USE_BLANK_AS_INFINITE); $lists['allow_pre_order'] = JHTML::_('select.booleanlist', 'allow_pre_order', 'class="inputbox" size="1"', ALLOW_PRE_ORDER); $lists['onestep_checkout_enable'] = JHTML::_('select.booleanlist', 'onestep_checkout_enable', 'class="inputbox" size="1"', ONESTEP_CHECKOUT_ENABLE); $lists['ssl_enable_in_checkout'] = JHTML::_('select.booleanlist', 'ssl_enable_in_checkout', 'class="inputbox" size="1"', SSL_ENABLE_IN_CHECKOUT); $lists['twoway_related_product'] = JHTML::_('select.booleanlist', 'twoway_related_product', 'class="inputbox" size="1"', TWOWAY_RELATED_PRODUCT); // For child product opttion defined('CHILDPRODUCT_DROPDOWN') ? CHILDPRODUCT_DROPDOWN : define('CHILDPRODUCT_DROPDOWN', 'product_name'); $chilproduct_data = $redhelper->getChildProductOption(); $lists['childproduct_dropdown'] = JHTML::_('select.genericlist', $chilproduct_data, 'childproduct_dropdown', 'class="inputbox" size="1" ', 'value', 'text', CHILDPRODUCT_DROPDOWN); defined('PURCHASE_PARENT_WITH_CHILD') ? PURCHASE_PARENT_WITH_CHILD : define('PURCHASE_PARENT_WITH_CHILD', '0'); $lists['purchase_parent_with_child'] = JHTML::_('select.booleanlist', 'purchase_parent_with_child', 'class="inputbox" size="1"', PURCHASE_PARENT_WITH_CHILD); $lists['product_hover_image_enable'] = JHTML::_('select.booleanlist', 'product_hover_image_enable', 'class="inputbox" size="1"', PRODUCT_HOVER_IMAGE_ENABLE); $lists['additional_hover_image_enable'] = JHTML::_('select.booleanlist', 'additional_hover_image_enable', 'class="inputbox" size="1"', ADDITIONAL_HOVER_IMAGE_ENABLE); $lists['ssl_enable_in_backend'] = JHTML::_('select.booleanlist', 'ssl_enable_in_backend', 'class="inputbox" size="1"', SSL_ENABLE_IN_BACKEND); $lists['use_tax_exempt'] = JHTML::_('select.booleanlist', 'use_tax_exempt', 'class="inputbox" size="1"', USE_TAX_EXEMPT); $lists['tax_exempt_apply_vat'] = JHTML::_('select.booleanlist', 'tax_exempt_apply_vat', 'class="inputbox" size="1"', TAX_EXEMPT_APPLY_VAT); $lists['couponinfo'] = JHTML::_('select.booleanlist', 'couponinfo', 'class="inputbox" size="1"', COUPONINFO); $lists['my_tags'] = JHTML::_('select.booleanlist', 'my_tags', 'class="inputbox" size="1"', MY_TAGS); $lists['my_wishlist'] = JHTML::_('select.booleanlist', 'my_wishlist', 'class="inputbox" size="1"', MY_WISHLIST); $lists['compare_products'] = JHTML::_('select.booleanlist', 'compare_products', 'class="inputbox" size="1"', COMARE_PRODUCTS); $lists['country_list'] = JHTML::_('select.genericlist', $countries, 'country_list[]', 'class="inputbox" multiple="multiple"', 'value', 'text', $country_list); $lists['product_detail_is_lightbox'] = JHTML::_('select.booleanlist', 'product_detail_is_lightbox', 'class="inputbox" size="1"', PRODUCT_DETAIL_IS_LIGHTBOX); $lists['new_customer_selection'] = JHTML::_('select.booleanlist', 'new_customer_selection', 'class="inputbox" size="1"', NEW_CUSTOMER_SELECTION); $lists['ajax_cart_box'] = JHTML::_('select.booleanlist', 'ajax_cart_box', 'class="inputbox" size="1"', AJAX_CART_BOX); $lists['is_product_reserve'] = JHTML::_('select.booleanlist', 'is_product_reserve', 'class="inputbox" size="1"', IS_PRODUCT_RESERVE); $lists['product_is_lightbox'] = JHTML::_('select.booleanlist', 'product_is_lightbox', 'class="inputbox" size="1"', PRODUCT_IS_LIGHTBOX); $lists['product_addimg_is_lightbox'] = JHTML::_('select.booleanlist', 'product_addimg_is_lightbox', 'class="inputbox" size="1"', PRODUCT_ADDIMG_IS_LIGHTBOX); $lists['cat_is_lightbox'] = JHTML::_('select.booleanlist', 'cat_is_lightbox', 'class="inputbox" size="1"', CAT_IS_LIGHTBOX); $lists['default_stockroom'] = JHTML::_('select.genericlist', $stockroom, 'default_stockroom', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_STOCKROOM); $lists['portalshop'] = JHTML::_('select.booleanlist', 'portal_shop', 'class="inputbox" size="1"', PORTAL_SHOP); $lists['use_image_size_swapping'] = JHTML::_('select.booleanlist', 'use_image_size_swapping', 'class="inputbox" size="1"', USE_IMAGE_SIZE_SWAPPING); $lists['apply_vat_on_discount'] = JHTML::_('select.booleanlist', 'apply_vat_on_discount', 'class="inputbox" size="1"', APPLY_VAT_ON_DISCOUNT, $yes = JText::_('COM_REDSHOP_BEFORE_DISCOUNT'), $no = JText::_('COM_REDSHOP_AFTER_DISCOUNT')); $lists['auto_scroll_wrapper'] = JHTML::_('select.booleanlist', 'auto_scroll_wrapper', 'class="inputbox" size="1"', AUTO_SCROLL_WRAPPER); $lists['allow_multiple_discount'] = JHTML::_('select.booleanlist', 'allow_multiple_discount', 'class="inputbox" size="1"', ALLOW_MULTIPLE_DISCOUNT); defined('SHOW_PRODUCT_DETAIL') ? SHOW_PRODUCT_DETAIL : define('SHOW_PRODUCT_DETAIL', '1'); $lists['show_product_detail'] = JHTML::_('select.booleanlist', 'show_product_detail', 'class="inputbox" size="1"', SHOW_PRODUCT_DETAIL); $lists['compare_template_id'] = JHTML::_('select.genericlist', $compare_template, 'compare_template_id', 'class="inputbox" size="1" ', 'template_id', 'template_name', COMPARE_TEMPLATE_ID); defined('SHOW_TERMS_AND_CONDITIONS') ? SHOW_TERMS_AND_CONDITIONS : define('SHOW_TERMS_AND_CONDITIONS', '0'); $lists['show_terms_and_conditions'] = JHTML::_('select.booleanlist', 'show_terms_and_conditions', 'class="inputbox" size="1"', SHOW_TERMS_AND_CONDITIONS, $yes = JText::_('COM_REDSHOP_SHOW_PER_USER'), $no = JText::_('COM_REDSHOP_SHOW_PER_ORDER')); defined('RATING_REVIEW_LOGIN_REQUIRED') ? RATING_REVIEW_LOGIN_REQUIRED : define('RATING_REVIEW_LOGIN_REQUIRED', '1'); $lists['rating_review_login_required'] = JHTML::_('select.booleanlist', 'rating_review_login_required', 'class="inputbox" size="1"', RATING_REVIEW_LOGIN_REQUIRED); $product_comparison = array(); $product_comparison[] = JHTML::_('select.option', '', JText::_('COM_REDSHOP_SELECT')); $product_comparison[] = JHTML::_('select.option', 'category', JText::_('COM_REDSHOP_CATEGORY')); $product_comparison[] = JHTML::_('select.option', 'global', JText::_('COM_REDSHOP_GLOBAL')); $pagination = array(0 => array("value" => 0, "text" => "Joomla"), 1 => array("value" => 1, "text" => "Redshop")); $lists['product_comparison_type'] = JHTML::_('select.genericlist', $product_comparison, 'product_comparison_type', 'class="inputbox" size="1"', 'value', 'text', PRODUCT_COMPARISON_TYPE); $lists['pagination'] = JHTML::_('select.genericlist', $pagination, 'pagination', 'class="inputbox" size="1" ', 'value', 'text', PAGINATION); $lists['newsletter_enable'] = JHTML::_('select.booleanlist', 'newsletter_enable', 'class="inputbox" size="1"', NEWSLETTER_ENABLE); $lists['newsletter_confirmation'] = JHTML::_('select.booleanlist', 'newsletter_confirmation', 'class="inputbox" size="1"', NEWSLETTER_CONFIRMATION); $lists['watermark_category_image'] = JHTML::_('select.booleanlist', 'watermark_category_image', 'class="inputbox" size="1"', WATERMARK_CATEGORY_IMAGE); $lists['watermark_category_thumb_image'] = JHTML::_('select.booleanlist', 'watermark_category_thumb_image', 'class="inputbox" size="1"', WATERMARK_CATEGORY_THUMB_IMAGE); $lists['watermark_product_image'] = JHTML::_('select.booleanlist', 'watermark_product_image', 'class="inputbox" size="1"', WATERMARK_PRODUCT_IMAGE); $lists['watermark_product_thumb_image'] = JHTML::_('select.booleanlist', 'watermark_product_thumb_image', 'class="inputbox" size="1"', WATERMARK_PRODUCT_THUMB_IMAGE); defined('WATERMARK_PRODUCT_ADDITIONAL_IMAGE') ? WATERMARK_PRODUCT_ADDITIONAL_IMAGE : define('WATERMARK_PRODUCT_ADDITIONAL_IMAGE', '0'); $lists['watermark_product_additional_image'] = JHTML::_('select.booleanlist', 'watermark_product_additional_image', 'class="inputbox" size="1"', WATERMARK_PRODUCT_ADDITIONAL_IMAGE); $lists['watermark_cart_thumb_image'] = JHTML::_('select.booleanlist', 'watermark_cart_thumb_image', 'class="inputbox" size="1"', WATERMARK_CART_THUMB_IMAGE); $lists['watermark_giftcart_image'] = JHTML::_('select.booleanlist', 'watermark_giftcart_image', 'class="inputbox" size="1"', WATERMARK_GIFTCART_IMAGE); $lists['watermark_giftcart_thumb_image'] = JHTML::_('select.booleanlist', 'watermark_giftcart_thumb_image', 'class="inputbox" size="1"', WATERMARK_GIFTCART_THUMB_IMAGE); $lists['watermark_manufacturer_thumb_image'] = JHTML::_('select.booleanlist', 'watermark_manufacturer_thumb_image', 'class="inputbox" size="1"', WATERMARK_MANUFACTURER_THUMB_IMAGE); $lists['watermark_manufacturer_image'] = JHTML::_('select.booleanlist', 'watermark_manufacturer_image', 'class="inputbox" size="1"', WATERMARK_MANUFACTURER_IMAGE); $lists['clickatell_enable'] = JHTML::_('select.booleanlist', 'clickatell_enable', 'class="inputbox" size="1"', CLICKATELL_ENABLE); $lists['quotation_mode'] = JHTML::_('select.booleanlist', 'default_quotation_mode', 'onclick="return quote_price(this.value);" class="inputbox" size="1"', DEFAULT_QUOTATION_MODE_PRE, $yes = JText::_('COM_REDSHOP_ON'), $no = JText::_('COM_REDSHOP_OFF')); $lists['wanttoshowattributeimage'] = JHTML::_('select.booleanlist', 'wanttoshowattributeimage', 'class="inputbox" size="1"', WANT_TO_SHOW_ATTRIBUTE_IMAGE_INCART); $lists['show_quotation_price'] = JHTML::_('select.booleanlist', 'show_quotation_price', 'class="inputbox" size="1"', SHOW_QUOTATION_PRICE); $lists['display_out_of_stock_attribute_data'] = JHTML::_('select.booleanlist', 'display_out_of_stock_attribute_data', 'class="inputbox"', DISPLAY_OUT_OF_STOCK_ATTRIBUTE_DATA); $orderstatus = $model->getOrderstatus(); $tmp = array(); $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT')); $orderstatus = array_merge($tmp, $orderstatus); $lists['clickatell_order_status'] = JHTML::_('select.genericlist', $orderstatus, 'clickatell_order_status', 'class="inputbox" size="1" ', 'value', 'text', CLICKATELL_ORDER_STATUS); $menuitem = array(); $menuitem[0] = new stdClass(); $menuitem[0]->value = 0; $menuitem[0]->text = JText::_('COM_REDSHOP_SELECT'); $q = "SELECT m.id,m.title AS name,mt.title FROM #__menu AS m " . "LEFT JOIN #__menu_types AS mt ON mt.menutype=m.menutype " . "WHERE m.published=1 " . "ORDER BY m.menutype,m.ordering"; $db->setQuery($q); $menuitemlist = $db->loadObjectList(); for ($i = 0; $i < count($menuitemlist); $i++) { $menuitem[$i + 1] = new stdClass(); $menuitem[$i + 1]->value = $menuitemlist[$i]->id; $menuitem[$i + 1]->text = $menuitemlist[$i]->name; } $lists['url_after_portal_login'] = JHTML::_('select.genericlist', $menuitem, 'portal_login_itemid', 'class="inputbox" size="1" ', 'value', 'text', PORTAL_LOGIN_ITEMID); $lists['url_after_portal_logout'] = JHTML::_('select.genericlist', $menuitem, 'portal_logout_itemid', 'class="inputbox" size="1" ', 'value', 'text', PORTAL_LOGOUT_ITEMID); $default_vat_group = $model->getVatGroup(); $tmp = array(); $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT')); $default_vat_group = array_merge($tmp, $default_vat_group); $tmp = array(); $tmp[] = JHTML::_('select.option', '', JText::_('COM_REDSHOP_SELECT')); $default_vat_country = array_merge($tmp, $countries); $default_customer_register_type = array(); $default_customer_register_type[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT')); $default_customer_register_type[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_PRIVATE')); $default_customer_register_type[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_COMPANY')); $lists['default_customer_register_type'] = JHTML::_('select.genericlist', $default_customer_register_type, 'default_customer_register_type', 'class="inputbox" ', 'value', 'text', DEFAULT_CUSTOMER_REGISTER_TYPE); $addtocart_behaviour = array(); $addtocart_behaviour[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT')); $addtocart_behaviour[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_DIRECT_TO_CART')); $addtocart_behaviour[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_STAY_ON_CURRENT_VIEW')); $lists['addtocart_behaviour'] = JHTML::_('select.genericlist', $addtocart_behaviour, 'addtocart_behaviour', 'class="inputbox" ', 'value', 'text', ADDTOCART_BEHAVIOUR); $allow_customer_register_type = array(); $allow_customer_register_type[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_BOTH')); $allow_customer_register_type[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_PRIVATE')); $allow_customer_register_type[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_COMPANY')); $lists['allow_customer_register_type'] = JHTML::_('select.genericlist', $allow_customer_register_type, 'allow_customer_register_type', 'class="inputbox" ', 'value', 'text', ALLOW_CUSTOMER_REGISTER_TYPE); // Optional shipping address select box $lists['optional_shipping_address'] = JHTML::_('select.booleanlist', 'optional_shipping_address', 'class="inputbox" ', OPTIONAL_SHIPPING_ADDRESS); $lists['shipping_method_enable'] = JHTML::_('select.booleanlist', 'shipping_method_enable', 'class="inputbox" ', SHIPPING_METHOD_ENABLE); $lists['default_vat_group'] = JHTML::_('select.genericlist', $default_vat_group, 'default_vat_group', 'class="inputbox" ', 'value', 'text', DEFAULT_VAT_GROUP); $vat_based_on = array(); $vat_based_on[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_WEBSHOP_MODE')); $vat_based_on[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_CUSTOMER_MODE')); $vat_based_on[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_EU_MODE')); $lists['vat_based_on'] = JHTML::_('select.genericlist', $vat_based_on, 'vat_based_on', 'class="inputbox" ', 'value', 'text', VAT_BASED_ON); $lists['default_vat_country'] = JHTML::_('select.genericlist', $default_vat_country, 'default_vat_country', 'class="inputbox" onchange="changeStateList();"', 'value', 'text', DEFAULT_VAT_COUNTRY); $country_list_name = 'default_vat_country'; $state_list_name = 'default_vat_state'; $selected_country_code = DEFAULT_VAT_COUNTRY; $selected_state_code = DEFAULT_VAT_STATE; if (empty($selected_state_code)) { $selected_state_code = "originalPos"; } else { $selected_state_code = "'" . $selected_state_code . "'"; } $db->setQuery("SELECT c.country_id, c.country_3_code, s.state_name, s.state_2_code\n\t\t\t\t\t\tFROM #__" . TABLE_PREFIX . "_country c\n\t\t\t\t\t\tLEFT JOIN #__" . TABLE_PREFIX . "_state s\n\t\t\t\t\t\tON c.country_id=s.country_id OR s.country_id IS NULL\n\t\t\t\t\t\tORDER BY c.country_id, s.state_name"); $states = $db->loadObjectList(); // Build the State lists for each Country $script = "<script language=\"javascript\" type=\"text/javascript\">//<![CDATA[\n"; $script .= "<!--\n"; $script .= "var originalOrder = '1';\n"; $script .= "var originalPos = '{$selected_country_code}';\n"; $script .= "var states = new Array();\t// array in the format [key,value,text]\n"; $i = 0; $prev_country = ''; for ($j = 0; $j < count($states); $j++) { $state = $states[$j]; $country_3_code = $state->country_3_code; if ($state->state_name) { if ($prev_country != $country_3_code) { $script .= "states[" . $i++ . "] = new Array( '" . $country_3_code . "','',' -= " . JText::_("COM_REDSHOP_SELECT") . " =-' );\n"; } $prev_country = $country_3_code; // Array in the format [key,value,text] $script .= "states[" . $i++ . "] = new Array( '" . $country_3_code . "','" . $state->state_2_code . "','" . addslashes(JText::_($state->state_name)) . "' );\n"; } else { $script .= "states[" . $i++ . "] = new Array( '" . $country_3_code . "','','" . JText::_("COM_REDSHOP_NONE") . "' );\n"; } } $script .= "function changeStateList()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar selected_country = null;\n\t\t\t\t\t\tfor (var i=0; i<document.adminForm.default_vat_country.length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (document.adminForm." . $country_list_name . "[i].selected)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tselected_country = document.adminForm." . $country_list_name . "[i].value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchangeDynaList('" . $state_list_name . "',states,selected_country, originalPos, originalOrder);\n\t\t\t\t \t}\n\t\t\t\t \twriteDynaList( 'class=\"inputbox\" name=\"default_vat_state\" size=\"1\" id=\"default_vat_state\"',\n\t\t\t\t \tstates, originalPos, originalPos, {$selected_state_code} );\n\t\t\t\t\t//-->\n\t\t\t\t\t//]]></script>"; $lists['default_vat_state'] = $script; $shopper_Group_private = $model->getShopperGroupPrivate(); $tmp = array(); $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT')); $tmp = array_merge($tmp, $shopper_Group_private); $lists['shopper_group_default_private'] = JHTML::_('select.genericlist', $tmp, 'shopper_group_default_private', 'class="inputbox" ', 'value', 'text', SHOPPER_GROUP_DEFAULT_PRIVATE); $shopper_Group_company = $model->getShopperGroupCompany(); $tmp = array(); $tmp[] = JHTML::_('select.option', 0, JText::_('COM_REDSHOP_SELECT')); $tmp = array_merge($tmp, $shopper_Group_company); $lists['shopper_group_default_company'] = JHTML::_('select.genericlist', $tmp, 'shopper_group_default_company', 'class="inputbox" ', 'value', 'text', SHOPPER_GROUP_DEFAULT_COMPANY); $tmp = array(); $tmp[] = JHTML::_('select.option', 0, JText::_('SELECT')); $tmp = array_merge($tmp, $shopper_Group_private, $shopper_Group_company); defined('SHOPPER_GROUP_DEFAULT_UNREGISTERED') ? SHOPPER_GROUP_DEFAULT_UNREGISTERED : define('SHOPPER_GROUP_DEFAULT_UNREGISTERED', SHOPPER_GROUP_DEFAULT_PRIVATE); $lists['shopper_group_default_unregistered'] = JHTML::_('select.genericlist', $tmp, 'shopper_group_default_unregistered', 'class="inputbox" ', 'value', 'text', SHOPPER_GROUP_DEFAULT_UNREGISTERED); $register_methods = array(); $register_methods[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_REGISTER_WITH_ACCOUNT_CREATION')); $register_methods[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_REGISTER_WITHOUT_ACCOUNT_CREATION')); $register_methods[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_REGISTER_ACCOUNT_OPTIONAL')); $register_methods[] = JHTML::_('select.option', '3', JText::_('COM_REDSHOP_REGISTER_ACCOUNT_SILENT')); $lists['register_method'] = JHTML::_('select.genericlist', $register_methods, 'register_method', 'class="inputbox" id="register_method"', 'value', 'text', REGISTER_METHOD); $lists['product_template'] = JHTML::_('select.genericlist', $product_template, 'default_product_template', 'class="inputbox" size="1" ', 'template_id', 'template_name', PRODUCT_TEMPLATE); $lists['ajax_detail_template'] = JHTML::_('select.genericlist', $ajax_detail_template, 'default_ajax_detailbox_template', 'class="inputbox" size="1" ', 'template_id', 'template_name', DEFAULT_AJAX_DETAILBOX_TEMPLATE); $lists['category_template'] = JHTML::_('select.genericlist', $category_template, 'default_category_template', 'class="inputbox" size="1" ', 'template_id', 'template_name', CATEGORY_TEMPLATE); $lists['default_categorylist_template'] = JHTML::_('select.genericlist', $categorylist_template, 'default_categorylist_template', 'class="inputbox" size="1" ', 'template_id', 'template_name', DEFAULT_CATEGORYLIST_TEMPLATE); $lists['manufacturer_template'] = JHTML::_('select.genericlist', $manufacturer_template, 'default_manufacturer_template', 'class="inputbox" size="1" ', 'template_id', 'template_name', MANUFACTURER_TEMPLATE); $lists['show_price'] = JHTML::_('select.booleanlist', 'show_price', 'class="inputbox" size="1"', SHOW_PRICE_PRE); $PRE_USE_AS_CATALOG = defined('PRE_USE_AS_CATALOG') ? PRE_USE_AS_CATALOG : 0; $lists['use_as_catalog'] = JHTML::_('select.booleanlist', 'use_as_catalog', 'class="inputbox" size="1"', $PRE_USE_AS_CATALOG); $lists['show_tax_exempt_infront'] = JHTML::_('select.booleanlist', 'show_tax_exempt_infront', 'class="inputbox" size="1"', SHOW_TAX_EXEMPT_INFRONT); $lists['individual_add_to_cart_enable'] = JHTML::_('select.booleanlist', 'individual_add_to_cart_enable', 'class="inputbox" size="1"', INDIVIDUAL_ADD_TO_CART_ENABLE, JText::_('COM_REDSHOP_INDIVIDUAL_ADD_TO_CART_PER_PROPERTY'), JText::_('COM_REDSHOP_ADD_TO_CART_PER_PRODUCT')); defined('ACCESSORY_AS_PRODUCT_IN_CART_ENABLE') ? ACCESSORY_AS_PRODUCT_IN_CART_ENABLE : define('ACCESSORY_AS_PRODUCT_IN_CART_ENABLE', '0'); $lists['accessory_as_product_in_cart_enable'] = JHTML::_('select.booleanlist', 'accessory_as_product_in_cart_enable', 'class="inputbox" size="1"', ACCESSORY_AS_PRODUCT_IN_CART_ENABLE); $lists['use_product_outofstock_image'] = JHTML::_('select.booleanlist', 'use_product_outofstock_image', 'class="inputbox" size="1"', USE_PRODUCT_OUTOFSTOCK_IMAGE); defined('ENABLE_ADDRESS_DETAIL_IN_SHIPPING') ? ENABLE_ADDRESS_DETAIL_IN_SHIPPING : define('ENABLE_ADDRESS_DETAIL_IN_SHIPPING', '0'); $lists['enable_address_detail_in_shipping'] = JHTML::_('select.booleanlist', 'enable_address_detail_in_shipping', 'class="inputbox" size="1"', ENABLE_ADDRESS_DETAIL_IN_SHIPPING); defined('SEND_MAIL_TO_CUSTOMER') ? SEND_MAIL_TO_CUSTOMER : define('SEND_MAIL_TO_CUSTOMER', '1'); $lists['send_mail_to_customer'] = JHTML::_('select.booleanlist', 'send_mail_to_customer', 'class="inputbox" size="1"', SEND_MAIL_TO_CUSTOMER); $bookinvoice = array(); $bookinvoice[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_DIRECTLY_BOOK')); $bookinvoice[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_MANUALLY_BOOK')); $bookinvoice[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_BOOK_ON_ORDER_STATUS')); $lists['economic_invoice_draft'] = JHTML::_('select.genericlist', $bookinvoice, 'economic_invoice_draft', 'class="inputbox" onchange="javascript:changeBookInvoice(this.value);" ', 'value', 'text', ECONOMIC_INVOICE_DRAFT); defined('ECONOMIC_BOOK_INVOICE_NUMBER') ? ECONOMIC_BOOK_INVOICE_NUMBER : define('ECONOMIC_BOOK_INVOICE_NUMBER', '0'); $lists['economic_book_invoice_number'] = JHTML::_('select.booleanlist', 'economic_book_invoice_number', 'class="inputbox" size="1"', ECONOMIC_BOOK_INVOICE_NUMBER, JText::_('COM_REDSHOP_SEQUENTIALLY_IN_ECONOMIC_NO_MATCH_UP_WITH_ORDER_NUMBER'), JText::_('COM_REDSHOP_SAME_AS_ORDER_NUMBER')); // NEXT-PREVIOUS LINK $link_type = array(); $link_type[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_DEFAULT_LINK')); $link_type[] = JHTML::_('select.option', '1', JText::_('COM_REDSHOP_CUSTOM_LINK')); $link_type[] = JHTML::_('select.option', '2', JText::_('COM_REDSHOP_IMAGE_LINK')); $lists['next_previous_link'] = JHTML::_('select.genericlist', $link_type, 'next_previous_link', 'class="inputbox" ', 'value', 'text', DEFAULT_LINK_FIND); $order_data = $redhelper->getOrderByList(); $lists['default_product_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_product_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_PRODUCT_ORDERING_METHOD); $lists['default_manufacturer_product_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_manufacturer_product_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_MANUFACTURER_PRODUCT_ORDERING_METHOD); $order_data = $redhelper->getRelatedOrderByList(); $lists['default_related_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_related_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_RELATED_ORDERING_METHOD); $order_data = $redhelper->getAccessoryOrderByList(); $lists['default_accessory_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_accessory_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_ACCESSORY_ORDERING_METHOD); $shipping_after = defined('SHIPPING_AFTER') ? SHIPPING_AFTER : 'total'; $lists['shipping_after'] = $extra_field->rs_booleanlist('shipping_after', 'class="inputbox"', $shipping_after, $yes = JText::_('COM_REDSHOP_TOTAL'), $no = JText::_('COM_REDSHOP_SUBTOTAL_LBL'), '', 'total', 'subtotal'); $payment_calculation = defined('PAYMENT_CALCULATION_ON') ? PAYMENT_CALCULATION_ON : 'total'; $lists['payment_calculation_on'] = $extra_field->rs_booleanlist('payment_calculation_on', 'class="inputbox"', $payment_calculation, $yes = JText::_('COM_REDSHOP_TOTAL'), $no = JText::_('COM_REDSHOP_SUBTOTAL_LBL'), '', 'total', 'subtotal'); $calculate_vat_on = defined('CALCULATE_VAT_ON') ? CALCULATE_VAT_ON : 'BT'; $lists['calculate_vat_on'] = $extra_field->rs_booleanlist('calculate_vat_on', 'class="inputbox"', $calculate_vat_on, $yes = JText::_('COM_REDSHOP_BILLING_ADDRESS_LBL'), $no = JText::_('COM_REDSHOP_SHIPPING_ADDRESS_LBL'), '', 'BT', 'ST'); $order_data = array(); $order_data[0] = new stdClass(); $order_data[0]->value = "c.category_name ASC"; $order_data[0]->text = JText::_('COM_REDSHOP_CATEGORY_NAME'); $order_data[1] = new stdClass(); $order_data[1]->value = "c.category_id DESC"; $order_data[1]->text = JText::_('COM_REDSHOP_NEWEST'); $order_data[2] = new stdClass(); $order_data[2]->value = "c.ordering ASC"; $order_data[2]->text = JText::_('COM_REDSHOP_ORDERING'); $lists['default_category_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_category_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_CATEGORY_ORDERING_METHOD); $order_data = $redhelper->getManufacturerOrderByList(); $lists['default_manufacturer_ordering_method'] = JHTML::_('select.genericlist', $order_data, 'default_manufacturer_ordering_method', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_MANUFACTURER_ORDERING_METHOD); $symbol_position = array(); $symbol_position[0] = new stdClass(); $symbol_position[0]->value = " "; $symbol_position[0]->text = JText::_('COM_REDSHOP_SELECT'); $symbol_position[1] = new stdClass(); $symbol_position[1]->value = "front"; $symbol_position[1]->text = JText::_('COM_REDSHOP_FRONT'); $symbol_position[2] = new stdClass(); $symbol_position[2]->value = "behind"; $symbol_position[2]->text = JText::_('COM_REDSHOP_BEHIND'); $symbol_position[3] = new stdClass(); $symbol_position[3]->value = "none"; $symbol_position[3]->text = JText::_('COM_REDSHOP_NONE'); $lists['currency_symbol_position'] = JHTML::_('select.genericlist', $symbol_position, 'currency_symbol_position', 'class="inputbox" ', 'value', 'text', CURRENCY_SYMBOL_POSITION); $default_dateformat = $config->getDateFormat(); $lists['default_dateformat'] = JHTML::_('select.genericlist', $default_dateformat, 'default_dateformat', 'class="inputbox" ', 'value', 'text', DEFAULT_DATEFORMAT); $lists['discount_enable'] = JHTML::_('select.booleanlist', 'discount_enable', 'class="inputbox" ', DISCOUNT_ENABLE); $lists['invoice_mail_enable'] = JHTML::_('select.booleanlist', 'invoice_mail_enable', 'class="inputbox"', INVOICE_MAIL_ENABLE); $lists['enable_backendaccess'] = JHTML::_('select.booleanlist', 'enable_backendaccess', 'class="inputbox"', ENABLE_BACKENDACCESS); $lists['wishlist_login_required'] = JHTML::_('select.booleanlist', 'wishlist_login_required', 'class="inputbox"', WISHLIST_LOGIN_REQUIRED); $invoice_mail_send_option = array(); $invoice_mail_send_option[0] = new stdClass(); $invoice_mail_send_option[0]->value = 0; $invoice_mail_send_option[0]->text = JText::_('COM_REDSHOP_SELECT'); $invoice_mail_send_option[1] = new stdClass(); $invoice_mail_send_option[1]->value = 1; $invoice_mail_send_option[1]->text = JText::_('COM_REDSHOP_ADMINISTRATOR'); $invoice_mail_send_option[2] = new stdClass(); $invoice_mail_send_option[2]->value = 2; $invoice_mail_send_option[2]->text = JText::_('COM_REDSHOP_CUSTOMER'); $invoice_mail_send_option[3] = new stdClass(); $invoice_mail_send_option[3]->value = 3; $invoice_mail_send_option[3]->text = JText::_('COM_REDSHOP_BOTH'); $lists['invoice_mail_send_option'] = JHTML::_('select.genericlist', $invoice_mail_send_option, 'invoice_mail_send_option', 'class="inputbox" ', 'value', 'text', INVOICE_MAIL_SEND_OPTION); $order_mail_after = array(); $order_mail_after[0] = new stdClass(); $order_mail_after[0]->value = 0; $order_mail_after[0]->text = JText::_('COM_REDSHOP_ORDER_MAIL_BEFORE_PAYMENT'); $order_mail_after[1] = new stdClass(); $order_mail_after[1]->value = 1; $order_mail_after[1]->text = JText::_('COM_REDSHOP_ORDER_MAIL_AFTER_PAYMENT'); $lists['order_mail_after'] = JHTML::_('select.genericlist', $order_mail_after, 'order_mail_after', 'class="inputbox" ', 'value', 'text', ORDER_MAIL_AFTER); $discount_type = array(); $discount_type[0] = new stdClass(); $discount_type[0]->value = 0; $discount_type[0]->text = JText::_('COM_REDSHOP_SELECT'); $discount_type[1] = new stdClass(); $discount_type[1]->value = 1; $discount_type[1]->text = JText::_('COM_REDSHOP_DISCOUNT_OR_VOUCHER_OR_COUPON'); $discount_type[2] = new stdClass(); $discount_type[2]->value = 2; $discount_type[2]->text = JText::_('COM_REDSHOP_DISCOUNT_VOUCHER_OR_COUPON'); $discount_type[3] = new stdClass(); $discount_type[3]->value = 3; $discount_type[3]->text = JText::_('COM_REDSHOP_DISCOUNT_VOUCHER_COUPON'); $discount_type[4] = new stdClass(); $discount_type[4]->value = 4; $discount_type[4]->text = JText::_('COM_REDSHOP_DISCOUNT_VOUCHER_COUPON_MULTIPLE'); $lists['discount_type'] = JHTML::_('select.genericlist', $discount_type, 'discount_type', 'class="inputbox" ', 'value', 'text', DISCOUNT_TYPE); /* * Measurement select boxes */ $option = array(); $option[0] = new stdClass(); $option[0]->value = 0; $option[0]->text = JText::_('COM_REDSHOP_SELECT'); $option[1] = new stdClass(); $option[1]->value = 'mm'; $option[1]->text = JText::_('COM_REDSHOP_MILLIMETER'); $option[2] = new stdClass(); $option[2]->value = 'cm'; $option[2]->text = JText::_('COM_REDSHOP_CENTIMETERS'); $option[3] = new stdClass(); $option[3]->value = 'inch'; $option[3]->text = JText::_('COM_REDSHOP_INCHES'); $option[4] = new stdClass(); $option[4]->value = 'feet'; $option[4]->text = JText::_('COM_REDSHOP_FEET'); $option[5] = new stdClass(); $option[5]->value = 'm'; $option[5]->text = JText::_('COM_REDSHOP_METER'); $lists['default_volume_unit'] = JHTML::_('select.genericlist', $option, 'default_volume_unit', 'class="inputbox" ', 'value', 'text', DEFAULT_VOLUME_UNIT); unset($option); $option = array(); $option[0] = new stdClass(); $option[0]->value = 0; $option[0]->text = JText::_('COM_REDSHOP_SELECT'); $option[1] = new stdClass(); $option[1]->value = 'gram'; $option[1]->text = JText::_('COM_REDSHOP_GRAM'); $option[2] = new stdClass(); $option[2]->value = 'pounds'; $option[2]->text = JText::_('COM_REDSHOP_POUNDS'); $option[3] = new stdClass(); $option[3]->value = 'kg'; $option[3]->text = JText::_('COM_REDSHOP_KG'); $lists['default_weight_unit'] = JHTML::_('select.genericlist', $option, 'default_weight_unit', 'class="inputbox" ', 'value', 'text', DEFAULT_WEIGHT_UNIT); unset($option); $lists['postdk_integration'] = JHTML::_('select.booleanlist', 'postdk_integration', 'class="inputbox" size="1"', POSTDK_INTEGRATION); $lists['display_new_orders'] = JHTML::_('select.booleanlist', 'display_new_orders', 'class="inputbox" size="1"', DISPLAY_NEW_ORDERS); $lists['display_new_customers'] = JHTML::_('select.booleanlist', 'display_new_customers', 'class="inputbox" size="1"', DISPLAY_NEW_CUSTOMERS); $lists['display_statistic'] = JHTML::_('select.booleanlist', 'display_statistic', 'class="inputbox" size="1"', DISPLAY_STATISTIC); $lists['expand_all'] = JHTML::_('select.booleanlist', 'expand_all', 'class="inputbox" size="1"', EXPAND_ALL); $lists['send_catalog_reminder_mail'] = JHTML::_('select.booleanlist', 'send_catalog_reminder_mail', 'class="inputbox" size="1"', SEND_CATALOG_REMINDER_MAIL); $current_version = $model->getcurrentversion(); $getinstalledmodule = $model->getinstalledmodule(); $getinstalledplugins = $model->getinstalledplugins(); $getinstalledshipping = $model->getinstalledplugins('redshop_shipping'); $db_version = $db->getVersion(); $php_version = phpversion(); $server = $this->get_server_software(); $gd_check = extension_loaded('gd'); $mb_check = extension_loaded('mbstring'); $this->server = $server; $this->php_version = $php_version; $this->db_version = $db_version; $this->gd_check = $gd_check; $this->mb_check = $mb_check; $this->getinstalledmodule = $getinstalledmodule; $this->getinstalledplugins = $getinstalledplugins; $this->getinstalledshipping = $getinstalledshipping; $this->current_version = $current_version; $this->lists = $lists; $this->request_url = $uri->toString(); parent::display($tpl); }
<?php /** * @package RedSHOP.Backend * @subpackage Template * * @copyright Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/order.php'; $order_function = new order_functions(); $option = JRequest::getVar('option'); $filter = JRequest::getVar('filter'); $config = new Redconfiguration(); $model = $this->getModel('newslettersubscr'); ?> <script language="javascript" type="text/javascript"> Joomla.submitbutton = function (pressbutton) { submitbutton(pressbutton); } submitbutton = function (pressbutton) { var form = document.adminForm; form.task.value = ""; form.view.value = "newslettersubscr"; if (pressbutton) { form.task.value = pressbutton; }
* along with redSHOP; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ defined('_JEXEC') or die('Direct Access to this location is not allowed.'); // standard plugin initialize function - don't change global $sh_LANG, $sefConfig; $sefConfig =& shRouter::shGetConfig(); $db = JFactory::getDbo(); $shLangName = ''; $shLangIso = ''; $title = array(); $shItemidString = ''; $dosef = shInitializePlugin($lang = '', $shLangName, $shLangIso, $option); if (!defined('TABLE_PREFIX')) { require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/configuration.php'; $config = new Redconfiguration(); $config->config(); } if ($dosef == false) { return; } if (isset($limitstart)) { // V 1.2.4.r shRemoveFromGETVarsList('limitstart'); } // limitstart can be zero //$title[] = getMenuTitle($option, (isset($task) ? @$task : null)); //$title[] = $sh_LANG[$shLangIso]['_COM_SEF_SH_SEARCH']; $view = isset($view) ? @$view : null; $cid = isset($cid) ? @$cid : null; $mid = isset($mid) ? @$mid : null;
public function changeshippingaddress($shippingadd_id, $user_id, $is_company) { $extra_field = new extra_field(); $Redconfiguration = new Redconfiguration(); $query = 'SELECT * FROM ' . $this->_table_prefix . 'users_info ' . 'WHERE address_type like "ST" ' . 'AND user_id = ' . (int) $user_id . ' ' . 'AND users_info_id = ' . (int) $shippingadd_id; $this->_db->setQuery($query); $list = $this->_db->loadObject(); if (count($list) > 0) { $shipping = $list; } else { $shipping = $this->setShipping(); } $allowCustomer = ''; $allowCompany = ''; if ($is_company) { $allowCustomer = 'style="display:none;"'; } else { $allowCompany = 'style="display:none;"'; } // Field_section 7 :Customer Address $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $shipping->users_info_id); // Field_section 8 :Company Address $lists['shipping_company_field'] = $extra_field->list_all_field(15, $shipping->users_info_id); $countryarray = $Redconfiguration->getCountryList((array) $shipping, "country_code_ST", "ST"); $shipping->country_code_ST = $shipping->country_code = $countryarray['country_code_ST']; $lists['country_code_ST'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $shipping, "state_code_ST", "country_code_ST", "ST", 1); $lists['state_code_ST'] = $statearray['state_dropdown']; $htmlshipping = '<table class="adminlist" border="0" width="100%">'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('FIRSTNAME') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="firstname_ST" maxlength="250" value="' . $shipping->firstname . '" /></td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('LASTNAME') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="lastname_ST" maxlength="250" value="' . $shipping->lastname . '" /></td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('ADDRESS') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="address_ST" maxlength="250" value="' . $shipping->address . '" /></td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('ZIP') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="zipcode_ST" maxlength="250" value="' . $shipping->zipcode . '" /></td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('CITY') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="city_ST" maxlength="250" value="' . $shipping->city . '" /></td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('COUNTRY') . ':</td>'; $htmlshipping .= '<td>' . $lists['country_code_ST'] . '</td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('STATE') . ':</td>'; $htmlshipping .= '<td>' . $lists['state_code_ST'] . '</td></tr>'; $htmlshipping .= '<tr><td width="100" align="right">' . JText::_('PHONE') . ':</td>'; $htmlshipping .= '<td><input class="inputbox" type="text" name="phone_ST" maxlength="250" value="' . $shipping->phone . '" /></td></tr>'; $htmlshipping .= '<tr><td colspan="2"><div id="exCustomerFieldST" ' . $allowCustomer . '>' . $lists['shipping_customer_field'] . '</div> <div id="exCompanyFieldST" ' . $allowCompany . '>' . $lists['shipping_company_field'] . '</div></td></tr>'; $htmlshipping .= '</table>'; return $htmlshipping; }
public function display($tpl = null) { $option = JRequest::getVar('option'); $extra_field = new extra_field(); $order_functions = new order_functions(); $Redconfiguration = new Redconfiguration(); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_REDSHOP_ORDER')); $document->addScript('components/' . $option . '/assets/js/select_sort.js'); $document->addStyleSheet('components/' . $option . '/assets/css/search.css'); $document->addScript('components/' . $option . '/assets/js/search.js'); $document->addScript('components/' . $option . '/assets/js/json.js'); $document->addScript('components/' . $option . '/assets/js/validation.js'); $document->addScript('components/' . $option . '/assets/js/order.js'); $document->addScript('components/' . $option . '/assets/js/common.js'); $uri = JFactory::getURI(); $lists = array(); $billing = array(); $shippinginfo = array(); $model = $this->getModel(); $detail = $this->get('data'); $redhelper = new redhelper(); $payment_lang_list = $redhelper->getPlugins("redshop_payment"); $language = JFactory::getLanguage(); $base_dir = JPATH_ADMINISTRATOR; $language_tag = $language->getTag(); for ($l = 0; $l < count($payment_lang_list); $l++) { $extension = 'plg_redshop_payment_' . $payment_lang_list[$l]->element; $language->load($extension, $base_dir, $language_tag, true); } $err = JRequest::getVar('err', ''); $shipping_rate_id = JRequest::getVar('shipping_rate_id'); $user_id = JRequest::getVar('user_id', 0); if ($user_id != 0) { $billing = $order_functions->getBillingAddress($user_id); $shippinginfo = $order_functions->getShippingAddress($user_id); } else { $billing = $model->setBilling(); } $shipping_country = 0; $shipping_state = 0; $key = 0; $shippingop = array(); $shippingop[0] = new stdClass(); $shippingop[0]->users_info_id = 0; $shippingop[0]->text = JText::_('COM_REDSHOP_SELECT'); if (count($shippinginfo) > 0) { $shipping_users_info_id = JRequest::getVar('shipping_users_info_id', 0); if ($shipping_users_info_id != 0) { for ($o = 0; $o < count($shippinginfo); $o++) { if ($shippinginfo[$o]->users_info_id == $shipping_users_info_id) { $key = $o; break; } } $shipping_country = $shippinginfo[$key]->country_code; $shipping_state = $shippinginfo[$key]->state_code; } $shippingop = array_merge($shippingop, $shippinginfo); $billisship = $shippinginfo[$key]->billisship = $shipping_users_info_id ? 0 : 1; } else { $shippinginfo[0] = $model->setShipping(); $shipping_users_info_id = $shippinginfo[0]->users_info_id = 0; $billisship = $shippinginfo[0]->billisship; } $shdisable = $billisship ? "disabled" : ""; $detail->user_id = $user_id; $lists['shippinginfo_list'] = JHTML::_('select.genericlist', $shippingop, 'shipp_users_info_id', 'class="inputbox" ' . $shdisable . ' onchange="getShippinginfo(this.value, ' . $billing->is_company . ');" ', 'users_info_id', 'text', $shipping_users_info_id); $payment_detail = $this->get('payment'); JToolBarHelper::title(JText::_('COM_REDSHOP_ORDER') . ': <small><small>[ ' . JText::_('COM_REDSHOP_NEW') . ' ]</small></small>', 'redshop_order48'); if ($err == "" && array_key_exists("users_info_id", $billing) && $billing->users_info_id) { JToolBarHelper::custom('savepay', 'save.png', 'save_f2.png', 'Save + Pay', false); JToolBarHelper::custom('save_without_sendmail', 'save.png', 'save_f2.png', JText::_('COM_REDSHOP_SAVE_WITHOUT_SEND_ORDERMAIL_LBL'), false); JToolBarHelper::save(); } JToolBarHelper::cancel(); $countryarray = $Redconfiguration->getCountryList((array) $billing, "country_code", "BT"); $billing->country_code = $countryarray['country_code']; $lists['country_code'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $billing, "state_code", "country_code", "BT", 1); $lists['state_code'] = $statearray['state_dropdown']; $shipping['country_code_ST'] = $shippinginfo[$key]->country_code; $countryarray = $Redconfiguration->getCountryList((array) $shipping, "country_code_ST", "ST"); $shipping['country_code_ST'] = $shippinginfo[$key]->country_code = $countryarray['country_code_ST']; $lists['country_code_ST'] = $countryarray['country_dropdown']; $statearray = $Redconfiguration->getStateList((array) $shipping, "state_code_ST", "country_code_ST", "ST", 1); $lists['state_code_ST'] = $statearray['state_dropdown']; $lists['is_company'] = JHTML::_('select.booleanlist', 'is_company', 'class="inputbox" onchange="showOfflineCompanyOrCustomer(this.value);" ', $billing->is_company, JText::_('COM_REDSHOP_USER_COMPANY'), JText::_('COM_REDSHOP_USER_CUSTOMER')); $lists['customer_field'] = $extra_field->list_all_field(7, $billing->users_info_id); $lists['company_field'] = $extra_field->list_all_field(8, $billing->users_info_id); $lists['shipping_customer_field'] = $extra_field->list_all_field(14, $shippinginfo[0]->users_info_id); $lists['shipping_company_field'] = $extra_field->list_all_field(15, $shippinginfo[0]->users_info_id); $this->lists = $lists; $this->detail = $detail; $this->billing = $billing; $this->shipping = $shippinginfo[$key]; $this->shipping_users_info_id = $shipping_users_info_id; $this->payment_detail = $payment_detail; $this->shipping_rate_id = $shipping_rate_id; $this->request_url = $uri->toString(); parent::display($tpl); }
function getDatas() { if ($this->config['module_mode'] != 'normal') { if (!class_exists('NSP_GK4_' . $this->config['module_mode'])) { require_once dirname(__FILE__) . DS . 'gk_classes' . DS . 'portal_modes' . DS . 'gk.' . strtolower($this->config['module_mode']) . '.php'; } // $method_name = $this->config['module_mode'] . '_getData'; $this->content = $method_name($this); } else { $db = JFactory::getDBO(); if ($this->config["data_source"] == "com_categories" || $this->config["data_source"] == "com_articles" || $this->config["data_source"] == "com_all_articles") { // getting instance of Joomla! com_content source class $newsClass = new NSP_GK4_Joomla_Source(); // Getting list of categories $categories = $this->config["data_source"] != "com_all_articles" ? $newsClass->getSources($this->config) : false; // getting content $amountOfArts = $this->config['news_column'] * $this->config['news_rows'] * $this->config['news_full_pages'] + $this->config['links_amount'] * $this->config['news_short_pages'] * $this->config['links_columns_amount']; $this->content = $newsClass->getArticles($categories, $this->config, $amountOfArts); } else { if ($this->config["data_source"] == "k2_categories" || $this->config["data_source"] == "k2_tags" || $this->config["data_source"] == "k2_articles" || $this->config["data_source"] == "all_k2_articles") { // getting insance of K2 source class $newsClass = new NSP_GK4_K2_Source(); // Getting list of categories $categories = $this->config["data_source"] != "all_k2_articles" ? $newsClass->getSources($this->config) : false; // getting content $amountOfArts = $this->config['news_column'] * $this->config['news_rows'] * $this->config['news_full_pages'] + $this->config['links_amount'] * $this->config['news_short_pages'] * $this->config['links_columns_amount']; $this->content = $newsClass->getArticles($categories, $this->config, $amountOfArts); $this->content['comments'] = $newsClass->getComments($this->content, $this->config); } else { if ($this->config["data_source"] == "redshop_categories" || $this->config["data_source"] == "redshop_products" || $this->config["data_source"] == "all_redshop_products") { if (file_exists(JPATH_ROOT . DS . 'components' . DS . 'com_redshop')) { $newsClass = new NSP_GK4_Redshop_Source(); // get product helper if (file_exists(JPATH_ROOT . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'product.php')) { require_once JPATH_ROOT . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'product.php'; } if (file_exists(JPATH_ROOT . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'helper.php')) { require_once JPATH_ROOT . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'helper.php'; } if (file_exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'category.php')) { require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'category.php'; } if ($this->config['rs_add_to_cart'] == 1) { if (file_exists(JPATH_ROOT . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'redshop.js.php')) { require_once JPATH_ROOT . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'redshop.js.php'; } } // include scripts if (file_exists('components/com_redshop/assets/js/') && $this->config['rs_add_to_cart'] == 1) { JHTML::Script('attribute.js', 'components/com_redshop/assets/js/', false); JHTML::Script('common.js', 'components/com_redshop/assets/js/', false); //JHTML::Script('jquery.tools.min.js', 'components/com_redshop/assets/js/',false); } require_once JPATH_ROOT . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'redshop.js.php'; $doc =& JFactory::getDocument(); $tmpl = JRequest::getCmd('tmpl'); $view = JRequest::getCmd('view'); $layout = JRequest::getCmd('layout'); $for = JRequest::getWord("for", false); if ($tmpl == 'component' && !$for) { $doc->addStyleDeclaration('html { overflow:scroll; }'); } // Getting the configuration require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'redshop.cfg.php'; require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'configuration.php'; $Redconfiguration = new Redconfiguration(); $Redconfiguration->defineDynamicVars(); require_once JPATH_SITE . DS . 'components' . DS . 'com_redshop' . DS . 'helpers' . DS . 'currency.php'; $session = JFactory::getSession('product_currency'); $post = JRequest::get('POST'); $Itemid = JRequest::getVar('Itemid'); if (isset($post['product_currency'])) { $session->set('product_currency', $post['product_currency']); } $currency_symbol = REDCURRENCY_SYMBOL; $currency_convert = 1; if ($session->get('product_currency')) { $currency_symbol = $session->get('product_currency'); $convertPrice = new convertPrice(); $currency_convert = $convertPrice->convert(1); } $script = "window.site_url ='" . JURI::root() . "';\n\t\t\t\t\twindow.AJAX_CART_BOX ='" . AJAX_CART_BOX . "';\n\t\t\t\t\twindow.REDSHOP_VIEW ='" . $view . "';\n\t\t\t\t\twindow.REDSHOP_LAYOUT ='" . $layout . "';\n\t\t\t\t\twindow.AJAX_CART_URL ='" . JRoute::_('index.php?option=com_redshop&view=cart&Itemid=' . $Itemid, false) . "';\n\t\t\t\t\twindow.REDCURRENCY_SYMBOL ='" . REDCURRENCY_SYMBOL . "';\n\t\t\t\t\twindow.CURRENCY_SYMBOL_CONVERT ='" . $currency_symbol . "';\n\t\t\t\t\twindow.CURRENCY_CONVERT ='" . $currency_convert . "';\n\t\t\t\t\twindow.PRICE_SEPERATOR ='" . PRICE_SEPERATOR . "';\n\t\t\t\t\twindow.PRODUCT_OUTOFSTOCK_MESSAGE ='" . JText::_('PRODUCT_OUTOFSTOCK_MESSAGE') . "';\n\t\t\t\t\twindow.PREORDER_PRODUCT_OUTOFSTOCK_MESSAGE ='" . JText::_('PREORDER_PRODUCT_OUTOFSTOCK_MESSAGE') . "';\n\t\t\t\t\twindow.CURRENCY_SYMBOL_POSITION ='" . CURRENCY_SYMBOL_POSITION . "';\n\t\t\t\t\twindow.PRICE_DECIMAL ='" . PRICE_DECIMAL . "';\n\t\t\t\t\twindow.PASSWORD_MIN_CHARACTER_LIMIT ='" . JText::_('PASSWORD_MIN_CHARACTER_LIMIT') . "';\n\t\t\t\t\twindow.THOUSAND_SEPERATOR ='" . THOUSAND_SEPERATOR . "';\n\t\t\t\t\twindow.VIEW_CART ='" . JText::_('VIEW_CART') . "';\n\t\t\t\t\twindow.CONTINUE_SHOPPING ='" . JText::_('CONTINUE_SHOPPING') . "';\n\t\t\t\t\twindow.CART_SAVE ='" . JText::_('CART_SAVE') . "';\n\t\t\t\t\twindow.IS_REQUIRED ='" . JText::_('IS_REQUIRED') . "';\n\t\t\t\t\twindow.ENTER_NUMBER ='" . JText::_('ENTER_NUMBER') . "';\n\t\t\t\t\twindow.USE_STOCKROOM ='" . USE_STOCKROOM . "';\n\t\t\t\t\twindow.USE_AS_CATALOG ='" . USE_AS_CATALOG . "';\n\t\t\t\t\twindow.AJAX_CART_DISPLAY_TIME ='" . AJAX_CART_DISPLAY_TIME . "';\n\t\t\t\t\twindow.SHOW_PRICE ='" . SHOW_PRICE . "';\n\t\t\t\t\twindow.DEFAULT_QUOTATION_MODE ='" . DEFAULT_QUOTATION_MODE . "';\n\t\t\t\t\twindow.PRICE_REPLACE ='" . PRICE_REPLACE . "';\n\t\t\t\t\twindow.PRICE_REPLACE_URL ='" . PRICE_REPLACE_URL . "';\n\t\t\t\t\twindow.ZERO_PRICE_REPLACE ='" . ZERO_PRICE_REPLACE . "';\n\t\t\t\t\twindow.ZERO_PRICE_REPLACE_URL ='" . ZERO_PRICE_REPLACE_URL . "';\n\t\t\t\t\twindow.OPTIONAL_SHIPPING_ADDRESS ='" . OPTIONAL_SHIPPING_ADDRESS . "';\n\t\t\t\t\twindow.SHIPPING_METHOD_ENABLE ='" . SHIPPING_METHOD_ENABLE . "';\n\t\t\t\t\twindow.PRODUCT_ADDIMG_IS_LIGHTBOX ='" . PRODUCT_ADDIMG_IS_LIGHTBOX . "';\n\t\t\t\t\twindow.ALLOW_PRE_ORDER ='" . ALLOW_PRE_ORDER . "';\n\t\t\t\t\twindow.ATTRIBUTE_SCROLLER_THUMB_WIDTH ='" . ATTRIBUTE_SCROLLER_THUMB_WIDTH . "';\n\t\t\t\t\twindow.ATTRIBUTE_SCROLLER_THUMB_HEIGHT ='" . ATTRIBUTE_SCROLLER_THUMB_HEIGHT . "';\n\t\t\t\t\twindow.PRODUCT_DETAIL_IS_LIGHTBOX ='" . PRODUCT_DETAIL_IS_LIGHTBOX . "';\n\t\t\t\t\twindow.PLEASE_ENTER_COMPANY_NAME ='" . JText::_('PLEASE_ENTER_COMPANY_NAME', true) . "';\n\t\t\t\t\twindow.YOUR_MUST_PROVIDE_A_FIRSTNAME ='" . JText::_('YOUR_MUST_PROVIDE_A_FIRSTNAME', true) . "';\n\t\t\t\t\twindow.YOUR_MUST_PROVIDE_A_LASTNAME ='" . JText::_('YOUR_MUST_PROVIDE_A_LASTNAME', true) . "';\n\t\t\t\t\twindow.YOUR_MUST_PROVIDE_A_ADDRESS ='" . JText::_('YOUR_MUST_PROVIDE_A_ADDRESS', true) . "';\n\t\t\t\t\twindow.YOUR_MUST_PROVIDE_A_ZIP ='" . JText::_('YOUR_MUST_PROVIDE_A_ZIP', true) . "';\n\t\t\t\t\twindow.YOUR_MUST_PROVIDE_A_CITY ='" . JText::_('YOUR_MUST_PROVIDE_A_CITY', true) . "';\n\t\t\t\t\twindow.YOUR_MUST_PROVIDE_A_PHONE ='" . JText::_('YOUR_MUST_PROVIDE_A_PHONE', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_REQUIRED ='" . JText::_('THIS_FIELD_REQUIRED', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_REMOTE ='" . JText::_('THIS_FIELD_REMOTE', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_URL='" . JText::_('THIS_FIELD_URL', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_DATE='" . JText::_('THIS_FIELD_DATE', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_DATEISO='" . JText::_('THIS_FIELD_DATEISO', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_NUMBER='" . JText::_('THIS_FIELD_NUMBER', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_DIGITS='" . JText::_('THIS_FIELD_DIGITS', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_CREDITCARD='" . JText::_('THIS_FIELD_CREDITCARD', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_EQUALTO='" . JText::_('THIS_FIELD_EQUALTO', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_ACCEPT='" . JText::_('THIS_FIELD_ACCEPT', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_MAXLENGTH='" . JText::_('THIS_FIELD_MAXLENGTH', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_MINLENGTH='" . JText::_('THIS_FIELD_MINLENGTH', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_RANGELENGTH='" . JText::_('THIS_FIELD_RANGELENGTH', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_RANGE='" . JText::_('THIS_FIELD_RANGE', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_MAX='" . JText::_('THIS_FIELD_MAX', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_MIN='" . JText::_('THIS_FIELD_MIN', true) . "';\n\t\t\t\t\twindow.YOU_MUST_PROVIDE_LOGIN_NAME ='" . JText::_('YOU_MUST_PROVIDE_LOGIN_NAME', true) . "';\n\t\t\t\t\twindow.PROVIDE_EMAIL_ADDRESS ='" . JText::_('PROVIDE_EMAIL_ADDRESS', true) . "';\n\t\t\t\t\twindow.EMAIL_NOT_MATCH ='" . JText::_('EMAIL_NOT_MATCH', true) . "';\n\t\t\t\t\twindow.PASSWORD_NOT_MATCH ='" . JText::_('PASSWORD_NOT_MATCH', true) . "';\n\t\t\t\t\twindow.NOOF_SUBATTRIB_THUMB_FOR_SCROLLER ='" . NOOF_SUBATTRIB_THUMB_FOR_SCROLLER . "';\n\t\t\t\t\twindow.NOT_AVAILABLE ='" . JText::_('NOT_AVAILABLE', true) . "';\n\t\t\t\t\twindow.PLEASE_INSERT_HEIGHT ='" . JText::_('PLEASE_INSERT_HEIGHT', true) . "';\n\t\t\t\t\twindow.PLEASE_INSERT_WIDTH ='" . JText::_('PLEASE_INSERT_WIDTH', true) . "';\n\t\t\t\t\twindow.PLEASE_INSERT_DEPTH ='" . JText::_('PLEASE_INSERT_DEPTH', true) . "';\n\t\t\t\t\twindow.PLEASE_INSERT_RADIUS ='" . JText::_('PLEASE_INSERT_RADIUS', true) . "';\n\t\t\t\t\twindow.PLEASE_INSERT_UNIT ='" . JText::_('PLEASE_INSERT_UNIT', true) . "';\n\t\t\t\t\twindow.THIS_FIELD_IS_REQUIRED ='" . JText::_('THIS_FIELD_IS_REQUIRED', true) . "';\n\t\t\t\t\twindow.CREATE_ACCOUNT_CHECKBOX ='" . CREATE_ACCOUNT_CHECKBOX . "';\n\t\t\t\t\twindow.SHOW_QUOTATION_PRICE ='" . SHOW_QUOTATION_PRICE . "';"; $document = JFactory::getDocument(); $document->addScriptDeclaration($script); // Getting list of categories $categories = $newsClass->getSources($this->config); // getting content $amountOfProducts = $this->config['news_column'] * $this->config['news_rows'] * $this->config['news_full_pages'] + $this->config['links_amount'] * $this->config['news_short_pages'] * $this->config['links_columns_amount']; $this->content = $newsClass->getArticles($categories, $this->config, $amountOfProducts); } } else { // VM block $newsClass = new NSP_GK4_VM_Source(); // Getting list of categories $categories = $newsClass->getSources($this->config); // getting content $amountOfProducts = $this->config['news_column'] * $this->config['news_rows'] * $this->config['news_full_pages'] + $this->config['links_amount'] * $this->config['news_short_pages'] * $this->config['links_columns_amount']; $this->content = $newsClass->getProducts($categories, $this->config, $amountOfProducts); $this->content['comments'] = $newsClass->getComments($this->content, $this->config); } } } } }
function display($tpl = null) { $config = new Redconfiguration(); $redTemplate = new Redtemplate(); $order_functions = new order_functions(); $producthelper = new producthelper(); $model = $this->getModel(); $redTemplate = new Redtemplate(); $detail = $this->get('data'); $carthelper = new rsCarthelper(); $shippinghelper = new shipping(); $products = $order_functions->getOrderItemDetail($detail->order_id); $template = $model->getStockNoteTemplate(); if (count($template) > 0 && $template->template_desc != "") { $html_template = $template->template_desc; } else { $html_template = '<table border="0" cellspacing="2" cellpadding="2" width="100%"><tr><td>{order_id_lbl} : {order_id}</td><td> {order_date_lbl} : {order_date}</td></tr></table> <table border="1" cellspacing="0" cellpadding="0" width="100%"><tbody><tr style="background-color: #d7d7d4"><th align="center">{product_name_lbl}</th> <th align="center">{product_number_lbl}</th> <th align="center">{product_quantity_lbl}</th></tr> {product_loop_start} <tr> <td align="center"> <table> <tr><td>{product_name}</td></tr> <tr><td>{product_attribute}</td></tr> </table> </td> <td align="center">{product_number}</td> <td align="center">{product_quantity}</td> </tr> {product_loop_end} </tbody> </table>'; } ob_start(); if (strstr($html_template, "{product_loop_start}") && strstr($html_template, "{product_loop_end}")) { $template_sdata = explode('{product_loop_start}', $html_template); $template_start = $template_sdata[0]; $template_edata = explode('{product_loop_end}', $template_sdata[1]); $template_end = $template_edata[1]; $template_middle = $template_edata[0]; $middle_data = ''; for ($p = 0; $p < count($products); $p++) { $middle_data .= $template_middle; $product_detail = $producthelper->getProductById($products[$p]->product_id); $middle_data = str_replace("{product_number}", $product_detail->product_number, $middle_data); $middle_data = str_replace("{product_name}", $products[$p]->order_item_name, $middle_data); $middle_data = str_replace("{product_attribute}", $products[$p]->product_attribute, $middle_data); $middle_data = str_replace("{product_quantity}", $products[$p]->product_quantity, $middle_data); } $html_template = $template_start . $middle_data . $template_end; } $html_template = str_replace("{order_id_lbl}", JText::_('COM_REDSHOP_ORDER_ID'), $html_template); $html_template = str_replace("{order_id}", $detail->order_id, $html_template); $html_template = str_replace("{order_date_lbl}", JText::_('COM_REDSHOP_ORDER_DATE'), $html_template); $html_template = str_replace("{order_date}", $config->convertDateFormat($detail->cdate), $html_template); $html_template = str_replace("{product_name_lbl}", JText::_('COM_REDSHOP_PRODUCT_NAME'), $html_template); $html_template = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER'), $html_template); $html_template = str_replace("{product_quantity_lbl}", JText::_('COM_REDSHOP_QUANTITY'), $html_template); $billing = $order_functions->getOrderBillingUserInfo($detail->order_id); $html_template = $carthelper->replaceBillingAddress($html_template, $billing); $shipping = $order_functions->getOrderShippingUserInfo($detail->order_id); $html_template = $carthelper->replaceShippingAddress($html_template, $shipping); $html_template = str_replace("{requisition_number}", $detail->requisition_number, $html_template); $html_template = str_replace("{requisition_number_lbl}", JText::_('COM_REDSHOP_REQUISITION_NUMBER'), $html_template); // start pdf code $pdfObj = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'A5', true, 'UTF-8', false); $pdfObj->SetTitle("Order StockNote: " . $detail->order_id); $pdfObj->SetAuthor('redSHOP'); $pdfObj->SetCreator('redSHOP'); $pdfObj->SetMargins(15, 15, 15); $font = 'times'; $pdfObj->SetHeaderData('', '', '', "Order " . $detail->order_id); $pdfObj->setHeaderFont(array($font, '', 10)); //$pdfObj->setFooterFont(array($font, '', 8)); $pdfObj->SetFont($font, "", 10); //$pdfObj->AliasNbPages(); $pdfObj->AddPage(); $pdfObj->WriteHTML($html_template); $pdfObj->Output("StocNoteOrder_" . $detail->order_id . ".pdf", "D"); exit; }
* @package RedSHOP.Frontend * @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; $url = JURI::base(); // Get product helper require_once JPATH_ROOT . '/components/com_redshop/helpers/product.php'; require_once JPATH_SITE . '/components/com_redshop/helpers/extra_field.php'; $producthelper = new producthelper(); $print = $this->input->getBool('print', false); $user = JFactory::getUser(); $pagetitle = JText::_('COM_REDSHOP_COMPARE_PRODUCTS'); $config = new Redconfiguration(); $compare = $producthelper->getCompare(); $stockroomhelper = new rsstockroomhelper(); if (PRODUCT_COMPARISON_TYPE == 'category') { $compare_product = $this->session->get('compare_product'); $catid = $compare_product[0]['category_id']; $cid = $this->input->getInt('cid', null); $template_id = $producthelper->getCategoryCompareTemplate($catid); if ($template_id == "") { $compare_template = $this->redTemplate->getTemplate("compare_product", COMPARE_TEMPLATE_ID); } else { $compare_template = $this->redTemplate->getTemplate("compare_product", $template_id); } } else { $compare_template = $this->redTemplate->getTemplate("compare_product", COMPARE_TEMPLATE_ID); }
public function orderplace() { $app = JFactory::getApplication(); $redconfig = new Redconfiguration(); $quotationHelper = new quotationHelper(); $stockroomhelper = new rsstockroomhelper(); $helper = new redhelper(); $shippinghelper = new shipping(); $order_functions = new order_functions(); $post = JRequest::get('post'); $option = JRequest::getVar('option', 'com_redshop'); $Itemid = JRequest::getVar('Itemid'); $shop_id = JRequest::getVar('shop_id'); $gls_mobile = JRequest::getVar('gls_mobile'); $customer_message = JRequest::getVar('rs_customer_message_ta'); $referral_code = JRequest::getVar('txt_referral_code'); if ($gls_mobile) { $shop_id = $shop_id . '###' . $gls_mobile; } $user = JFactory::getUser(); $session = JFactory::getSession(); $auth = $session->get('auth'); if (!$user->id && $auth['users_info_id']) { $user->id = -$auth['users_info_id']; } $db = JFactory::getDbo(); $issplit = $session->get('issplit'); $url = JURI::root(); // If user subscribe for the newsletter if (isset($post['newsletter_signup']) && $post['newsletter_signup'] == 1) { $this->_userhelper->newsletterSubscribe(); } // If user unsubscribe for the newsletter if (isset($post['newsletter_signoff']) && $post['newsletter_signoff'] == 1) { $this->_userhelper->newsletterUnsubscribe(); } $order_paymentstatus = 'Unpaid'; $objshipping = new shipping(); $users_info_id = JRequest::getInt('users_info_id'); $thirdparty_email = JRequest::getVar('thirdparty_email'); $shippingaddresses = $this->shipaddress($users_info_id); $billingaddresses = $this->billingaddresses(); if (isset($shippingaddresses)) { $d["shippingaddress"] = $shippingaddresses; $d["shippingaddress"]->country_2_code = $redconfig->getCountryCode2($d["shippingaddress"]->country_code); $d["shippingaddress"]->state_2_code = $redconfig->getStateCode2($d["shippingaddress"]->state_code); $shippingaddresses->country_2_code = $d["shippingaddress"]->country_2_code; $shippingaddresses->state_2_code = $d["shippingaddress"]->state_2_code; } if (isset($billingaddresses)) { $d["billingaddress"] = $billingaddresses; if (isset($billingaddresses->country_code)) { $d["billingaddress"]->country_2_code = $redconfig->getCountryCode2($billingaddresses->country_code); $billingaddresses->country_2_code = $d["billingaddress"]->country_2_code; } if (isset($billingaddresses->state_code)) { $d["billingaddress"]->state_2_code = $redconfig->getStateCode2($billingaddresses->state_code); $billingaddresses->state_2_code = $d["billingaddress"]->state_2_code; } } $cart = $session->get('cart'); if ($cart['idx'] < 1) { $msg = JText::_('COM_REDSHOP_EMPTY_CART'); $app->Redirect('index.php?option=' . $option . '&Itemid=' . $Itemid, $msg); } $ccdata = $session->get('ccdata'); $shipping_rate_id = ''; if ($cart['free_shipping'] != 1) { $shipping_rate_id = JRequest::getVar('shipping_rate_id'); } $payment_method_id = JRequest::getVar('payment_method_id'); $ccinfo = JRequest::getVar('ccinfo'); if ($shipping_rate_id && $cart['free_shipping'] != 1) { $shipArr = $this->calculateShipping($shipping_rate_id); $cart['shipping'] = $shipArr['order_shipping_rate']; $cart['shipping_vat'] = $shipArr['shipping_vat']; } $cart = $this->_carthelper->modifyDiscount($cart); $paymentinfo = $this->_order_functions->getPaymentMethodInfo($payment_method_id); $paymentinfo = $paymentinfo[0]; $paymentparams = new JRegistry($paymentinfo->params); $paymentinfo = new stdclass(); $paymentinfo->payment_price = $paymentparams->get('payment_price', ''); $paymentinfo->payment_oprand = $paymentparams->get('payment_oprand', ''); $paymentinfo->payment_discount_is_percent = $paymentparams->get('payment_discount_is_percent', ''); if (PAYMENT_CALCULATION_ON == 'subtotal') { $paymentAmount = $cart['product_subtotal']; } else { $paymentAmount = $cart['total']; } $paymentArray = $this->_carthelper->calculatePayment($paymentAmount, $paymentinfo, $cart['total']); $cart['total'] = $paymentArray[0]; $cart = $session->set('cart', $cart); $cart = $session->get('cart'); $order_shipping = explode("|", $shippinghelper->decryptShipping(str_replace(" ", "+", $shipping_rate_id))); $order_status = 'P'; $order_status_full = $this->_order_functions->getOrderStatusTitle('P'); // Start code to track duplicate order number checking by parth $order_number = $this->getOrdernumber(); // End code to track duplicate order number checking by parth $order_subtotal = $cart['product_subtotal']; $cdiscount = $cart['coupon_discount']; $order_tax = $cart['tax']; $d['order_tax'] = $order_tax; $tax_after_discount = 0; if (isset($cart['tax_after_discount'])) { $tax_after_discount = $cart['tax_after_discount']; } $odiscount = $cart['coupon_discount'] + $cart['voucher_discount'] + $cart['cart_discount']; $odiscount_vat = $cart['discount_vat']; $d["order_payment_trans_id"] = ''; $d['discount'] = $odiscount; $order_total = $cart['total']; if ($issplit) { $order_total = $order_total / 2; } JRequest::setVar('order_ship', $order_shipping[3]); $paymentmethod = $this->_order_functions->getPaymentMethodInfo($payment_method_id); $paymentmethod = $paymentmethod[0]; $mainelement = $paymentmethod->element; if ($paymentmethod->element == "rs_payment_banktransfer" || $paymentmethod->element == "rs_payment_banktransfer2" || $paymentmethod->element == "rs_payment_banktransfer3" || $paymentmethod->element == "rs_payment_banktransfer4" || $paymentmethod->element == "rs_payment_banktransfer5" || $paymentmethod->element == "rs_payment_cashtransfer" || $paymentmethod->element == "rs_payment_cashsale" || $paymentmethod->element == "rs_payment_banktransfer_discount" || $paymentmethod->element == "rs_payment_eantransfer") { $paymentmethod = $order_functions->getPaymentMethodInfo($paymentmethod->element); $paymentmethod = $paymentmethod[0]; $paymentpath = JPATH_SITE . '/plugins/redshop_payment/' . $paymentmethod->element . '.xml'; $paymentparams = new JRegistry($paymentmethod->params); $order_main_status = $paymentparams->get('verify_status', ''); if ($paymentmethod->element != "rs_payment_banktransfer" && $paymentmethod->element != "rs_payment_cashtransfer" && $paymentmethod->element != "rs_payment_cashsale" && $paymentmethod->element != "rs_payment_banktransfer_discount" && $paymentmethod->element != "rs_payment_eantransfer") { $paymentmethod->element = substr($paymentmethod->element, 0, -1); } } if ($paymentmethod->element == "rs_payment_banktransfer" || $paymentmethod->element == "rs_payment_cashtransfer" || $paymentmethod->element == "rs_payment_cashsale" || $paymentmethod->element == "rs_payment_banktransfer_discount" || $paymentmethod->element == "rs_payment_eantransfer") { $order_status = $order_main_status; if ($issplit) { $order_paymentstatus = trim("Partial Paid"); } else { $order_paymentstatus = trim("Unpaid"); } $order_status_full = $this->_order_functions->getOrderStatusTitle($order_main_status); } $paymentmethod->element = $mainelement; $payment_amount = 0; if (isset($cart['payment_amount'])) { $payment_amount = $cart['payment_amount']; } $payment_oprand = ""; if (isset($cart['payment_oprand'])) { $payment_oprand = $cart['payment_oprand']; } $xmlpath = JPATH_SITE . '/plugins/redshop_payment/' . $paymentmethod->element . '.xml'; $params = new JRegistry($paymentmethod->params, $xmlpath); $economic_payment_terms_id = $params->get('economic_payment_terms_id'); $economic_design_layout = $params->get('economic_design_layout'); $is_creditcard = $params->get('is_creditcard', ''); $is_redirected = $params->get('is_redirected', 0); JRequest::setVar('payment_status', $order_paymentstatus); $d['order_shipping'] = $order_shipping[3]; $GLOBALS['billingaddresses'] = $billingaddresses; $timestamp = time(); // Get the IP Address if (!empty($_SERVER['REMOTE_ADDR'])) { $ip = $_SERVER['REMOTE_ADDR']; } else { $ip = 'unknown'; } $row = $this->getTable('order_detail'); if (!$row->bind($post)) { $this->setError($this->_db->getErrorMsg()); return false; } $shippingVatRate = 0; if (array_key_exists(6, $order_shipping)) { $shippingVatRate = $order_shipping[6]; } $random_gen_enc_key = $this->_order_functions->random_gen_enc_key(35); $users_info_id = $billingaddresses->users_info_id; $row->user_id = $user->id; $row->order_number = $order_number; $row->user_info_id = $users_info_id; $row->order_total = $order_total; $row->order_subtotal = $order_subtotal; $row->order_tax = $order_tax; $row->tax_after_discount = $tax_after_discount; $row->order_tax_details = ''; $row->analytics_status = 0; $row->order_shipping = $order_shipping[3]; $row->order_shipping_tax = $shippingVatRate; $row->coupon_discount = $cdiscount; $row->shop_id = $shop_id; $row->customer_message = $customer_message; $row->referral_code = $referral_code; $db = JFactory::getDbo(); $dispatcher = JDispatcher::getInstance(); $order_status_log = ''; // For credit card payment gateway page will redirect to order detail page from plugin if ($is_creditcard == 1 && $is_redirected == 1) { $redirect_ccdata = $session->set('redirect_ccdata', $ccdata); } if ($is_creditcard == 1 && $is_redirected == 0 && $cart['total'] > 0) { JPluginHelper::importPlugin('redshop_payment'); $values['order_shipping'] = $d['order_shipping']; $values['order_number'] = $order_number; $values['order_tax'] = $d['order_tax']; $values['shippinginfo'] = $d['shippingaddress']; $values['billinginfo'] = $d['billingaddress']; $values['order_total'] = $order_total; $values['order_subtotal'] = $order_subtotal; $values["order_id"] = $order_id; $values['payment_plugin'] = $paymentmethod->element; $values['odiscount'] = $odiscount; $paymentResponses = $dispatcher->trigger('onPrePayment_' . $values['payment_plugin'], array($values['payment_plugin'], $values)); $paymentResponse = $paymentResponses[0]; if ($paymentResponse->responsestatus == "Success") { $d["order_payment_trans_id"] = $paymentResponse->transaction_id; $order_status_log = $paymentResponse->message; $order_status = 'C'; $order_paymentstatus = 'Paid'; } else { if ($values['payment_plugin'] != 'rs_payment_localcreditcard') { $errorMsg = $paymentResponse->message; $this->setError($errorMsg); return false; } } } if ($order_total <= 0) { $paymentpath = JPATH_SITE . '/plugins/redshop_payment/' . $paymentmethod->element . '.xml'; $paymentparams = new JRegistry($paymentmethod->params); $order_main_status = $paymentparams->get('verify_status', ''); $order_status = $order_main_status; $order_paymentstatus = 'Paid'; } if (USE_AS_CATALOG) { $order_status = 'P'; $order_paymentstatus = 'Unpaid'; } // For barcode generation $barcode_code = $order_functions->barcode_randon_number(12, 0); // End $row->order_discount = $odiscount; $row->order_discount_vat = $odiscount_vat; $row->payment_discount = $payment_amount; $row->payment_oprand = $payment_oprand; $row->order_status = $order_status; $row->order_payment_status = $order_paymentstatus; $row->cdate = $timestamp; $row->mdate = $timestamp; $row->ship_method_id = $shipping_rate_id; $row->customer_note = $post['customer_note']; $row->requisition_number = $post['requisition_number']; $row->ip_address = $ip; $row->encr_key = $random_gen_enc_key; $row->split_payment = $issplit; $row->discount_type = $this->discount_type; $row->order_id = JRequest::getVar('order_id', $row->order_id); $row->barcode = $barcode_code; if (!$row->store()) { $this->setError($this->_db->getErrorMsg()); // Start code to track duplicate order number checking by parth $this->deleteOrdernumberTrack(); // End code to track duplicate order number checking by parth return false; } // Start code to track duplicate order number checking by parth $this->deleteOrdernumberTrack(); // End code to track duplicate order number checking by parth $order_id = $row->order_id; $this->coupon($cart, $order_id); $this->voucher($cart, $order_id); $query = "UPDATE `#__redshop_orders` SET discount_type = " . $db->quote($this->discount_type) . " where order_id = " . (int) $order_id; $db->setQuery($query); $db->query(); if (SHOW_TERMS_AND_CONDITIONS == 1 && isset($post['termscondition']) && $post['termscondition'] == 1) { $this->_userhelper->updateUserTermsCondition($users_info_id, 1); } // Place order id in quotation table if it Quotation if (array_key_exists("quotation_id", $cart) && $cart['quotation_id']) { $quotationHelper->updateQuotationwithOrder($cart['quotation_id'], $row->order_id); } if ($row->order_status == CLICKATELL_ORDER_STATUS) { $helper->clickatellSMS($order_id); } $session->set('order_id', $order_id); // Add order status log $rowOrderStatus = $this->getTable('order_status_log'); $rowOrderStatus->order_id = $order_id; $rowOrderStatus->order_status = $order_status; $rowOrderStatus->date_changed = time(); $rowOrderStatus->customer_note = $order_status_log; $rowOrderStatus->store(); $country_name = $this->_order_functions->getCountryName($billingaddresses->country_code); $state_name = $this->_order_functions->getStateName($billingaddresses->state_code, $billingaddresses->country_code); JRequest::setVar('order_id', $row->order_id); JRequest::setVar('order_number', $row->order_number); if (!isset($order_shipping[5])) { $order_shipping[5] = ""; } if ($order_shipping[5] == 'regular') { $regDel = $objshipping->getRegularDelivery(); JRequest::setVar('order_delivery', "Delivered in one instance � DELIVERY TIME: " . current($regDel) . " weeks</td>"); } elseif ($order_shipping[5] == 'split') { $delArray = $objshipping->getProductDeliveryArray($shipping_rate_id); $splitdel = $objshipping->getSplitDelivery(); if (count($splitdel) > 1) { $split1 = $splitdel[0]; $split2 = $splitdel[1]; $prods1 = ''; $prods2 = ''; for ($i = 0; $i < count($split1); $i++) { $value = current($split1); $deltime1 = $value; $key = key($split1); $product = $this->_producthelper->getProductById($key, "product_name"); $prods1 .= $product->product_name . ','; next($split1); } for ($i = 0; $i < count($split2); $i++) { $value = current($split2); $deltime2 = $value; $key = key($split2); $product = $this->_producthelper->getProductById($key, "product_name"); $prods2 .= $product->product_name . ','; next($split2); } $prods1 = trim($prods1, ","); $prods2 = trim($prods2, ","); } JRequest::setVar('order_delivery', "Delivered over two instances for " . SPLIT_DELIVERY_COST . "kr extra DELIVERY TIME: " . $deltime1 . " Weeks for " . $prods1 . " AND " . $deltime2 . " Weeks for " . $prods2 . " "); } else { $delArray = $objshipping->getProductDeliveryArray($shipping_rate_id); $splitdel = $objshipping->getSplitDelivery(); $split1 = $splitdel[0]; $value = current($split1); $product_delivery_time = $this->_producthelper->getProductMinDeliveryTime($cart[0]['product_id']); JRequest::setVar('order_delivery', $product_delivery_time); } $idx = $cart['idx']; $product_name = ""; $product_note = ""; $product_price = ""; $product_quantity = ""; $product_total_price = ""; for ($i = 0; $i < $idx; $i++) { // GiftCARD start $is_giftcard = 0; $giftcard_price = 0; $giftcard_name = 0; // GiftCARD end $product_id = $cart[$i]['product_id']; $product = $this->_producthelper->getProductById($product_id); $rowitem = $this->getTable('order_item_detail'); // The redCRM product purchase price if ($helper->isredCRM()) { $crmProductHelper = new crmProductHelper(); $crmproduct = $crmProductHelper->getProductById($product_id); $rowitem->product_purchase_price = $crmproduct->product_purchase_price > 0 ? $crmproduct->product_purchase_price : $crmproduct->product_price; $crmdata = array(); $crmDebitorHelper = new crmDebitorHelper(); $crmDebitorHelper_values = $crmDebitorHelper->getShippingDestination(0, 0, $shippingaddresses->users_info_id); if ($session->get('isredcrmuser')) { $crmDebitorHelper_contact_values = $crmDebitorHelper->getContactPersons(0, 0, 0, $user->id, 0); } else { $crmDebitorHelper_contact_values = $crmDebitorHelper->getContactPersons(0, 0, 0, 0, $crmDebitorHelper_values[0]->shipping_id); } $crmdata['order_id'] = JRequest::getVar('order_id', $row->order_id); $crmdata['debitor_id'] = $shippingaddresses->users_info_id; $crmdata['custom_status'] = ''; $crmdata['rma_number'] = ''; if (count($crmDebitorHelper_values) > 0) { $crmdata['shipping_id'] = $crmDebitorHelper_values[0]->shipping_id; } else { $crmdata['shipping_id'] = 0; } if (count($crmDebitorHelper_contact_values) > 0 && count($crmDebitorHelper_values) > 0) { $crmdata['person_id'] = $crmDebitorHelper_contact_values[0]->person_id; } else { $crmdata['person_id'] = 0; } $crmOrderHelper = new crmOrderHelper(); $crmOrderHelper->storeCRMOrder($crmdata); } // End if (!$rowitem->bind($post)) { $this->setError($this->_db->getErrorMsg()); return false; } if ($order_shipping[5] == 'regular') { $rowitem->delivery_time = $regDel; } elseif ($order_shipping[5] == 'split') { $rowitem->delivery_time = $delArray[$product_id]; } else { $rowitem->delivery_time = ''; } if (isset($cart[$i]['giftcard_id']) && $cart[$i]['giftcard_id']) { $is_giftcard = 1; } // Product stockroom update if (!$is_giftcard) { $updatestock = $stockroomhelper->updateStockroomQuantity($product_id, $cart[$i]['quantity']); $stockroom_id_list = $updatestock['stockroom_list']; $stockroom_quantity_list = $updatestock['stockroom_quantity_list']; $rowitem->stockroom_id = $stockroom_id_list; $rowitem->stockroom_quantity = $stockroom_quantity_list; } // End product stockroom update $vals = explode('product_attributes/', $cart[$i]['hidden_attribute_cartimage']); if (!empty($cart[$i]['attributeImage']) && file_exists(JPATH_ROOT . '/components/com_redshop/assets/images/mergeImages/' . $cart[$i]['attributeImage'])) { $rowitem->attribute_image = $order_id . $cart[$i]['attributeImage']; $old_media = JPATH_ROOT . '/components/com_redshop/assets/images/mergeImages/' . $cart[$i]['attributeImage']; $new_media = JPATH_ROOT . '/components/com_redshop/assets/images/orderMergeImages' . $rowitem->attribute_image; copy($old_media, $new_media); } elseif (!empty($vals[1])) { $rowitem->attribute_image = $vals[1]; } $wrapper_price = 0; if (@$cart[$i]['wrapper_id']) { $wrapper_price = $cart[$i]['wrapper_price']; } if ($is_giftcard == 1) { $giftcardData = $this->_producthelper->getGiftcardData($cart[$i]['giftcard_id']); $rowitem->product_id = $cart[$i]['giftcard_id']; $rowitem->order_item_name = $giftcardData->giftcard_name; $rowitem->product_item_old_price = $cart[$i]['product_price']; } else { $rowitem->product_id = $product_id; $rowitem->product_item_old_price = $cart[$i]['product_old_price']; $rowitem->supplier_id = $product->manufacturer_id; $rowitem->order_item_sku = $product->product_number; $rowitem->order_item_name = $product->product_name; } $rowitem->product_item_price = $cart[$i]['product_price']; $rowitem->product_quantity = $cart[$i]['quantity']; $rowitem->product_item_price_excl_vat = $cart[$i]['product_price_excl_vat']; $rowitem->product_final_price = $cart[$i]['product_price'] * $cart[$i]['quantity']; $rowitem->is_giftcard = $is_giftcard; $retAttArr = $this->_producthelper->makeAttributeCart($cart[$i]['cart_attribute'], $product_id, 0, 0, $cart[$i]['quantity']); $cart_attribute = $retAttArr[0]; // For discount calc data $cart_calc_data = ""; if (isset($cart[$i]['discount_calc_output'])) { $cart_calc_data = $cart[$i]['discount_calc_output']; } // End $retAccArr = $this->_producthelper->makeAccessoryCart($cart[$i]['cart_accessory'], $product_id); $cart_accessory = $retAccArr[0]; $rowitem->order_id = $order_id; $rowitem->user_info_id = $users_info_id; $rowitem->order_item_currency = REDCURRENCY_SYMBOL; $rowitem->order_status = $order_status; $rowitem->cdate = $timestamp; $rowitem->mdate = $timestamp; $rowitem->product_attribute = $cart_attribute; $rowitem->discount_calc_data = $cart_calc_data; $rowitem->product_accessory = $cart_accessory; $rowitem->container_id = $objshipping->getProductContainerId($cart[$i]['product_id']); $rowitem->wrapper_price = $wrapper_price; if (!empty($cart[$i]['wrapper_id'])) { $rowitem->wrapper_id = $cart[$i]['wrapper_id']; } if (!empty($cart[$i]['reciver_email'])) { $rowitem->giftcard_user_email = $cart[$i]['reciver_email']; } if (!empty($cart[$i]['reciver_name'])) { $rowitem->giftcard_user_name = $cart[$i]['reciver_name']; } if ($this->_producthelper->checkProductDownload($rowitem->product_id)) { $medianame = $this->_producthelper->getProductMediaName($rowitem->product_id); for ($j = 0; $j < count($medianame); $j++) { $product_serial_number = $this->_producthelper->getProdcutSerialNumber($rowitem->product_id); $this->_producthelper->insertProductDownload($rowitem->product_id, $user->id, $rowitem->order_id, $medianame[$j]->media_name, $product_serial_number->serial_number); } } // Import files for plugin JPluginHelper::importPlugin('redshop_product'); if (!$rowitem->store()) { $this->setError($this->_db->getErrorMsg()); return false; } // Add plugin support $dispatcher->trigger('afterOrderItemSave', array($cart, $rowitem, $i)); // End if (isset($cart[$i]['giftcard_id']) && $cart[$i]['giftcard_id']) { $section_id = 13; } else { $section_id = 12; } $this->_producthelper->insertProdcutUserfield($i, $cart, $rowitem->order_item_id, $section_id); // My accessory save in table start if (count($cart[$i]['cart_accessory']) > 0) { $setPropEqual = true; $setSubpropEqual = true; $attArr = $cart[$i]['cart_accessory']; for ($a = 0; $a < count($attArr); $a++) { $accessory_vat_price = 0; $accessory_attribute = ""; $accessory_id = $attArr[$a]['accessory_id']; $accessory_name = $attArr[$a]['accessory_name']; $accessory_price = $attArr[$a]['accessory_price']; $accessory_quantity = $attArr[$a]['accessory_quantity']; $accessory_org_price = $accessory_price; if ($accessory_price > 0) { $accessory_vat_price = $this->_producthelper->getProductTax($rowitem->product_id, $accessory_price); } $attchildArr = $attArr[$a]['accessory_childs']; for ($j = 0; $j < count($attchildArr); $j++) { $prooprand = array(); $proprice = array(); $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++) { $prooprand[$k] = $propArr[$k]['property_oprand']; $proprice[$k] = $propArr[$k]['property_price']; $section_vat = 0; if ($propArr[$k]['property_price'] > 0) { $section_vat = $this->_producthelper->getProducttax($rowitem->product_id, $propArr[$k]['property_price']); } $property_id = $propArr[$k]['property_id']; $accessory_attribute .= urldecode($propArr[$k]['property_name']) . " (" . $propArr[$k]['property_oprand'] . $this->_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 = $this->_producthelper->getProducttax($rowitem->product_id, $subpropArr[$l]['subproperty_price']); } $subproperty_id = $subpropArr[$l]['subproperty_id']; $accessory_attribute .= urldecode($subpropArr[$l]['subproperty_name']) . " (" . $subpropArr[$l]['subproperty_oprand'] . $this->_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']; $rowattitem->section_price = $subpropArr[$l]['subproperty_price']; $rowattitem->section_vat = $section_vat; $rowattitem->section_oprand = $subpropArr[$l]['subproperty_oprand']; $rowattitem->is_accessory_att = 1; if ($subproperty_id > 0) { if (!$rowattitem->store()) { $this->setError($this->_db->getErrorMsg()); return false; } } } } // FOR ACCESSORY PROPERTY AND SUBPROPERTY PRICE CALCULATION if ($setPropEqual && $setSubpropEqual) { $accessory_priceArr = $this->_producthelper->makeTotalPriceByOprand($accessory_price, $prooprand, $proprice); $setPropEqual = $accessory_priceArr[0]; $accessory_price = $accessory_priceArr[1]; } for ($t = 0; $t < count($propArr); $t++) { $subprooprand = array(); $subproprice = array(); $subElementArr = $propArr[$t]['property_childs']; for ($tp = 0; $tp < count($subElementArr); $tp++) { $subprooprand[$tp] = $subElementArr[$tp]['subproperty_oprand']; $subproprice[$tp] = $subElementArr[$tp]['subproperty_price']; } if ($setPropEqual && $setSubpropEqual) { $accessory_priceArr = $this->_producthelper->makeTotalPriceByOprand($accessory_price, $subprooprand, $subproprice); $setSubpropEqual = $accessory_priceArr[0]; $accessory_price = $accessory_priceArr[1]; } } // FOR ACCESSORY PROPERTY AND SUBPROPERTY PRICE CALCULATION } $accdata = $this->getTable('accessory_detail'); if ($accessory_id > 0) { $accdata->load($accessory_id); } $accProductinfo = $this->_producthelper->getProductById($accdata->child_product_id); $rowaccitem = $this->getTable('order_acc_item'); $rowaccitem->order_item_acc_id = 0; $rowaccitem->order_item_id = $rowitem->order_item_id; $rowaccitem->product_id = $accessory_id; $rowaccitem->order_acc_item_sku = $accProductinfo->product_number; $rowaccitem->order_acc_item_name = $accessory_name; $rowaccitem->order_acc_price = $accessory_org_price; $rowaccitem->order_acc_vat = $accessory_vat_price; $rowaccitem->product_quantity = $accessory_quantity; $rowaccitem->product_acc_item_price = $accessory_price; $rowaccitem->product_acc_final_price = $accessory_price * $accessory_quantity; $rowaccitem->product_attribute = $accessory_attribute; if ($accessory_id > 0) { if (!$rowaccitem->store()) { $this->setError($this->_db->getErrorMsg()); return false; } } } } // My attribute save in table start if (count($cart[$i]['cart_attribute']) > 0) { $attchildArr = $cart[$i]['cart_attribute']; for ($j = 0; $j < count($attchildArr); $j++) { $attribute_id = $attchildArr[$j]['attribute_id']; $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 = $rowitem->product_id; $rowattitem->section_name = $attchildArr[$j]['attribute_name']; $rowattitem->is_accessory_att = 0; if ($attribute_id > 0) { if (!$rowattitem->store()) { $this->setError($this->_db->getErrorMsg()); return false; } } $propArr = $attchildArr[$j]['attribute_childs']; if (count($propArr) > 0) { for ($k = 0; $k < count($propArr); $k++) { $section_vat = 0; if ($propArr[$k]['property_price'] > 0) { $section_vat = $this->_producthelper->getProducttax($rowitem->product_id, $propArr[$k]['property_price']); } $property_id = $propArr[$k]['property_id']; // Product property STOCKROOM update start $updatestock_att = $stockroomhelper->updateStockroomQuantity($property_id, $cart[$i]['quantity'], "property", $product_id); $stockroom_att_id_list = $updatestock_att['stockroom_list']; $stockroom_att_quantity_list = $updatestock_att['stockroom_quantity_list']; $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 = 0; $rowattitem->stockroom_id = $stockroom_att_id_list; $rowattitem->stockroom_quantity = $stockroom_att_quantity_list; if ($property_id > 0) { if (!$rowattitem->store()) { $this->setError($this->_db->getErrorMsg()); return false; } } $subpropArr = $propArr[$k]['property_childs']; for ($l = 0; $l < count($subpropArr); $l++) { $section_vat = 0; if ($subpropArr[$l]['subproperty_price'] > 0) { $section_vat = $this->_producthelper->getProducttax($rowitem->product_id, $subpropArr[$l]['subproperty_price']); } $subproperty_id = $subpropArr[$l]['subproperty_id']; // Product subproperty STOCKROOM update start $updatestock_subatt = $stockroomhelper->updateStockroomQuantity($subproperty_id, $cart[$i]['quantity'], "subproperty", $product_id); $stockroom_subatt_id_list = $updatestock_subatt['stockroom_list']; $stockroom_subatt_quantity_list = $updatestock_subatt['stockroom_quantity_list']; $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']; $rowattitem->section_price = $subpropArr[$l]['subproperty_price']; $rowattitem->section_vat = $section_vat; $rowattitem->section_oprand = $subpropArr[$l]['subproperty_oprand']; $rowattitem->is_accessory_att = 0; $rowattitem->stockroom_id = $stockroom_subatt_id_list; $rowattitem->stockroom_quantity = $stockroom_subatt_quantity_list; if ($subproperty_id > 0) { if (!$rowattitem->store()) { $this->setError($this->_db->getErrorMsg()); return false; } } } } } } } // Subtracting the products from the container. means decreasing stock if (USE_CONTAINER) { $this->_producthelper->updateContainerStock($product_id, $cart[$i]['quantity'], $rowitem->container_id); } // Subtracting the products from the container. means decreasing stock end // Store user product subscription detail if ($product->product_type == 'subscription') { $subscribe = $this->getTable('product_subscribe_detail'); $subscription_detail = $this->_producthelper->getProductSubscriptionDetail($product_id, $cart[$i]['subscription_id']); $add_day = $subscription_detail->period_type == 'days' ? $subscription_detail->subscription_period : 0; $add_month = $subscription_detail->period_type == 'month' ? $subscription_detail->subscription_period : 0; $add_year = $subscription_detail->period_type == 'year' ? $subscription_detail->subscription_period : 0; $subscribe->order_id = $order_id; $subscribe->order_item_id = $rowitem->order_item_id; $subscribe->product_id = $product_id; $subscribe->subscription_id = $cart[$i]['subscription_id']; $subscribe->user_id = $user->id; $subscribe->start_date = time(); $subscribe->end_date = mktime(0, 0, 0, date('m') + $add_month, date('d') + $add_day, date('Y') + $add_year); if (!$subscribe->store()) { $this->setError($this->_db->getErrorMsg()); return false; } } } $rowpayment = $this->getTable('order_payment'); if (!$rowpayment->bind($post)) { $this->setError($this->_db->getErrorMsg()); return false; } $rowpayment->order_id = $order_id; $rowpayment->payment_method_id = $payment_method_id; if (!isset($ccdata['creditcard_code'])) { $ccdata['creditcard_code'] = 0; } if (!isset($ccdata['order_payment_number'])) { $ccdata['order_payment_number'] = 0; } if (!isset($ccdata['order_payment_expire_month'])) { $ccdata['order_payment_expire_month'] = 0; } if (!isset($ccdata['order_payment_expire_year'])) { $ccdata['order_payment_expire_year'] = 0; } $rowpayment->order_payment_code = $ccdata['creditcard_code']; $rowpayment->order_payment_cardname = base64_encode($ccdata['order_payment_name']); $rowpayment->order_payment_number = base64_encode($ccdata['order_payment_number']); // This is ccv code $rowpayment->order_payment_ccv = base64_encode($ccdata['credit_card_code']); $rowpayment->order_payment_amount = $order_total; $rowpayment->order_payment_expire = $ccdata['order_payment_expire_month'] . $ccdata['order_payment_expire_year']; $rowpayment->order_payment_name = $paymentmethod->name; $rowpayment->payment_method_class = $paymentmethod->element; $rowpayment->order_payment_trans_id = $d["order_payment_trans_id"]; $rowpayment->authorize_status = ""; if (!$rowpayment->store()) { $this->setError($this->_db->getErrorMsg()); return false; } // For authorize status JPluginHelper::importPlugin('redshop_payment'); $dispatcher = JDispatcher::getInstance(); $data = $dispatcher->trigger('onAuthorizeStatus_' . $paymentmethod->element, array($paymentmethod->element, $order_id)); $GLOBALS['shippingaddresses'] = $shippingaddresses; // Add billing Info $userrow = $this->getTable('user_detail'); $userrow->load($billingaddresses->users_info_id); $userrow->thirdparty_email = $post['thirdparty_email']; $orderuserrow = $this->getTable('order_user_detail'); if (!$orderuserrow->bind($userrow)) { $this->setError($this->_db->getErrorMsg()); return false; } $orderuserrow->order_id = $order_id; $orderuserrow->address_type = 'BT'; if (!$orderuserrow->store()) { $this->setError($this->_db->getErrorMsg()); return false; } // Add shipping Info $userrow = $this->getTable('user_detail'); if (isset($shippingaddresses->users_info_id)) { $userrow->load($shippingaddresses->users_info_id); } $orderuserrow = $this->getTable('order_user_detail'); if (!$orderuserrow->bind($userrow)) { $this->setError($this->_db->getErrorMsg()); return false; } $orderuserrow->order_id = $order_id; $orderuserrow->address_type = 'ST'; if (!$orderuserrow->store()) { $this->setError($this->_db->getErrorMsg()); return false; } $checkOrderStatus = 1; if ($paymentmethod->element == "rs_payment_banktransfer" || $paymentmethod->element == "rs_payment_banktransfer_discount" || $paymentmethod->element == "rs_payment_banktransfer2" || $paymentmethod->element == "rs_payment_banktransfer3" || $paymentmethod->element == "rs_payment_banktransfer4" || $paymentmethod->element == "rs_payment_banktransfer5") { $checkOrderStatus = 0; } if (isset($cart['extrafields_values'])) { if (count($cart['extrafields_values']) > 0) { $this->_producthelper->insertPaymentShippingField($cart, $order_id, 18); $this->_producthelper->insertPaymentShippingField($cart, $order_id, 19); } } // Economic Integration start for invoice generate and book current invoice if (ECONOMIC_INTEGRATION == 1 && ECONOMIC_INVOICE_DRAFT != 2) { $economic = new economic(); $economicdata['split_payment'] = $issplit; $economicdata['economic_payment_terms_id'] = $economic_payment_terms_id; $economicdata['economic_design_layout'] = $economic_design_layout; $economicdata['economic_is_creditcard'] = $is_creditcard; $payment_name = $paymentmethod->element; $paymentArr = explode("rs_payment_", $paymentmethod->element); if (count($paymentArr) > 0) { $payment_name = $paymentArr[1]; } $economicdata['economic_payment_method'] = $payment_name; $invoiceHandle = $economic->createInvoiceInEconomic($row->order_id, $economicdata); if (ECONOMIC_INVOICE_DRAFT == 0) { $bookinvoicepdf = $economic->bookInvoiceInEconomic($row->order_id, $checkOrderStatus); if (is_file($bookinvoicepdf)) { $ret = $this->_redshopMail->sendEconomicBookInvoiceMail($row->order_id, $bookinvoicepdf); } } } // End Economic // Send the Order mail before payment if (!ORDER_MAIL_AFTER || ORDER_MAIL_AFTER && $row->order_payment_status == "Paid") { $this->_redshopMail->sendOrderMail($row->order_id); } else { // If Order mail set to send after payment then send mail to administrator only. $this->_redshopMail->sendOrderMail($row->order_id, true); } if ($row->order_status == "C") { $this->_order_functions->SendDownload($row->order_id); } // RedCRM includes if ($helper->isredCRM()) { if (ENABLE_ITEM_TRACKING_SYSTEM) { // Supplier order helper object $crmSupplierOrderHelper = new crmSupplierOrderHelper(); $getStatus = array(); $getStatus['orderstatus'] = $row->order_status; $getStatus['paymentstatus'] = $row->order_payment_status; $crmSupplierOrderHelper->redSHOPOrderUpdate($row->order_id, $getStatus); unset($getStatus); } } return $row; }
* @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; $doc = JFactory::getDocument(); $tmpl = JRequest::getCmd('tmpl'); $view = JRequest::getCmd('view'); $layout = JRequest::getCmd('layout'); $for = JRequest::getWord("for", false); if ($tmpl == 'component' && !$for) { $doc->addStyleDeclaration('html { overflow:scroll; }'); } // Getting the configuration require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/redshop.cfg.php'; require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/configuration.php'; $Redconfiguration = new Redconfiguration(); $Redconfiguration->defineDynamicVars(); require_once JPATH_SITE . '/components/com_redshop/helpers/currency.php'; $session = JFactory::getSession('product_currency'); $post = JRequest::get('POST'); $Itemid = JRequest::getVar('Itemid'); require_once JPATH_SITE . '/components/com_redshop/helpers/helper.php'; $redhelper = new redhelper(); $cart_Itemid = $redhelper->getCartItemid(); if ($cart_Itemid == "" || $cart_Itemid == 0) { $cItemid = $redhelper->getItemid(); $tmpItemid = $cItemid; } else { $tmpItemid = $cart_Itemid; } if (isset($post['product_currency'])) {
<?php /** * @package RedSHOP.Frontend * @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; JHTML::_('behavior.tooltip'); JHTMLBehavior::modal(); $url = JURI::base(); require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/order.php'; $order_function = new order_functions(); $redconfig = new Redconfiguration(); $producthelper = new producthelper(); $carthelper = new rsCarthelper(); $Itemid = JRequest::getInt('Itemid'); $print = JRequest::getInt('print'); $document = JFactory::getDocument(); $redTemplate = new Redtemplate(); $template_id = $this->params->get('template_id'); $orderslist_template = $redTemplate->getTemplate("order_list", $template_id); if (count($orderslist_template) > 0 && $orderslist_template[0]->template_desc != "") { $template_desc = $orderslist_template[0]->template_desc; } else { $template_desc = "<table border=\"0\" cellspacing=\"5\" cellpadding=\"5\" width=\"100%\">\r\n<tbody>\r\n<tr>\r\n<th>{order_id_lbl}</th> <th>{product_name_lbl}</th> <th>{total_price_lbl}</th> <th>{order_date_lbl}</th> <th>{order_date_lbl}</th> <th>{order_detail_lbl}</th>\r\n</tr>\r\n{product_loop_start} \r\n<tr>\r\n<td>{order_id}</td>\r\n<td>{order_products}</td>\r\n<td>{order_total}</td>\r\n<td>{order_date}</td>\r\n<td>{order_status}</td>\r\n<td>{order_detail_link}</td>\r\n</tr>\r\n{product_loop_end}\r\n</tbody>\r\n</table>\r\n<div>{pagination}</div>"; } if ($this->params->get('show_page_heading', 1)) { ?>
public function replaceProductStockdata($product_id, $property_id, $subproperty_id, $data_add, $stockStatusArray) { if (strstr($data_add, "{stock_status")) { $stocktag = strstr($data_add, "{stock_status"); $newstocktag = explode("}", $stocktag); $realstocktag = $newstocktag[0] . "}"; $stock_tag = substr($newstocktag[0], 1); $sts_array = explode(":", $stock_tag); $avail_class = "available_stock_cls"; if (isset($sts_array[1]) && $sts_array[1] != "") { $avail_class = $sts_array[1]; } $out_stock_class = "out_stock_cls"; if (isset($sts_array[2]) && $sts_array[2] != "") { $out_stock_class = $sts_array[2]; } $pre_order_class = "pre_order_cls"; if (isset($sts_array[3]) && $sts_array[3] != "") { $pre_order_class = $sts_array[3]; } if (!$stockStatusArray['regular_stock']) { if ($stockStatusArray['preorder'] && !$stockStatusArray['preorder_stock'] || !$stockStatusArray['preorder']) { $stock_status = "<span id='stock_status_div" . $product_id . "'><div id='" . $out_stock_class . "' class='" . $out_stock_class . "'>" . JText::_('COM_REDSHOP_OUT_OF_STOCK') . "</div></span>"; } else { $stock_status = "<span id='stock_status_div" . $product_id . "'><div id='" . $pre_order_class . "' class='" . $pre_order_class . "'>" . JText::_('COM_REDSHOP_PRE_ORDER') . "</div></span>"; } } else { $stock_status = "<span id='stock_status_div" . $product_id . "'><div id='" . $avail_class . "' class='" . $avail_class . "'>" . JText::_('COM_REDSHOP_AVAILABLE_STOCK') . "</div></span>"; } $data_add = str_replace($realstocktag, $stock_status, $data_add); } if (strstr($data_add, "{stock_notify_flag}")) { $userArr = $this->_session->get('rs_user'); $user_id = $userArr['rs_userid']; $is_login = $userArr['rs_is_user_login']; $users_info_id = $userArr['rs_user_info_id']; $is_notified = $this->isAlreadyNotifiedUser($user_id, $product_id, $property_id, $subproperty_id); if (!$stockStatusArray['regular_stock'] && $is_login && $users_info_id && $user_id) { if ($stockStatusArray['preorder'] && !$stockStatusArray['preorder_stock'] || !$stockStatusArray['preorder']) { if ($is_notified) { $data_add = str_replace("{stock_notify_flag}", "<div id='notify_stock" . $product_id . "'>" . JText::_('COM_REDSHOP_ALREADY_REQUESTED_FOR_NOTIFICATION') . "</div>", $data_add); } else { $data_add = str_replace("{stock_notify_flag}", '<div id="notify_stock' . $product_id . '"><span >' . JText::_('COM_REDSHOP_NOTIFY_STOCK_LBL') . '</span><input type="button" name="" value="' . JText::_('COM_REDSHOP_NOTIFY_STOCK') . '" class="notifystockbtn" title="' . JText::_('COM_REDSHOP_NOTIFY_STOCK_LBL') . '" onclick="getStocknotify(\'' . $product_id . '\',\'' . $property_id . '\', \'' . $subproperty_id . '\');"></div>', $data_add); } } else { $data_add = str_replace("{stock_notify_flag}", "<div id='notify_stock" . $product_id . "'></div>", $data_add); } } else { $data_add = str_replace("{stock_notify_flag}", "<div id='notify_stock" . $product_id . "'></div>", $data_add); } } if (strstr($data_add, "{product_availability_date}")) { $redshopconfig = new Redconfiguration(); $product = $this->getProductById($product_id); if (!$stockStatusArray['regular_stock'] && $stockStatusArray['preorder']) { if ($product->product_availability_date) { $data_add = str_replace("{product_availability_date_lbl}", "<span id='stock_availability_date_lbl" . $product_id . "'>" . JText::_('COM_REDSHOP_PRODUCT_AVAILABILITY_DATE_LBL') . ": </span>", $data_add); $data_add = str_replace("{product_availability_date}", "<span id='stock_availability_date" . $product_id . "'>" . $redshopconfig->convertDateFormat($product->product_availability_date) . "</span>", $data_add); } else { $data_add = str_replace("{product_availability_date_lbl}", "<span id='stock_availability_date_lbl" . $product_id . "'></span>", $data_add); $data_add = str_replace("{product_availability_date}", "<span id='stock_availability_date" . $product_id . "'></span>", $data_add); } } else { $data_add = str_replace("{product_availability_date_lbl}", "<span id='stock_availability_date_lbl" . $product_id . "'></span>", $data_add); $data_add = str_replace("{product_availability_date}", "<span id='stock_availability_date" . $product_id . "'></span>", $data_add); } } return $data_add; }
/** * Update/create configuration file * * @return void */ private function redshopHandleCFGFile() { require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/configuration.php'; // Include redshop.cfg.php file for cfg variables $cfgfile = JPATH_SITE . "/administrator/components/com_redshop/helpers/redshop.cfg.php"; if (file_exists($cfgfile)) { $configData = JFile::read($cfgfile); $configData = str_replace('<?php', '', $configData); $configData = str_replace('?>', '', $configData); $configData = "<?php" . $configData; JFile::write($cfgfile, $configData); require_once $cfgfile; } $Redconfiguration = new Redconfiguration(); // Declaration $cfgarr = array(); /* * Check before update $cfgarr * for variable is defined or not? * * Example: * if (!defined("TESTING")) * { * $cfgarr["TESTING"] = 3.14; * } */ if (!defined("UPDATE_MAIL_ENABLE")) { $cfgarr["UPDATE_MAIL_ENABLE"] = 1; } if (!defined("DISCOUNT_TYPE")) { $cfgarr["DISCOUNT_TYPE"] = 3; } if (!defined("ENABLE_BACKENDACCESS")) { $cfgarr["ENABLE_BACKENDACCESS"] = 0; } if (!defined("WANT_TO_SHOW_ATTRIBUTE_IMAGE_INCART")) { $cfgarr["WANT_TO_SHOW_ATTRIBUTE_IMAGE_INCART"] = 0; } if (!defined("ADDTOCART_BEHAVIOUR")) { $cfgarr["ADDTOCART_BEHAVIOUR"] = 1; } if (!defined("SHOPPER_GROUP_DEFAULT_UNREGISTERED") && defined("SHOPPER_GROUP_DEFAULT_PRIVATE")) { $cfgarr["SHOPPER_GROUP_DEFAULT_UNREGISTERED"] = SHOPPER_GROUP_DEFAULT_PRIVATE; } if (!defined("INDIVIDUAL_ADD_TO_CART_ENABLE")) { $cfgarr["INDIVIDUAL_ADD_TO_CART_ENABLE"] = 0; } if (!defined("PRODUCT_ADDIMG_IS_LIGHTBOX")) { $cfgarr["PRODUCT_ADDIMG_IS_LIGHTBOX"] = 1; } if (!defined("POSTDK_CUSTOMER_NO")) { $cfgarr["POSTDK_CUSTOMER_NO"] = 1; } if (!defined("POSTDK_INTEGRATION")) { $cfgarr["POSTDK_INTEGRATION"] = 0; } if (!defined("POSTDK_CUSTOMER_PASSWORD")) { $cfgarr["POSTDK_CUSTOMER_PASSWORD"] = ''; } if (!defined("ENABLE_SEF_NUMBER_NAME")) { $cfgarr["ENABLE_SEF_NUMBER_NAME"] = ''; } if (!defined("UNIT_DECIMAL")) { $cfgarr["UNIT_DECIMAL"] = ''; } if (!defined("ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC")) { $cfgarr["ATTRIBUTE_AS_PRODUCT_IN_ECONOMIC"] = 0; } if (!defined("CATEGORY_DESC_MAX_CHARS")) { $cfgarr["CATEGORY_DESC_MAX_CHARS"] = ''; } if (!defined("CATEGORY_DESC_END_SUFFIX")) { $cfgarr["CATEGORY_DESC_END_SUFFIX"] = ''; } if (!defined("DEFAULT_QUOTATION_MODE_PRE")) { $cfgarr["DEFAULT_QUOTATION_MODE_PRE"] = '0'; } if (!defined("SHOW_PRICE_PRE")) { $cfgarr["SHOW_PRICE_PRE"] = '1'; } if (!defined("QUICKLINK_ICON")) { $cfgarr["QUICKLINK_ICON"] = ''; } if (!defined("DISPLAY_STOCKROOM_ATTRIBUTES")) { $cfgarr["DISPLAY_STOCKROOM_ATTRIBUTES"] = ''; } if (!defined("DISPLAY_NEW_ORDERS")) { $cfgarr["DISPLAY_NEW_ORDERS"] = '0'; } if (!defined("DISPLAY_NEW_CUSTOMERS")) { $cfgarr["DISPLAY_NEW_CUSTOMERS"] = '0'; } if (!defined("DISPLAY_STATISTIC")) { $cfgarr["DISPLAY_STATISTIC"] = '0'; } if (!defined("EXPAND_ALL")) { $cfgarr["EXPAND_ALL"] = '0'; } if (!defined("NOOF_THUMB_FOR_SCROLLER")) { $cfgarr["NOOF_THUMB_FOR_SCROLLER"] = '3'; } if (!defined("POSTDANMARK_ADDRESS")) { $cfgarr["POSTDANMARK_ADDRESS"] = 'address'; } if (!defined("POSTDANMARK_POSTALCODE")) { $cfgarr["POSTDANMARK_POSTALCODE"] = '13256'; } if (!defined("SEND_CATALOG_REMINDER_MAIL")) { $cfgarr["SEND_CATALOG_REMINDER_MAIL"] = '0'; } if (!defined("AJAX_CART_DISPLAY_TIME")) { $cfgarr["AJAX_CART_DISPLAY_TIME"] = '3000'; } if (!defined("PAYMENT_CALCULATION_ON")) { $cfgarr["PAYMENT_CALCULATION_ON"] = 'subtotal'; } if (!defined("IMAGE_QUALITY_OUTPUT")) { $cfgarr["IMAGE_QUALITY_OUTPUT"] = '100'; } if (!defined("DEFAULT_NEWSLETTER")) { $cfgarr["DEFAULT_NEWSLETTER"] = '1'; } if (!defined("DETAIL_ERROR_MESSAGE_ON")) { $cfgarr["DETAIL_ERROR_MESSAGE_ON"] = '1'; } if (!defined("MANUFACTURER_TITLE_MAX_CHARS")) { $cfgarr["MANUFACTURER_TITLE_MAX_CHARS"] = ''; } if (!defined("MANUFACTURER_TITLE_END_SUFFIX")) { $cfgarr["MANUFACTURER_TITLE_END_SUFFIX"] = ''; } if (!defined("WRITE_REVIEW_IS_LIGHTBOX")) { $cfgarr["WRITE_REVIEW_IS_LIGHTBOX"] = '0'; } if (!defined("SPECIAL_DISCOUNT_MAIL_SEND")) { $cfgarr["SPECIAL_DISCOUNT_MAIL_SEND"] = '1'; } if (!defined("WATERMARK_PRODUCT_ADDITIONAL_IMAGE")) { $cfgarr["WATERMARK_PRODUCT_ADDITIONAL_IMAGE"] = '0'; } if (!defined("ACCESSORY_AS_PRODUCT_IN_CART_ENABLE")) { $cfgarr["ACCESSORY_AS_PRODUCT_IN_CART_ENABLE"] = '0'; } if (!defined("ATTRIBUTE_SCROLLER_THUMB_WIDTH")) { $cfgarr["ATTRIBUTE_SCROLLER_THUMB_WIDTH"] = '50'; } if (!defined("ATTRIBUTE_SCROLLER_THUMB_HEIGHT")) { $cfgarr["ATTRIBUTE_SCROLLER_THUMB_HEIGHT"] = '50'; } if (!defined("NOOF_SUBATTRIB_THUMB_FOR_SCROLLER")) { $cfgarr["NOOF_SUBATTRIB_THUMB_FOR_SCROLLER"] = '3'; } if (!defined("COMPARE_PRODUCT_THUMB_WIDTH")) { $cfgarr["COMPARE_PRODUCT_THUMB_WIDTH"] = '70'; } if (!defined("COMPARE_PRODUCT_THUMB_HEIGHT")) { $cfgarr["COMPARE_PRODUCT_THUMB_HEIGHT"] = '70'; } if (!defined("CATEGORY_TITLE_MAX_CHARS")) { $cfgarr["CATEGORY_TITLE_MAX_CHARS"] = ''; } if (!defined("CATEGORY_TITLE_END_SUFFIX")) { $cfgarr["CATEGORY_TITLE_END_SUFFIX"] = ''; } if (!defined("PRODUCT_DETAIL_LIGHTBOX_CLOSE_BUTTON_IMAGE")) { $cfgarr["PRODUCT_DETAIL_LIGHTBOX_CLOSE_BUTTON_IMAGE"] = ''; } if (!defined("USE_ENCODING")) { $cfgarr["USE_ENCODING"] = '0'; } if (!defined("CREATE_ACCOUNT_CHECKBOX")) { $cfgarr["CREATE_ACCOUNT_CHECKBOX"] = '0'; } if (!defined("SHOW_QUOTATION_PRICE")) { $cfgarr["SHOW_QUOTATION_PRICE"] = '0'; } if (!defined("CHILDPRODUCT_DROPDOWN")) { $cfgarr["CHILDPRODUCT_DROPDOWN"] = 'product_name'; } if (!defined("ENABLE_ADDRESS_DETAIL_IN_SHIPPING")) { $cfgarr["ENABLE_ADDRESS_DETAIL_IN_SHIPPING"] = '0'; } if (!defined("PURCHASE_PARENT_WITH_CHILD")) { $cfgarr["PURCHASE_PARENT_WITH_CHILD"] = '0'; } if (!defined("CALCULATION_PRICE_DECIMAL")) { $cfgarr["CALCULATION_PRICE_DECIMAL"] = '4'; } if (!defined("REQUESTQUOTE_IMAGE")) { $cfgarr["REQUESTQUOTE_IMAGE"] = 'requestquote.gif'; } if (!defined("REQUESTQUOTE_BACKGROUND")) { $cfgarr["REQUESTQUOTE_BACKGROUND"] = 'requestquotebg.jpg'; } if (!defined("SHOW_PRODUCT_DETAIL")) { $cfgarr["SHOW_PRODUCT_DETAIL"] = 1; } if (!defined("WEBPACK_ENABLE_EMAIL_TRACK")) { $cfgarr["WEBPACK_ENABLE_EMAIL_TRACK"] = 1; } if (!defined("WEBPACK_ENABLE_SMS")) { $cfgarr["WEBPACK_ENABLE_SMS"] = 1; } if (!defined("REQUIRED_VAT_NUMBER")) { $cfgarr["REQUIRED_VAT_NUMBER"] = 1; } if (!defined("ACCESSORY_PRODUCT_IN_LIGHTBOX")) { $cfgarr["ACCESSORY_PRODUCT_IN_LIGHTBOX"] = 0; } if (!defined("PRODUCT_PREVIEW_IMAGE_WIDTH")) { $cfgarr["PRODUCT_PREVIEW_IMAGE_WIDTH"] = 100; } if (!defined("PRODUCT_PREVIEW_IMAGE_HEIGHT")) { $cfgarr["PRODUCT_PREVIEW_IMAGE_HEIGHT"] = 100; } if (!defined("CATEGORY_PRODUCT_PREVIEW_IMAGE_WIDTH")) { $cfgarr["CATEGORY_PRODUCT_PREVIEW_IMAGE_WIDTH"] = 100; } if (!defined("CATEGORY_PRODUCT_PREVIEW_IMAGE_HEIGHT")) { $cfgarr["CATEGORY_PRODUCT_PREVIEW_IMAGE_HEIGHT"] = 100; } if (!defined("DISPLAY_OUT_OF_STOCK_ATTRIBUTE_DATA")) { $cfgarr["DISPLAY_OUT_OF_STOCK_ATTRIBUTE_DATA"] = 1; } if (!defined("SEND_MAIL_TO_CUSTOMER")) { $cfgarr["SEND_MAIL_TO_CUSTOMER"] = 1; } if (!defined("AJAX_DETAIL_BOX_WIDTH")) { $cfgarr["AJAX_DETAIL_BOX_WIDTH"] = 500; } if (!defined("AJAX_DETAIL_BOX_HEIGHT")) { $cfgarr["AJAX_DETAIL_BOX_HEIGHT"] = 600; } if (!defined("AJAX_BOX_WIDTH")) { $cfgarr["AJAX_BOX_WIDTH"] = 500; } if (!defined("AJAX_BOX_HEIGHT")) { $cfgarr["AJAX_BOX_HEIGHT"] = 150; } if (!defined("ORDER_MAIL_AFTER")) { $cfgarr["ORDER_MAIL_AFTER"] = 0; } $Redconfiguration->manageCFGFile($cfgarr); // End }