Ejemplo n.º 1
0
 public function getGiftcardTemplate()
 {
     $redTemplate = new Redtemplate();
     if (!$this->_id) {
         $carttemplate = $redTemplate->getTemplate("giftcard_list");
     } else {
         $carttemplate = $redTemplate->getTemplate("giftcard");
     }
     return $carttemplate;
 }
Ejemplo n.º 2
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $context = 'category_id';
     $redTemplate = new Redtemplate();
     $product_category = new product_category();
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSHOP_CATEGORY'));
     JToolBarHelper::title(JText::_('COM_REDSHOP_CATEGORY_MANAGEMENT'), 'redshop_categories48');
     JToolBarHelper::addNewX();
     JToolBarHelper::editListX();
     JToolBarHelper::customX('copy', 'copy.png', 'copy_f2.png', JText::_('COM_REDSHOP_TOOLBAR_COPY'), true);
     JToolBarHelper::deleteList();
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     $uri = JFactory::getURI();
     $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'c.ordering');
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '');
     $limitstart = $app->getUserStateFromRequest($context . 'limitstart', 'limitstart', '0');
     $limit = $app->getUserStateFromRequest($context . 'limit', 'limit', '10');
     $lists['order'] = $filter_order;
     $lists['order_Dir'] = $filter_order_Dir;
     $GLOBALS['catlist'] = array();
     $catid = JRequest::getVar('category_id', 0, '');
     $categories = $this->get('Data');
     $pagination = $this->get('Pagination');
     $category_main_filter = $app->getUserStateFromRequest($context . 'category_main_filter', 'category_main_filter', '');
     $optionsection = array();
     $optionsection[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT'));
     $category_id = $app->getUserStateFromRequest($context . 'category_id', 'category_id', '');
     $category_name = $app->getUserStateFromRequest($context . 'category_name', 'category_name', 0);
     $category = new product_category();
     $categories_parent = $category->getParentCategories();
     $temps = array();
     $temps[0] = new stdClass();
     $temps[0]->category_id = "0";
     $temps[0]->category_name = JText::_('COM_REDSHOP_SELECT');
     $categories_parent = @array_merge($temps, $categories_parent);
     $lists['category'] = JHTML::_('select.genericlist', $categories_parent, 'category_id', 'class="inputbox" onchange="document.adminForm.submit();"      ', 'category_id', 'category_name', $category_id);
     /*
      * assign template
      */
     $templates = $redTemplate->getTemplate('category');
     $temps = array();
     $temps[0] = new stdClass();
     $temps[0]->template_id = "0";
     $temps[0]->template_name = JText::_('COM_REDSHOP_ASSIGN_TEMPLATE');
     $templates = @array_merge($temps, $templates);
     $lists['category_template'] = JHTML::_('select.genericlist', $templates, 'category_template', 'class="inputbox" size="1"  onchange="return AssignTemplate()" ', 'template_id', 'template_name', 0);
     $this->category_main_filter = $category_main_filter;
     $this->user = JFactory::getUser();
     $this->lists = $lists;
     $this->categories = $categories;
     $this->pagination = $pagination;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Ejemplo n.º 3
0
 public function getProductTemplate()
 {
     $redTemplate = new Redtemplate();
     if (empty($this->_template)) {
         $this->_template = $redTemplate->getTemplate("product", $this->_data->product_template);
         $this->_template = $this->_template[0];
     }
     return $this->_template;
 }
Ejemplo n.º 4
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     // Request variables
     $redTemplate = new Redtemplate();
     $user = JFactory::getUser();
     $session = JFactory::getSession();
     $cart = $session->get('cart');
     $layout = JRequest::getCmd('layout');
     if (!$cart) {
         $cart = array();
     }
     $Itemid = JRequest::getInt('Itemid');
     if (JRequest::getString('quotemsg') != "") {
         $app->Redirect('index.php?option=com_redshop&view=cart&Itemid=' . $Itemid, JRequest::getString('quotemsg'));
     }
     JHTML::Script('common.js', 'components/com_redshop/assets/js/', false);
     if (!array_key_exists("idx", $cart) || array_key_exists("idx", $cart) && $cart['idx'] < 1) {
         $cart_data = $redTemplate->getTemplate("empty_cart");
         if (count($cart_data) > 0 && $cart_data[0]->template_desc != "") {
             $cart_template = $cart_data[0]->template_desc;
         } else {
             $cart_template = JText::_("COM_REDSHOP_EMPTY_CART");
         }
         echo eval("?>" . $cart_template . "<?php ");
         return false;
     }
     $Discount = $this->get('DiscountId');
     $data = $this->get('data');
     if ($layout == 'change_attribute') {
         $this->setLayout('change_attribute');
     }
     $this->Discount = $Discount;
     $this->cart = $cart;
     $this->data = $data;
     parent::display($tpl);
 }
Ejemplo n.º 5
0
				alert(requiedAttribute);
				return false;
			}
			else if (requiedProperty != 0 && requiedProperty != "")
			{
				alert(requiedProperty);
				return false;
			}
			else
			{
				document.frmchngAttribute.submit();
			}
		}
	</script>
<?php 
$cart_attribute = $redTemplate->getTemplate("change_cart_attribute");
if (count($cart_attribute) > 0 && $cart_attribute[0]->template_desc) {
    $template_desc = $cart_attribute[0]->template_desc;
} else {
    $template_desc = '<table border="0">\\r\\n<tbody>\\r\\n<tr>\\r\\n<th>Change Attribute</th>\\r\\n</tr>\\r\\n<tr>\\r\\n<td>{attribute_template:attributes}</td>\\r\\n</tr>\\r\\n<tr>\\r\\n<td>{apply_button} {cancel_button}</td>\\r\\n</tr>\\r\\n</tbody>\\r\\n</table>';
}
$product = $producthelper->getProductById($product_id);
// Checking for child products
$childproduct = $producthelper->getChildProduct($product_id);
if (count($childproduct) > 0) {
    $isChilds = true;
} else {
    $isChilds = false;
}
// Product attribute  Start
if ($isChilds) {
Ejemplo n.º 6
0
 /**
  * One Step checkout process
  *
  * @return void
  */
 public function oneStepCheckoutProcess()
 {
     $producthelper = new producthelper();
     $redTemplate = new Redtemplate();
     $carthelper = new rsCarthelper();
     $order_functions = new order_functions();
     $model = $this->getModel('checkout');
     $post = JRequest::get('post');
     $user = JFactory::getUser();
     $session = JFactory::getSession();
     $cart = $session->get('cart');
     $users_info_id = $post['users_info_id'];
     $shipping_box_id = $post['shipping_box_id'];
     $shipping_rate_id = $post['shipping_rate_id'];
     $customer_note = $post['customer_note'];
     $req_number = $post['requisition_number'];
     $customer_message = $post['rs_customer_message_ta'];
     $referral_code = $post['txt_referral_code'];
     $payment_method_id = $post['payment_method_id'];
     $order_total = $cart['total'];
     $total_discount = $cart['cart_discount'] + $cart['voucher_discount'] + $cart['coupon_discount'];
     $order_subtotal = SHIPPING_AFTER == 'total' ? $cart['product_subtotal'] - $total_discount : $cart['product_subtotal_excl_vat'];
     $Itemid = $post['Itemid'];
     $objectname = $post['objectname'];
     $rate_template_id = $post['rate_template_id'];
     $cart_template_id = $post['cart_template_id'];
     $onestep_template_desc = "";
     $rate_template_desc = "";
     if ($objectname == "users_info_id" || $objectname == "shipping_box_id") {
         if ($users_info_id > 0) {
             $shipping_template = $redTemplate->getTemplate("redshop_shipping", $rate_template_id);
             if (count($shipping_template) > 0) {
                 $rate_template_desc = $shipping_template[0]->template_desc;
             }
             $returnarr = $carthelper->replaceShippingTemplate($rate_template_desc, $shipping_rate_id, $shipping_box_id, $user->id, $users_info_id, $order_total, $order_subtotal);
             $rate_template_desc = $returnarr['template_desc'];
             $shipping_rate_id = $returnarr['shipping_rate_id'];
         } else {
             $rate_template_desc = JText::_('COM_REDSHOP_FILL_SHIPPING_ADDRESS');
         }
     }
     if ($shipping_rate_id != "") {
         $shipArr = $model->calculateShipping($shipping_rate_id);
         $cart['shipping'] = $shipArr['order_shipping_rate'];
         $cart['shipping_vat'] = $shipArr['shipping_vat'];
         $cart = $carthelper->modifyDiscount($cart);
     }
     if ($cart_template_id != 0) {
         $templatelist = $redTemplate->getTemplate("checkout", $cart_template_id);
         $onestep_template_desc = $templatelist[0]->template_desc;
         $onestep_template_desc = $model->displayShoppingCart($onestep_template_desc, $users_info_id, $shipping_rate_id, $payment_method_id, $Itemid, $customer_note, $req_number, '', $customer_message, $referral_code);
     }
     $display_shippingrate = '<div id="onestepshiprate">' . $rate_template_desc . '</div>';
     $display_cart = '<div id="onestepdisplaycart">' . $onestep_template_desc . '</div>';
     $description = $display_shippingrate . $display_cart;
     $lang = JFactory::getLanguage();
     $Locale = $lang->getLocale();
     if (in_array('ru', $Locale)) {
         // Commented because redshop currency symbole has been changed because of ajax response
         $description = html_entity_decode($description, ENT_QUOTES, 'KOI8-R');
     }
     $cart_total = $producthelper->getProductFormattedPrice($cart['mod_cart_total']);
     echo "`_`" . $description . "`_`" . $cart_total;
     die;
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
<?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 
Ejemplo n.º 9
0
$extra_field = new extra_field();
$extraField = new extraField();
$carthelper = new rsCarthelper();
$user = JFactory::getUser();
$Itemid = JRequest::getInt('Itemid');
$app = JFactory::getApplication();
$params = $app->getParams('com_redshop');
$returnitemid = $params->get('logout', $Itemid);
$accountbillto_link = JRoute::_("index.php?option=com_redshop&view=account_billto&Itemid=" . $Itemid);
$accountshipto_link = JRoute::_("index.php?option=com_redshop&view=account_shipto&Itemid=" . $Itemid);
$logout_link = JRoute::_("index.php?option=com_redshop&view=login&task=logout&logout=" . $returnitemid . "&Itemid=" . $Itemid);
$compare_link = JRoute::_("index.php?option=com_redshop&view=product&layout=compare&Itemid=" . $Itemid);
$mytags_link = JRoute::_("index.php?option=com_redshop&view=account&layout=mytags&Itemid=" . $Itemid);
$wishlist_link = JRoute::_("index.php?option=com_redshop&view=wishlist&task=viewwishlist&Itemid=" . $Itemid);
$model = $this->getModel('account');
$template = $redTemplate->getTemplate("account_template");
if (count($template) > 0 && $template[0]->template_desc != "") {
    $template_desc = $template[0]->template_desc;
} else {
    $template_desc = "<table border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td>{welcome_introtext}</td>\r\n</tr>\r\n<tr>\r\n<td class=\"account_billinginfo\">\r\n<table border=\"0\" cellspacing=\"10\" cellpadding=\"10\" width=\"100%\">\r\n<tbody>\r\n<tr valign=\"top\">\r\n<td width=\"40%\">{account_image}<strong>{account_title}</strong><br /><br /> \r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\r\n<tbody>\r\n<tr>\r\n<td class=\"account_label\">{fullname_lbl}</td>\r\n<td class=\"account_field\">{fullname}</td>\r\n</tr>\r\n<tr>\r\n<td class=\"account_label\">{state_lbl}</td>\r\n<td class=\"account_field\">{state}</td>\r\n</tr>\r\n<tr>\r\n<td class=\"account_label\">{country_lbl}</td>\r\n<td class=\"account_field\">{country}</td>\r\n</tr>\r\n<tr>\r\n<td class=\"account_label\">{vatnumber_lbl}</td>\r\n<td class=\"account_field\">{vatnumber}</td>\r\n</tr>\r\n<tr>\r\n<td class=\"account_label\">{email_lbl}</td>\r\n<td class=\"account_field\">{email}</td>\r\n</tr>\r\n<tr>\r\n<td class=\"account_label\">{company_name_lbl}</td>\r\n<td class=\"account_field\">{company_name}</td>\r\n</tr>\r\n<tr>\r\n<td colspan=\"2\">{edit_account_link}</td>\r\n</tr>\r\n<tr>\r\n<td colspan=\"2\">{newsletter_signup_chk} {newsletter_signup_lbl}</td>\r\n</tr>\r\n<tr><td colspan=\"2\">{customer_custom_fields}</td></tr></tbody>\r\n</table>\r\n</td>\r\n<td>\r\n<table border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td>{order_image}<strong>{order_title}</strong></td>\r\n</tr>\r\n{order_loop_start}          \r\n<tr>\r\n<td>{order_index} {order_id} {order_detail_link}</td>\r\n</tr>\r\n{order_loop_end}          \r\n<tr>\r\n<td>{more_orders}</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td class=\"account_shippinginfo\">{shipping_image}<strong>{shipping_title}</strong> <br /><br /> \r\n<table border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td>{edit_shipping_link}</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n<td>\r\n<table border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td>{quotation_image}<strong>{quotation_title}</strong></td>\r\n</tr>\r\n{quotation_loop_start}          \r\n<tr>\r\n<td>{quotation_index} {quotation_id} {quotation_detail_link}</td>\r\n</tr>\r\n{quotation_loop_end}\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td>{product_serial_image}<strong>{product_serial_title}</strong><br /><br /> \r\n<table border=\"0\">\r\n<tbody>\r\n{product_serial_loop_start}            \r\n<tr>\r\n<td>{product_name} {product_serial_number}</td>\r\n</tr>\r\n{product_serial_loop_end}\r\n</tbody>\r\n</table>\r\n</td>\r\n<td>\r\n<table border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td>{coupon_image}<strong>{coupon_title}</strong></td>\r\n</tr>\r\n{coupon_loop_start}         \r\n<tr>\r\n<td>{coupon_code_lbl} {coupon_code}</td>\r\n</tr>\r\n<tr>\r\n<td>{coupon_value_lbl} {coupon_value}</td>\r\n</tr>\r\n{coupon_loop_end}\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td>{wishlist_image}<strong>{wishlist_title}</strong><br /><br /> \r\n<table border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td>{edit_wishlist_link}</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n<td>{compare_image}<strong>{compare_title}</strong> <br /><br /> \r\n<table border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td>{edit_compare_link}</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td>{logout_link}</td>\r\n<td>{tag_image}<strong>{tag_title}</strong><br /><br /> \r\n<table border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td>{edit_tag_link}</td>\r\n</tr>\r\n</tbody>\r\n</table></td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>";
}
$pagetitle = JText::_('COM_REDSHOP_ACCOUNT_MAINTAINANCE');
if ($this->params->get('show_page_heading', 1)) {
    ?>
	<h1 class="componentheading<?php 
    echo $this->escape($this->params->get('pageclass_sfx'));
    ?>
">
		<?php 
    if ($this->params->get('page_title') != $pagetitle) {
        echo $this->escape($this->params->get('page_title'));
Ejemplo n.º 10
0
</div>
<?php 
}
?>
	<div><?php 
echo ORDER_DETAIL_INTROTEXT;
?>
</div>
<?php 
$model = $this->getModel('order_detail');
$OrdersDetail = $this->OrdersDetail;
$OrderProducts = $order_functions->getOrderItemDetail($oid);
$partialpayment = $order_functions->getOrderPartialPayment($oid);
// Get order Payment method information
if (USE_AS_CATALOG) {
    $orderslist_template = $redTemplate->getTemplate("catalogue_order_detail");
    $orderslist_template = $orderslist_template[0]->template_desc;
} else {
    $orderslist_template = $redTemplate->getTemplate("order_detail");
    if (count($orderslist_template) > 0 && $orderslist_template[0]->template_desc) {
        $orderslist_template = $orderslist_template[0]->template_desc;
    } else {
        $orderslist_template = '<div class="product_print">{print}</div><table style="width: 100%;" border="0" cellspacing="0" cellpadding="5"><tbody><tr><td colspan="2"><table style="width: 100%;" border="0" cellspacing="0" cellpadding="2"><tbody><tr style="background-color: #cccccc"><th align="left">{discount_type_lbl}</th></tr><tr><td>{discount_type}</td></tr><tr style="background-color: #cccccc;"><th align="left">{order_information_lbl}</th></tr><tr></tr><tr><td>{order_id_lbl} : {order_id}</td></tr><tr><td>{order_number_lbl} : {order_number}</td></tr><tr><td>{order_date_lbl} : {order_date}</td></tr><tr><td>{order_status_lbl} : {order_status}</td></tr></tbody></table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellspacing="0" cellpadding="2"><tbody><tr style="background-color: #cccccc;"><th align="left">{billing_address_information_lbl}</th></tr><tr></tr><tr><td>{billing_address}</td></tr></tbody></table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellspacing="0" cellpadding="2"><tbody><tr style="background-color: #cccccc;"><th align="left">{shipping_address_information_lbl}</th></tr><tr></tr><tr><td>{shipping_address}</td></tr></tbody></table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellspacing="0" cellpadding="2"><tbody><tr style="background-color: #cccccc;"><th align="left">{order_detail_lbl}</th></tr><tr></tr><tr><td><table style="width: 100%;" border="0" cellspacing="2" cellpadding="2"><tbody><tr><td>{copy_orderitem_lbl}</td><td>{product_name_lbl}</td><td>{note_lbl}</td><td>{price_lbl}</td><td>{quantity_lbl}</td><td align="right">{total_price_lbl}</td></tr>{product_loop_start}<tr><td>{copy_orderitem}</td><td>{product_name}<br />{product_attribute}{product_accessory}{product_userfields}</td><td>{product_wrapper}</td><td>{product_price}</td><td>{product_quantity}</td><td align="right">{product_total_price}</td></tr>{product_loop_end}</tbody></table></td></tr><tr><td>{customer_note_lbl}: {customer_note}</td></tr><tr><td>{requisition_number_lbl}: {requisition_number}</td></tr><tr><td><table class="cart_calculations" border="1"><tbody><tr class="tdborder"><td><b>Product Subtotal:</b></td><td width="100">{product_subtotal}</td><td><b>Product Subtotal excl vat:</b></td><td width="100">{product_subtotal_excl_vat}</td></tr><tr><td><b>Shipping with vat:</b></td><td width="100">{shipping}</td><td><b>Shipping excl vat:</b></td><td width="100">{shipping_excl_vat}</td></tr>{if discount}<tr class="tdborder"><td>{discount_lbl}</td><td width="100">{discount}</td><td>{discount_lbl}</td><td width="100">{discount_excl_vat}</td></tr>{discount end if}<tr><td><b>{totalpurchase_lbl}:</b></td><td width="100">{order_subtotal}</td><td><b>{subtotal_excl_vat_lbl} :</b></td><td width="100">{order_subtotal_excl_vat}</td></tr>{if vat}<tr class="tdborder"><td>{vat_lbl}</td><td width="100">{tax}</td><td>{vat_lbl}</td><td width="100">{sub_total_vat}</td></tr>{vat end if}   {if payment_discount}<tr><td>{payment_discount_lbl}</td><td width="100">{payment_order_discount}</td></tr>{payment_discount end if}<tr class="tdborder"><td><b>{tax_with_shipping_lbl}</b></td><td width="100">{shipping}</td><td><b>{shipping_lbl}</b></td><td width="100">{shipping_excl_vat}</td></tr><tr><td><div class="singleline"><strong>{total_lbl}:</strong></div></td><td width="100"><div class="singleline">{order_total}</div></td><td><div class="singleline"><b>{total_lbl}:</b></div></td><td width="100"><div class="singleline">{total_excl_vat}</div></td></tr></tbody></table></td></tr><tr><td align="left">{reorder_button}</td></tr></tbody></table></td></tr></tbody></table>';
    }
}
if ($print) {
    $onclick = "onclick='window.print();'";
} else {
    $print_url = $url . "index.php?option=com_redshop&view=order_detail&oid=" . $oid . "&print=1&tmpl=component&Itemid=" . $Itemid . "&encr=" . JRequest::getCmd('encr', '');
    $onclick = "onclick='window.open(\"{$print_url}\",\"mywindow\",\"scrollbars=1\",\"location=1\")'";
}
Ejemplo n.º 11
0
	<h1 class="componentheading<?php 
    echo $this->escape($this->params->get('pageclass_sfx'));
    ?>
">
		<?php 
    if ($this->params->get('page_title') != $pagetitle) {
        echo $this->escape($this->params->get('page_title'));
    } else {
        echo $pagetitle;
    }
    ?>
	</h1>
<?php 
}
// Page title end
$manufacturertemplate = $redTemplate->getTemplate("manufacturer_products", $manufacturer->template_id);
if (count($manufacturertemplate) > 0 && $manufacturertemplate[0]->template_desc) {
    $template_desc = $manufacturertemplate[0]->template_desc;
    $template_id = $manufacturertemplate[0]->template_id;
} else {
    $template_desc = "<div class=\"category_print\">{print}</div>\r\n<div style=\"clear: both;\"></div>\r\n<div class=\"manufacturer_name\">{manufacturer_name}</div>\r\n<div class=\"manufacturer_image\">{manufacturer_image}</div>\r\n<div class=\"manufacturer_description\">{manufacturer_description}</div>\r\n\r\n<div style=\"clear: both;\"></div>\r\n\r\n<div id=\"category_header\">\r\n\t<div class=\"category_order_by\">\r\n\t\t{order_by} \r\n\t</div>\r\n</div>\r\n\r\n<div class=\"category_box_wrapper\">{product_loop_start}\r\n<div>{category_heading_start}<div>*{category_name}<div>{category_heading_end}</div>\r\n<div class=\"category_box_outside\">\r\n<div class=\"category_box_inside\">\r\n<div class=\"category_product_image\">{product_thumb_image_1}</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>\r\n</div>\r\n{product_loop_end}</div>\r\n<div class=\"category_pagination\">{pagination} </div>";
    $template_id = 0;
}
if ($print) {
    $onclick = "onclick='window.print();'";
} else {
    $print_url = $url . "index.php?option=com_redshop&view=manufacturers&layout=products&mid=" . $manufacturer->manufacturer_id . "&print=1&tmpl=component&Itemid=" . $Itemid;
    $onclick = "onclick='window.open(\"{$print_url}\",\"mywindow\",\"scrollbars=1\",\"location=1\")'";
}
$print_tag = "<a " . $onclick . " title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "'>";
$print_tag .= "<img src='" . JSYSTEM_IMAGES_PATH . "printButton.png' alt='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' />";
Ejemplo n.º 12
0
 public function clickatellSMS($order_id)
 {
     if (CLICKATELL_ENABLE <= 0) {
         return;
     }
     $db = JFactory::getDbo();
     $shippinghelper = new shipping();
     $query = "SELECT * FROM " . $this->_table_prefix . "order_users_info AS oui " . "LEFT JOIN " . $this->_table_prefix . "orders AS o ON o.order_id = oui.order_id " . "WHERE oui.order_id = " . (int) $order_id . " " . "AND address_type='ST' ";
     $this->_db->setQuery($query);
     $orderData = $this->_db->loadobject();
     $query = "SELECT payment_method_name, oy.payment_method_id FROM " . $this->_table_prefix . "order_payment AS oy " . "LEFT JOIN " . $this->_table_prefix . "orders AS o ON o.order_id = oy.order_id " . "LEFT JOIN " . $this->_table_prefix . "payment_method AS p ON p.payment_method_id = oy.payment_method_id " . "WHERE oy.order_id = " . (int) $order_id;
     $this->_db->setQuery($query);
     $paymentData = $this->_db->loadobject();
     $paymentName = $paymentData->payment_method_name;
     $payment_method_id = $paymentData->payment_method_id;
     $redTemplate = new Redtemplate();
     $TemplateDetail = $redTemplate->getTemplate("clicktell_sms_message");
     $order_shipping_class = 0;
     $order_shipping = explode("|", $shippinghelper->decryptShipping(str_replace(" ", "+", $orderData->ship_method_id)));
     if (isset($order_shipping[0])) {
         $order_shipping_class = $order_shipping[0];
     }
     $p_where = " AND (FIND_IN_SET( " . $db->quote($payment_method_id) . ", payment_methods ))";
     $s_where = " AND (FIND_IN_SET( " . $db->quote($order_shipping_class) . ", shipping_methods ))";
     $orderby = " ORDER BY `template_id` DESC LIMIT 0,1";
     $query = "SELECT * FROM " . $this->_table_prefix . "template AS t " . "WHERE t.template_section = 'clicktell_sms_message' " . "AND (FIND_IN_SET( " . $db->quote($orderData->order_status) . ", order_status )) ";
     $to = $orderData->phone;
     $this->_db->setQuery($query . $p_where . $orderby);
     $payment_methods = $this->_db->loadobject();
     $message = $this->replaceMessage($payment_methods->template_desc, $orderData, $paymentName);
     if ($message) {
         $this->sendmessage(urlencode($message), $to);
     }
     $this->_db->setQuery($query . $s_where . $orderby);
     $shipping_methods = $this->_db->loadobject();
     $message = $this->replaceMessage($shipping_methods->template_desc, $orderData, $paymentName);
     if ($message) {
         $this->sendmessage(urlencode($message), $to);
     }
     if (CLICKATELL_ORDER_STATUS == $orderData->order_status) {
         $message = $this->replaceMessage($TemplateDetail[0]->template_desc, $orderData, $paymentName);
         if ($message) {
             $this->sendmessage(urlencode($message), $to);
         }
     }
 }
Ejemplo n.º 13
0
 public function replaceUserfield($product_id = 0, $template_id = 0, $unique_id = "")
 {
     $producthelper = new producthelper();
     $redTemplate = new Redtemplate();
     $extraField = new extra_field();
     $template_desc = $redTemplate->getTemplate("product", $template_id);
     $returnArr = $producthelper->getProductUserfieldFromTemplate($template_desc[0]->template_desc);
     $commonid = $product_id . $unique_id;
     $product_userfileds = "<table>";
     for ($ui = 0; $ui < count($returnArr[1]); $ui++) {
         $result_arr = $extraField->list_all_user_fields($returnArr[1][$ui], 12, "", $commonid);
         $hidden_arr = $extraField->list_all_user_fields($returnArr[1][$ui], 12, "hidden", $commonid);
         if ($result_arr[0] != "") {
             $product_userfileds .= "<tr><td>" . $result_arr[0] . "</td><td>" . $result_arr[1] . $hidden_arr[1] . "</td></tr>";
         }
     }
     $product_userfileds .= "</table>";
     return $product_userfileds;
 }
Ejemplo n.º 14
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 public function display($tpl = null)
 {
     JHtml::_('behavior.tooltip');
     $app = JFactory::getApplication();
     $this->input = $app->input;
     $user = JFactory::getUser();
     JPluginHelper::importPlugin('redshop_product_type');
     $this->dispatcher = JDispatcher::getInstance();
     $redTemplate = new Redtemplate();
     $redhelper = new redhelper();
     $this->producthelper = new producthelper();
     $this->option = $this->input->getString('option', 'com_redshop');
     $db = JFactory::getDBO();
     $dbPrefix = $app->getCfg('dbprefix');
     $lists = array();
     $model = $this->getModel('product_detail');
     $detail = $this->get('data');
     $isNew = $detail->product_id < 1;
     // Load new product default values
     if ($isNew) {
         $detail->append_to_global_seo = '';
         $detail->canonical_url = '';
     }
     // Fail if checked out not by 'me'
     if ($model->isCheckedOut($user->get('id'))) {
         $msg = JText::_('COM_REDSHOP_PRODUCT_BEING_EDITED');
         $app->redirect('index.php?option=com_redshop', $msg);
     }
     // Check redproductfinder is installed
     $CheckRedProductFinder = $model->CheckRedProductFinder();
     $this->CheckRedProductFinder = $CheckRedProductFinder;
     // Get association id
     $getAssociation = $model->getAssociation();
     $this->getassociation = $getAssociation;
     // ToDo: Move SQL from here. SQL shouldn't be in view files!
     $sql = "SHOW TABLE STATUS LIKE '" . $dbPrefix . "redshop_product'";
     $db->setQuery($sql);
     $row = $db->loadObject();
     $next_product = $row->Auto_increment;
     /* Get the tag names */
     $tags = $model->Tags();
     $associationtags = array();
     if (isset($getAssociation) && count($getAssociation) > 0) {
         $associationtags = $model->AssociationTags($getAssociation->id);
     }
     if (count($tags) > 0) {
         $lists['tags'] = JHtml::_('select.genericlist', $tags, 'tag_id[]', 'multiple', 'id', 'tag_name', $associationtags);
     }
     $types = $model->TypeTagList();
     /* Get the Quality Score data */
     $qs = $this->get('QualityScores', 'product_detail');
     // ToDo: Don't echo HTML but use tmpl files.
     /* Create the select list as checkboxes */
     $html = '<div id="select_box">';
     if (count($types) > 0) {
         foreach ($types as $typeid => $type) {
             $counttags = count($type['tags']);
             $rand = rand();
             /* Add the type */
             $html .= '<div class="select_box_parent" onClick="showBox(' . $rand . ')">' . JText::_('COM_REDSHOP_TYPE_LIST') . ' ' . $type['type_name'] . '</div>';
             $html .= '<div id="' . $rand . '" class="select_box_child';
             $html .= '">';
             /* Add the tags */
             if ($counttags > 0) {
                 foreach ($type['tags'] as $tagid => $tag) {
                     /* Check if the tag is selected */
                     if (in_array($tagid, $associationtags)) {
                         $selected = 'checked="checked"';
                     } else {
                         $selected = '';
                     }
                     $html .= '<table><tr><td colspan="2"><input type="checkbox" class="select_box" ' . $selected . ' name="tag_id[]" value="' . $typeid . '.' . $tagid . '" />' . JText::_('COM_REDSHOP_TAG_LIST') . ' ' . $tag['tag_name'];
                     $html .= '</td></tr>';
                     $qs_value = '';
                     if (is_array($qs)) {
                         if (array_key_exists($typeid . '.' . $tagid, $qs)) {
                             $qs_value = $qs[$typeid . '.' . $tagid]['quality_score'];
                         }
                     }
                     $html .= '<tr><td><span class="quality_score">' . JText::_('COM_REDSHOP_QUALITY_SCORE') . '</span></td><td><input type="text" class="quality_score_input"  name="qs_id[' . $typeid . '.' . $tagid . ']" value="' . $qs_value . '" />';
                     $html .= '</td></tr>';
                     $html .= '<tr ><td colspan="2"><select name="sel_dep' . $typeid . '_' . $tagid . '[]" id="sel_dep' . $typeid . '_' . $tagid . '" multiple="multiple" size="10"  >';
                     foreach ($types as $sel_typeid => $sel_type) {
                         if ($typeid == $sel_typeid) {
                             continue;
                         }
                         $dependent_tag = $model->getDependenttag($detail->product_id, $typeid, $tagid);
                         $html .= '<optgroup label="' . $sel_type['type_name'] . '">';
                         foreach ($sel_type['tags'] as $sel_tagid => $sel_tag) {
                             $selected = in_array($sel_tagid, $dependent_tag) ? "selected" : "";
                             $html .= '<option value="' . $sel_tagid . '" ' . $selected . ' >' . $sel_tag['tag_name'] . '</option>';
                         }
                         $html .= '</optgroup>';
                     }
                     $html .= '</select>&nbsp;<a href="#" onClick="javascript:add_dependency(' . $typeid . ',' . $tagid . ',' . $detail->product_id . ');" >' . JText::_('COM_REDSHOP_ADD_DEPENDENCY') . '</a></td></tr></table>';
                 }
             }
             $html .= '</div>';
         }
     }
     $html .= '</div>';
     $lists['tags'] = $html;
     $templates = $redTemplate->getTemplate("product");
     $manufacturers = $model->getmanufacturers();
     $supplier = $model->getsupplier();
     $product_categories = $this->input->post->get('product_category', array(), 'array');
     if (!empty($product_categories)) {
         $productcats = $product_categories;
     } else {
         $productcats = $model->getproductcats();
     }
     $attributes = $model->getattributes();
     $attributesSet = $model->getAttributeSetList();
     $product_category = new product_category();
     // Merging select option in the select box
     $temps = array();
     $temps[0] = new stdClass();
     $temps[0]->template_id = "0";
     $temps[0]->template_name = JText::_('COM_REDSHOP_SELECT');
     if (is_array($templates)) {
         $templates = array_merge($temps, $templates);
     }
     // Merging select option in the select box
     $supps = array();
     $supps[0] = new stdClass();
     $supps[0]->value = "0";
     $supps[0]->text = JText::_('COM_REDSHOP_SELECT');
     if (is_array($manufacturers)) {
         $manufacturers = array_merge($supps, $manufacturers);
     }
     // Merging select option in the select box
     $supps = array();
     $supps[0] = new stdClass();
     $supps[0]->value = "0";
     $supps[0]->text = JText::_('COM_REDSHOP_SELECT');
     if (is_array($supplier)) {
         $supplier = array_merge($supps, $supplier);
     }
     JToolBarHelper::title(JText::_('COM_REDSHOP_PRODUCT_MANAGEMENT_DETAIL'), 'redshop_products48');
     $document = JFactory::getDocument();
     $document->addScriptDeclaration("var WANT_TO_DELETE = '" . JText::_('COM_REDSHOP_DO_WANT_TO_DELETE') . "';");
     /**
      * Override field.js file.
      * With this trigger the file can be loaded from a plugin. This can be used
      * to display different JS generated interface for attributes depending on a product type.
      * So, product type plugins should be used for this event. Be aware that this file should
      * be loaded only once.
      */
     $loadedFromAPlugin = $this->dispatcher->trigger('loadFieldsJSFromPlugin', array($detail));
     if (in_array(1, $loadedFromAPlugin)) {
         $loadedFromAPlugin = true;
     } else {
         $loadedFromAPlugin = false;
     }
     if (!$loadedFromAPlugin) {
         $document->addScript('components/' . $this->option . '/assets/js/fields.js');
     }
     $document->addScript('components/' . $this->option . '/assets/js/select_sort.js');
     $document->addScript('components/' . $this->option . '/assets/js/json.js');
     $document->addScript('components/' . $this->option . '/assets/js/validation.js');
     $document->addStyleSheet('components/com_redshop/assets/css/search.css');
     if (file_exists(JPATH_SITE . '/components/com_redproductfinder/helpers/redproductfinder.css')) {
         $document->addStyleSheet('components/com_redproductfinder/helpers/redproductfinder.css');
     }
     $document->addScript('components/com_redshop/assets/js/search.js');
     $document->addScript('components/com_redshop/assets/js/related.js');
     $uri = JFactory::getURI();
     $layout = $this->input->getString('layout', '');
     if ($layout == 'property_images') {
         $this->setLayout('property_images');
     } elseif ($layout == 'attribute_color') {
         $this->setLayout('attribute_color');
     } elseif ($layout == 'productstockroom') {
         $this->setLayout('productstockroom');
     } else {
         $this->setLayout('default');
     }
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : $detail->product_name . " - " . JText::_('COM_REDSHOP_EDIT');
     JToolBarHelper::title(JText::_('COM_REDSHOP_PRODUCT') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_products48');
     if ($detail->product_id > 0) {
         JToolBarHelper::addNew('prices', JText::_('COM_REDSHOP_ADD_PRICE_LBL'));
     }
     JToolBarHelper::apply();
     JToolBarHelper::save();
     JToolBarHelper::save2new();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         $model->checkout($user->get('id'));
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     $model = $this->getModel('product_detail');
     $accessory_product = array();
     if ($detail->product_id) {
         $accessory_product = $this->producthelper->getProductAccessory(0, $detail->product_id);
     }
     $lists['accessory_product'] = $accessory_product;
     $navigator_product = array();
     if ($detail->product_id) {
         $navigator_product = $this->producthelper->getProductNavigator(0, $detail->product_id);
     }
     $lists['navigator_product'] = $navigator_product;
     $lists['QUANTITY_SELECTBOX_VALUE'] = $detail->quantity_selectbox_value;
     $result = array();
     $lists['product_all'] = JHtml::_('select.genericlist', $result, 'product_all[]', 'class="inputbox" ondblclick="selectnone(this);" multiple="multiple"  size="15" style="width:200px;" ', 'value', 'text', 0);
     $related_product_data = $model->related_product_data($detail->product_id);
     $relatedProductCssClass = 'class="inputbox" multiple="multiple"  size="15" style="width:200px;" ';
     $relatedProductCssClass .= ' onmousewheel="mousewheel_related(this);" ondblclick="selectnone_related(this);" ';
     $lists['related_product'] = JHtml::_('select.genericlist', $related_product_data, 'related_product[]', $relatedProductCssClass, 'value', 'text', 0);
     $lists['product_all_related'] = JHtml::_('select.genericlist', $result, 'product_all_related[]', 'class="inputbox" ondblclick="selectnone_related(this);" multiple="multiple"  size="15" style="width:200px;" ', 'value', 'text', 0);
     // For preselected.
     if ($detail->product_template == "") {
         $default_preselected = PRODUCT_TEMPLATE;
         $detail->product_template = $default_preselected;
     }
     $lists['product_template'] = JHtml::_('select.genericlist', $templates, 'product_template', 'class="inputbox" size="1" onchange="set_dynamic_field(this.value,\'' . $detail->product_id . '\',\'1,12,17\');"  ', 'template_id', 'template_name', $detail->product_template);
     $product_tax = $model->gettax();
     $temps = array();
     $temps[0] = new stdClass();
     $temps[0]->value = "0";
     $temps[0]->text = JText::_('COM_REDSHOP_SELECT');
     if (is_array($product_tax)) {
         $product_tax = array_merge($temps, $product_tax);
     }
     $lists['product_tax'] = JHtml::_('select.genericlist', $product_tax, 'product_tax_id', 'class="inputbox" size="1"  ', 'value', 'text', $detail->product_tax_id);
     $categories = $product_category->list_all("product_category[]", 0, $productcats, 10, true, true);
     $lists['categories'] = $categories;
     $detail->first_selected_category_id = isset($productcats[0]) ? $productcats[0] : null;
     $lists['manufacturers'] = JHtml::_('select.genericlist', $manufacturers, 'manufacturer_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->manufacturer_id);
     $lists['supplier'] = JHtml::_('select.genericlist', $supplier, 'supplier_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->supplier_id);
     $lists['published'] = JHtml::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published);
     $lists['product_on_sale'] = JHtml::_('select.booleanlist', 'product_on_sale', 'class="inputbox"', $detail->product_on_sale);
     $lists['copy_attribute'] = JHtml::_('select.booleanlist', 'copy_attribute', 'class="inputbox"', 0);
     $lists['product_special'] = JHtml::_('select.booleanlist', 'product_special', 'class="inputbox"', $detail->product_special);
     $lists['product_download'] = JHtml::_('select.booleanlist', 'product_download', 'class="inputbox"', $detail->product_download);
     $lists['not_for_sale'] = JHtml::_('select.booleanlist', 'not_for_sale', 'class="inputbox"', $detail->not_for_sale);
     $lists['expired'] = JHtml::_('select.booleanlist', 'expired', 'class="inputbox"', $detail->expired);
     // For individual pre-order
     $preorder_data = $redhelper->getPreOrderByList();
     $lists['preorder'] = JHtml::_('select.genericlist', $preorder_data, 'preorder', 'class="inputbox" size="1" ', 'value', 'text', $detail->preorder);
     // Discount calculator
     $lists['use_discount_calc'] = JHtml::_('select.booleanlist', 'use_discount_calc', 'class="inputbox"', $detail->use_discount_calc);
     $selectOption = array();
     $selectOption[] = JHtml::_('select.option', '1', JText::_('COM_REDSHOP_RANGE'));
     $selectOption[] = JHtml::_('select.option', '0', JText::_('COM_REDSHOP_PRICE_PER_PIECE'));
     $lists['use_range'] = JHtml::_('select.genericlist', $selectOption, 'use_range', 'class="inputbox" size="1" ', 'value', 'text', $detail->use_range);
     unset($selectOption);
     // Calculation method
     $selectOption[] = JHtml::_('select.option', '0', JText::_('COM_REDSHOP_SELECT'));
     $selectOption[] = JHtml::_('select.option', 'volume', JText::_('COM_REDSHOP_VOLUME'));
     $selectOption[] = JHtml::_('select.option', 'area', JText::_('COM_REDSHOP_AREA'));
     $selectOption[] = JHtml::_('select.option', 'circumference', JText::_('COM_REDSHOP_CIRCUMFERENCE'));
     $lists['discount_calc_method'] = JHtml::_('select.genericlist', $selectOption, 'discount_calc_method', 'class="inputbox" size="1" ', 'value', 'text', $detail->discount_calc_method);
     unset($selectOption);
     // Calculation UNIT
     $remove_format = JHtml::$formatOptions;
     $selectOption[] = JHtml::_('select.option', 'mm', JText::_('COM_REDSHOP_MILLIMETER'));
     $selectOption[] = JHtml::_('select.option', 'cm', JText::_('COM_REDSHOP_CENTIMETER'));
     $selectOption[] = JHtml::_('select.option', 'm', JText::_('COM_REDSHOP_METER'));
     $lists['discount_calc_unit'] = JHtml::_('select.genericlist', $selectOption, 'discount_calc_unit[]', 'class="inputbox" size="1" ', 'value', 'text', DEFAULT_VOLUME_UNIT);
     $lists['discount_calc_unit'] = str_replace($remove_format['format.indent'], "", $lists['discount_calc_unit']);
     $lists['discount_calc_unit'] = str_replace($remove_format['format.eol'], "", $lists['discount_calc_unit']);
     unset($selectOption);
     $productVatGroup = $model->getVatGroup();
     $temps = array();
     $temps[0] = new stdClass();
     $temps[0]->value = "";
     $temps[0]->text = JText::_('COM_REDSHOP_SELECT');
     if (is_array($productVatGroup)) {
         $productVatGroup = array_merge($temps, $productVatGroup);
     }
     if (DEFAULT_VAT_GROUP && !$detail->product_tax_group_id) {
         $detail->product_tax_group_id = DEFAULT_VAT_GROUP;
     }
     $append_to_global_seo = array();
     $append_to_global_seo[] = JHtml::_('select.option', 'append', JText::_('COM_REDSHOP_APPEND_TO_GLOBAL_SEO'));
     $append_to_global_seo[] = JHtml::_('select.option', 'prepend', JText::_('COM_REDSHOP_PREPEND_TO_GLOBAL_SEO'));
     $append_to_global_seo[] = JHtml::_('select.option', 'replace', JText::_('COM_REDSHOP_REPLACE_TO_GLOBAL_SEO'));
     $lists['append_to_global_seo'] = JHtml::_('select.genericlist', $append_to_global_seo, 'append_to_global_seo', 'class="inputbox" size="1" ', 'value', 'text', $detail->append_to_global_seo);
     $lists['product_tax_group_id'] = JHtml::_('select.genericlist', $productVatGroup, 'product_tax_group_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->product_tax_group_id);
     $prop_oprand = array();
     $prop_oprand[] = JHtml::_('select.option', 'select', JText::_('COM_REDSHOP_SELECT'));
     $prop_oprand[] = JHtml::_('select.option', '+', JText::_('COM_REDSHOP_PLUS'));
     $prop_oprand[] = JHtml::_('select.option', '=', JText::_('COM_REDSHOP_EQUAL'));
     $prop_oprand[] = JHtml::_('select.option', '-', JText::_('COM_REDSHOP_MINUS'));
     $cat_in_sefurl = $model->catin_sefurl($detail->product_id);
     $lists['cat_in_sefurl'] = JHtml::_('select.genericlist', $cat_in_sefurl, 'cat_in_sefurl', 'class="inputbox" size="1" ', 'value', 'text', $detail->cat_in_sefurl);
     $lists['attributes'] = $attributes;
     $temps = array();
     $temps[0] = new stdClass();
     $temps[0]->value = "";
     $temps[0]->text = JText::_('COM_REDSHOP_SELECT');
     if (is_array($attributesSet)) {
         $attributesSet = array_merge($temps, $attributesSet);
     }
     $lists['attributesSet'] = JHtml::_('select.genericlist', $attributesSet, 'attribute_set_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->attribute_set_id);
     // Product type selection
     $productTypeOptions = array();
     $productTypeOptions[] = JHtml::_('select.option', 'product', JText::_('COM_REDSHOP_PRODUCT'));
     $productTypeOptions[] = JHtml::_('select.option', 'file', JText::_('COM_REDSHOP_FILE'));
     $productTypeOptions[] = JHtml::_('select.option', 'subscription', JText::_('COM_REDSHOP_SUBSCRIPTION'));
     /*
      * Trigger event which can update list of product types.
      * Example of a returned value:
      * return array('value' => 'redDESIGN', 'text' => JText::_('PLG_REDSHOP_PRODUCT_TYPE_REDDESIGN_REDDESIGN_PRODUCT_TYPE'));
      */
     $productTypePluginOptions = $this->dispatcher->trigger('onListProductTypes');
     foreach ($productTypePluginOptions as $productTypePluginOption) {
         $productTypeOptions[] = JHtml::_('select.option', $productTypePluginOption['value'], $productTypePluginOption['text']);
     }
     if ($detail->product_download == 1) {
         $detail->product_type = 'file';
     }
     $lists["product_type"] = JHtml::_('select.genericlist', $productTypeOptions, 'product_type', 'class="inputbox" size="1" ', 'value', 'text', $detail->product_type);
     $accountgroup = $redhelper->getEconomicAccountGroup();
     $op = array();
     $op[] = JHtml::_('select.option', '0', JText::_('COM_REDSHOP_SELECT'));
     $accountgroup = array_merge($op, $accountgroup);
     $lists["accountgroup_id"] = JHtml::_('select.genericlist', $accountgroup, 'accountgroup_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->accountgroup_id);
     // For downloadable products
     $productSerialDetail = $model->getProdcutSerialNumbers();
     $this->model = $model;
     $this->lists = $lists;
     $this->detail = $detail;
     $this->productSerialDetail = $productSerialDetail;
     $this->next_product = $next_product;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Ejemplo n.º 15
0
 public function product_template($template_id, $product_id, $section)
 {
     $redTemplate = new Redtemplate();
     if ($section == 1 || $section == 12) {
         $template_desc = $redTemplate->getTemplate("product", $template_id);
     } else {
         $template_desc = $redTemplate->getTemplate("category", $template_id);
     }
     if (count($template_desc) == 0) {
         return;
     }
     $template = $template_desc[0]->template_desc;
     $str = array();
     $sec = explode(',', $section);
     for ($t = 0; $t < count($sec); $t++) {
         $inArr[] = "'" . $sec[$t] . "'";
     }
     $in = implode(',', $inArr);
     $q = "SELECT field_name,field_type,field_section from " . $this->_table_prefix . "fields where field_section in (" . $in . ") ";
     $this->_db->setQuery($q);
     $fields = $this->_db->loadObjectlist();
     for ($i = 0; $i < count($fields); $i++) {
         if (strstr($template, "{" . $fields[$i]->field_name . "}")) {
             if ($fields[$i]->field_section == 12) {
                 if ($fields[$i]->field_type == 15) {
                     $str[] = $fields[$i]->field_name;
                 }
             } else {
                 $str[] = $fields[$i]->field_name;
             }
         }
     }
     $list_field = array();
     if (count($str) > 0) {
         $dbname = "'" . implode("','", $str) . "'";
         $field = new extra_field();
         for ($t = 0; $t < count($sec); $t++) {
             $list_field[] = $field->list_all_field($sec[$t], $product_id, $dbname);
         }
     }
     if (count($list_field) > 0) {
         return $list_field;
     } else {
         return "";
     }
 }
Ejemplo n.º 16
0
 public function getData()
 {
     if (empty($this->_data)) {
         $redTemplate = new Redtemplate();
         if (DEFAULT_QUOTATION_MODE) {
             $this->_data = $redTemplate->getTemplate("quotation_cart");
         } else {
             if (!USE_AS_CATALOG) {
                 $this->_data = $redTemplate->getTemplate("cart");
             } else {
                 $this->_data = $redTemplate->getTemplate("catalogue_cart");
             }
         }
     }
     return $this->_data;
 }
Ejemplo n.º 17
0
 * @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/shipping.php';
JHTML::_('behavior.tooltip');
JHTMLBehavior::modal();
$redTemplate = new Redtemplate();
$carthelper = new rsCarthelper();
$user = JFactory::getUser();
$jinput = JFactory::getApplication()->input;
$post = $jinput->getArray($_POST);
$shippingbox_template = $redTemplate->getTemplate("shipping_box");
if (count($shippingbox_template) > 0 && $shippingbox_template[0]->template_desc) {
    $box_template_desc = $shippingbox_template[0]->template_desc;
} else {
    $box_template_desc = "<fieldset class=\"adminform\"> <legend><strong>{shipping_box_heading}</strong></legend>\r\n<div>{shipping_box_list}</div>\r\n</fieldset>";
}
$shipping_template = $redTemplate->getTemplate("redshop_shipping");
if (count($shipping_template) > 0 && $shipping_template[0]->template_desc) {
    $template_desc = $shipping_template[0]->template_desc;
} else {
    $template_desc = "<fieldset class=\"adminform\"><legend><strong>{shipping_heading}</strong></legend>\r\n<div>{shipping_method_loop_start}\r\n<h3>{shipping_method_title}</h3>\r\n<div>{shipping_rate_loop_start}\r\n<div>{shipping_rate_name} {shipping_rate}</div>\r\n{shipping_rate_loop_end}</div>\r\n{shipping_method_loop_end}</div>\r\n</fieldset>";
}
if ($this->users_info_id > 0) {
    $shippinghelper = new shipping();
    $shippingBoxes = $shippinghelper->getShippingBox();
    $selshipping_box_post_id = 0;
Ejemplo n.º 18
0
<?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();
$redTemplate = new Redtemplate();
$carthelper = new rsCarthelper();
$model = $this->getModel('checkout');
$payment_template = $redTemplate->getTemplate("redshop_payment");
if (count($payment_template) > 0 && $payment_template[0]->template_desc) {
    $template_desc = $payment_template[0]->template_desc;
} else {
    $template_desc = "<fieldset class=\"adminform\"><legend><strong>{payment_heading}</strong></legend><div>{split_payment}</div>\r\n<div>{payment_loop_start}\r\n<div>{payment_method_name}</div>\r\n<div>{creditcard_information}</div>\r\n{payment_loop_end}</div></fieldset>";
}
// Get billing info for check is_company
$billingaddresses = $model->billingaddresses();
$is_company = $billingaddresses->is_company;
if ((int) $billingaddresses->ean_number == 0) {
    $ean_number = 1;
}
$template_desc = $carthelper->replacePaymentTemplate($template_desc, $this->element, $is_company, $ean_number);
$template_desc = $redTemplate->parseredSHOPplugin($template_desc);
echo eval("?>" . $template_desc . "<?php ");
Ejemplo n.º 19
0
<?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');
$redTemplate = new Redtemplate();
$Itemid = JRequest::getInt('Itemid');
$layout = JRequest::getCmd('layout', 'default');
$model = $this->getModel('catalog');
$template = $redTemplate->getTemplate("catalog");
if (count($template) > 0 && $template[0]->template_desc != "") {
    $template_desc = $template[0]->template_desc;
} else {
    $template_desc = '<div id="katalog_wrapper"><div id="bestil_katalog_wrapper"><div id="katalog_overskrift"><h1>Order Catalog</h1></div><div id="katalog_venstre_wrapper"><div id="katalog_tekst"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eget nisi orci, vel vehicula massa. Phasellus ipsum est, egestas a consequat eget, placerat vitae ipsum. Proin ac purus risus. Quisque nec nisi lacus, vitae iaculis eros. Donec ipsum diam, dictum ac euismod molestie, ultrices eget arcu. Vestibulum lacinia nisl et odio sagittis fermentum. Aliquam tristique volutpat faucibus. Sed id orci ut metus condimentum bibendum. Ut gravida scelerisque magna et pharetra. Ut vel turpis in orci molestie scelerisque. Proin nisl elit, ullamcorper id blandit nec, congue eget augue. Nullam gravida ligula nisi.</p></div><div>Catalog:{catalog_select}</div><div id="katalog_navn_email">NAME  {name} <br /><br />EMAIL {email_address} <br /><br />{submit_button_catalog}</div></div><div id="katalog_hojre_wrapper"></div></div></div>';
}
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'));
        ?>
Ejemplo n.º 20
0
 public function display($tpl = null)
 {
     global $context;
     $context = 'product_id';
     $GLOBALS['productlist'] = array();
     $redTemplate = new Redtemplate();
     $extra_field = new extra_field();
     $adminproducthelper = new adminproducthelper();
     $list_in_products = $extra_field->list_all_field_in_product();
     $uri = JFactory::getURI();
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSHOP_PRODUCT'));
     $layout = JRequest::getVar('layout');
     JToolBarHelper::title(JText::_('COM_REDSHOP_PRODUCT_MANAGEMENT'), 'redshop_products48');
     if ($layout != 'importproduct' && $layout != 'importattribute' && $layout != 'listing' && $layout != 'ins_product') {
         JToolBarHelper::customX('gbasefeed', 'gbase.png', 'gbase.png', JText::_('COM_REDSHOP_GOOGLEBASE'), true);
         JToolBarHelper::custom('assignCategory', 'save.png', 'save_f2.png', JText::_('COM_REDSHOP_ASSIGN_CATEGORY'), true);
         JToolBarHelper::custom('removeCategory', 'delete.png', 'delete_f2.png', JText::_('COM_REDSHOP_REMOVE_CATEGORY'), true);
         JToolBarHelper::addNewX();
         JToolBarHelper::editListX();
         JToolBarHelper::customX('copy', 'copy.png', 'copy_f2.png', JText::_('COM_REDSHOP_TOOLBAR_COPY'), true);
         JToolBarHelper::deleteList();
         JToolBarHelper::publishList();
         JToolBarHelper::unpublishList();
     }
     if ($layout == 'listing') {
         JToolBarHelper::back();
     }
     $category_id = $app->getUserStateFromRequest($context . 'category_id', 'category_id', '');
     if ($category_id) {
         $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'x.ordering');
     } else {
         $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'p.product_id');
     }
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '');
     $search_field = $app->getUserStateFromRequest($context . 'search_field', 'search_field', '');
     $keyword = $app->getUserStateFromRequest($context . 'keyword', 'keyword', '');
     $categories = $this->get('CategoryList');
     $categories1 = array();
     foreach ($categories as $key => $value) {
         $categories1[$key] = new stdClass();
         $categories1[$key]->id = $categories[$key]->id;
         $categories1[$key]->parent_id = $categories[$key]->parent_id;
         $categories1[$key]->title = $categories[$key]->title;
         $treename = str_replace("&#160;&#160;&#160;&#160;&#160;&#160;", " ", $categories[$key]->treename);
         $treename = str_replace("<sup>", " ", $treename);
         $treename = str_replace("</sup>&#160;", " ", $treename);
         $categories1[$key]->treename = $treename;
         $categories1[$key]->children = $categories[$key]->children;
     }
     $temps = array();
     $temps[0] = new stdClass();
     $temps[0]->id = "0";
     $temps[0]->treename = JText::_('COM_REDSHOP_SELECT');
     $categories1 = @array_merge($temps, $categories1);
     $lists['category'] = JHTML::_('select.genericlist', $categories1, 'category_id', 'class="inputbox" onchange="document.adminForm2.submit();" ', 'id', 'treename', $category_id);
     $product_sort = $adminproducthelper->getProductrBySortedList();
     $product_sort_select = JRequest::getVar('product_sort', 0);
     $lists['product_sort'] = JHTML::_('select.genericlist', $product_sort, 'product_sort', 'class="inputbox"  onchange="document.adminForm2.submit();" ', 'value', 'text', $product_sort_select);
     $lists['order'] = $filter_order;
     $lists['order_Dir'] = $filter_order_Dir;
     $products = $this->get('Data');
     $pagination = $this->get('Pagination');
     /*
      * assign template
      */
     $templates = $redTemplate->getTemplate('product');
     $temps = array();
     $temps[0] = new stdClass();
     $temps[0]->template_id = "0";
     $temps[0]->template_name = JText::_('COM_REDSHOP_ASSIGN_TEMPLATE');
     $templates = @array_merge($temps, $templates);
     $lists['product_template'] = JHTML::_('select.genericlist', $templates, 'product_template', 'class="inputbox" size="1"  onchange="return AssignTemplate()" ', 'template_id', 'template_name', 0);
     $this->list_in_products = $list_in_products;
     $this->keyword = $keyword;
     $this->search_field = $search_field;
     $this->user = JFactory::getUser();
     $this->lists = $lists;
     $this->products = $products;
     $this->pagination = $pagination;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Ejemplo n.º 21
0
 *
 * @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>";
    $template_desc .= "<div class='category_box_wrapper clearfix'>{product_loop_start}<div class='category_product_box_outside'>";
    $template_desc .= "<div class='category_box_inside'><table border='0'><tbody><tr><td>";
    $template_desc .= "<div class='category_product_image'>{product_thumb_image}</div></td></tr>";
    $template_desc .= "<tr><td><div class='category_product_title'><h3>{product_name}</h3></div></td></tr>";
    $template_desc .= "<tr><td><div class='category_product_price'>{product_price}</div></td></tr>";
Ejemplo n.º 22
0
 public function displayQuotationUserfield($quotation_item_id = 0, $section_id = 12)
 {
     $redTemplate = new Redtemplate();
     $producthelper = new producthelper();
     $resultArr = array();
     $db = JFactory::getDbo();
     $sql = "SELECT fd.*,f.field_title,f.field_type,f.field_name " . "FROM " . $this->_table_prefix . "quotation_fields_data AS fd " . "LEFT JOIN " . $this->_table_prefix . "fields AS f ON f.field_id=fd.fieldid " . "WHERE fd.quotation_item_id= " . (int) $quotation_item_id . " AND fd.section = " . $db->quote($section_id);
     $db->setQuery($sql);
     $userfield = $db->loadObjectlist();
     if (count($userfield) > 0) {
         $quotationItem = $this->getQuotationProduct(0, $quotation_item_id);
         $product_id = $quotationItem[0]->product_id;
         $productdetail = $producthelper->getProductById($product_id);
         $productTemplate = $redTemplate->getTemplate("product", $productdetail->product_template);
         $returnArr = $producthelper->getProductUserfieldFromTemplate($productTemplate[0]->template_desc);
         $userFieldTag = $returnArr[1];
         for ($i = 0; $i < count($userFieldTag); $i++) {
             for ($j = 0; $j < count($userfield); $j++) {
                 if ($userfield[$j]->field_name == $userFieldTag[$i]) {
                     if ($userfield[$j]->field_type == 10) {
                         $files = explode(",", $userfield[$j]->data_txt);
                         $data_txt = "";
                         for ($f = 0; $f < count($files); $f++) {
                             $u_link = REDSHOP_FRONT_DOCUMENT_ABSPATH . "product/" . $files[$f];
                             $data_txt .= "<a href='" . $u_link . "'>" . $files[$f] . "</a> ";
                         }
                         $resultArr[] = $userfield[$j]->field_title . " : " . $data_txt;
                     } else {
                         $resultArr[] = $userfield[$j]->field_title . " : " . $userfield[$j]->data_txt;
                     }
                 }
             }
         }
     }
     $resultstr = "";
     if (count($resultArr) > 0) {
         $resultstr .= "<br/>" . implode("<br/>", $resultArr);
     }
     return $resultstr;
 }
Ejemplo n.º 23
0
echo JText::_('COM_REDSHOP_RECEIPT');
?>
</td>
		</tr>
	</table>
	<hr/>
	<div>
		<?php 
echo $thankyou_text;
?>
	</div>
	<br/>

<?php 
if (USE_AS_CATALOG) {
    $ReceiptTemplate = $redTemplate->getTemplate("catalogue_order_receipt");
    $ReceiptTemplate = $ReceiptTemplate[0]->template_desc;
} else {
    $ReceiptTemplate = $redTemplate->getTemplate("order_receipt");
    if (count($ReceiptTemplate) > 0 && $ReceiptTemplate[0]->template_desc) {
        $ReceiptTemplate = $ReceiptTemplate[0]->template_desc;
    } else {
        $ReceiptTemplate = '<div class="product_print">{print}</div><table class="tdborder" style="width: 100%;" border="0" cellspacing="0" cellpadding="5"><tbody><tr><th>{product_name_lbl}</th> <th> </th> <th>{price_lbl}</th> <th>{quantity_lbl}</th> <th>{total_price_lbl}</th></tr>{product_loop_start}<tr><td>{product_name}<br />{product_attribute}{product_accessory}{product_userfields}{product_wrapper}</td><td>{product_thumb_image}</td><td>{product_price}</td><td>{product_quantity}</td><td>{product_total_price}</td></tr>{product_loop_end}</tbody></table><p><br /><br /></p><table class="cart_calculations" border="1"><tbody><tr class="tdborder"><td><b>Product Subtotal:</b></td><td width="100">{product_subtotal}</td><td><b>Product Subtotal excl vat:</b></td><td width="100">{product_subtotal_excl_vat}</td></tr><tr><td><b>Shipping with vat:</b></td><td width="100">{shipping}</td><td><b>Shipping excl vat:</b></td><td width="100">{shipping_excl_vat}</td></tr>{if discount}<tr class="tdborder"><td>{discount_lbl}</td><td width="100">{discount}</td><td>{discount_lbl}</td><td width="100">{discount_excl_vat}</td></tr>{discount end if}<tr><td><b>{totalpurchase_lbl}:</b></td><td width="100">{order_subtotal}</td><td><b>{subtotal_excl_vat_lbl} :</b></td><td width="100">{order_subtotal_excl_vat}</td></tr>{if vat}<tr class="tdborder"><td>{vat_lbl}</td><td width="100">{tax}</td><td>{vat_lbl}</td><td width="100">{sub_total_vat}</td></tr>{vat end if}   {if payment_discount}<tr><td>{payment_discount_lbl}</td><td width="100">{payment_order_discount}</td></tr>{payment_discount end if}<tr class="tdborder"><td><b>{shipping_lbl}</b></td><td width="100">{shipping}</td><td><b>{shipping_lbl}</b></td><td width="100">{shipping_excl_vat}</td></tr><tr><td><div class="singleline"><strong>{total_lbl}:</strong></div></td><td width="100"><div class="singleline">{order_total}</div></td><td><div class="singleline"><b>{total_lbl}:</b></div></td><td width="100"><div class="singleline">{total_excl_vat}</div></td></tr><tr><td colspan="4"><p>{shipping_method_lbl} <strong>{shipping_method}</strong></p><p>{payment_status}</p></td></tr><tr><td colspan="4">{billing_address}</td></tr><tr><td colspan="4">{shipping_address}</td></tr></tbody></table>';
    }
}
$orderitem = $order_functions->getOrderItemDetail($order_id);
$print = JRequest::getInt('print');
if ($print) {
    $onclick = "onclick='window.print();'";
} else {
    $print_url = $url . "index.php?option=com_redshop&view=order_detail&layout=receipt&oid=" . $order_id . "&print=1&tmpl=component&Itemid=" . $Itemid;
Ejemplo n.º 24
0
<?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
 */
defined('_JEXEC') or die;
$carthelper = new rsCarthelper();
$uri = JURI::getInstance();
$url = $uri->root();
$redTemplate = new Redtemplate();
$OrdersDetail = $this->detail;
$order_print_template = $redTemplate->getTemplate("order_print");
if (count($order_print_template) > 0 && $order_print_template[0]->template_desc != "") {
    $ordersprint_template = $order_print_template[0]->template_desc;
} else {
    $ordersprint_template = '<table style="width: 100%;" border="0" cellpadding="5" cellspacing="0"><tbody><tr><td colspan="2"><table style="width: 100%;" border="0" cellpadding="2" cellspacing="0"><tbody><tr style="background-color: #cccccc;"><th align="left">{order_information_lbl}{print}</th></tr><tr></tr><tr><td>{order_id_lbl} : {order_id}</td></tr><tr><td>{order_number_lbl} : {order_number}</td></tr><tr><td>{requisition_number_lbl} : {requisition_number}</td></tr><tr><td>{order_date_lbl} : {order_date}</td></tr><tr><td>{order_status_lbl} : {order_status}</td></tr><tr><td>{shipping_method_lbl} : {shipping_method} : {shipping_rate_name}</td></tr><tr><td>{payment_lbl} : {payment_method}</td></tr></tbody></table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellpadding="2" cellspacing="0"><tbody><tr style="background-color: #cccccc;"><th align="left">{billing_address_information_lbl}</th></tr><tr></tr><tr><td>{billing_address}</td></tr></tbody></table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellpadding="2" cellspacing="0"><tbody><tr style="background-color: #cccccc;"><th align="left">{shipping_address_information_lbl}</th></tr><tr></tr><tr><td>{shipping_address}</td></tr></tbody></table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellpadding="2" cellspacing="0"><tbody><tr style="background-color: #cccccc;"><th align="left">{order_detail_lbl}</th></tr><tr></tr><tr><td><table style="width: 100%;" border="0" cellpadding="2" cellspacing="2"><tbody><tr><td>{product_name_lbl}</td><td>{note_lbl}</td><td>{price_lbl}</td><td>{quantity_lbl}</td><td align="right">Total Price</td></tr>{product_loop_start}<tr><td><p>{product_name}<br />{product_attribute}{product_accessory}{product_userfields}</p></td><td>{product_wrapper}{product_thumb_image}</td><td>{product_price}</td><td>{product_quantity}</td><td align="right">{product_total_price}</td></tr>{product_loop_end}</tbody></table></td></tr><tr><td></td></tr><tr><td><table style="width: 100%;" border="0" cellpadding="2" cellspacing="2"><tbody><tr align="left"><td align="left"><strong>{order_subtotal_lbl} : </strong></td><td align="right">{order_subtotal}</td></tr>{if vat}<tr align="left"><td align="left"><strong>{vat_lbl} : </strong></td><td align="right">{order_tax}</td></tr>{vat end if}{if discount}<tr align="left"><td align="left"><strong>{discount_lbl} : </strong></td><td align="right">{order_discount}</td></tr>{discount end if}<tr align="left"><td align="left"><strong>{shipping_lbl} : </strong></td><td align="right">{order_shipping}</td></tr><tr align="left"><td colspan="2" align="left"><hr /></td></tr><tr align="left"><td align="left"><strong>{total_lbl} :</strong></td><td align="right">{order_total}</td></tr><tr align="left"><td colspan="2" align="left"><hr /><br /> <hr /></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>';
}
$print_tag = "<a onclick='window.print();' title='" . JText::_('COM_REDSHOP_PRINT') . "'>" . "<img src=" . JSYSTEM_IMAGES_PATH . "printButton.png  alt='" . JText::_('COM_REDSHOP_PRINT') . "' title='" . JText::_('COM_REDSHOP_PRINT') . "' /></a>";
$message = str_replace("{print}", $print_tag, $ordersprint_template);
$message = $carthelper->replaceOrderTemplate($OrdersDetail, $message);
echo eval("?>" . $message . "<?php ");
Ejemplo n.º 25
0
/**
 * @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');
$redTemplate = new Redtemplate();
$extra_field = new extra_field();
$Itemid = JRequest::getInt('Itemid');
$layout = JRequest::getCmd('layout', 'default');
$model = $this->getModel('catalog');
$template = $redTemplate->getTemplate("product_sample");
if (count($template) > 0 && $template[0]->template_desc != "") {
    $template_desc = $template[0]->template_desc;
} else {
    $template_desc = '<div id="katalog_wrapper"><div id="bestil_katalog_wrapper"><div id="katalog_hojre_wrapper"></div></div><div id="bestil_farveproeve_wrapper"><div id="farveproeve_overskrift"><h2>Bestil Farveprver</h2></div><div id="farveproeve_venstre"><div id="farveproever_tekst">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eget nisi orci, vel vehicula massa. Phasellus ipsum est, egestas a consequat eget, placerat vitae ipsum. Proin ac purus risus. Quisque nec nisi lacus, vitae iaculis eros. Donec ipsum diam, dictum ac euismod molestie, ultrices eget arcu. Vestibulum lacinia nisl et odio sagittis fermentum. Aliquam tristique volutpat faucibus. Sed id orci ut metus condimentum bibendum. Ut gravida scelerisque magna et pharetra. Ut vel turpis in orci molestie scelerisque. Proin nisl elit, ullamcorper id blandit nec, congue eget augue. Nullam gravida ligula nisi.</div><div id="farveproever"><p style="text-align: left;">{product_samples}</p></div></div><div id="farveproeve_hojre_wrapper"><div id="farveproeve_addressefelt"><p style="text-align: left;">{address_fields}</p></div><div id="farveproeve_sendknap"><p style="text-align: left;">{submit_button_sample}</p></div></div></div></div>';
}
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'));
        ?>
Ejemplo n.º 26
0
 */
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)) {
    ?>
	<div class="componentheading<?php 
    echo $this->params->get('pageclass_sfx');
    ?>
">
		<?php 
    echo $this->escape(JText::_('COM_REDSHOP_ORDER_LIST'));
    ?>
	</div>
Ejemplo n.º 27
0
	<h1 class="componentheading<?php 
    echo $this->escape($this->params->get('pageclass_sfx'));
    ?>
">
		<?php 
    if ($this->params->get('page_title') != $pagetitle) {
        echo $this->escape($this->params->get('page_title'));
    } else {
        echo $pagetitle;
    }
    ?>
	</h1>
<?php 
}
// Page title End
$manufacturerdetail_template = $redTemplate->getTemplate("manufacturer_detail");
if (count($manufacturerdetail_template) > 0 && $manufacturerdetail_template[0]->template_desc != "") {
    $template_desc = $manufacturerdetail_template[0]->template_desc;
    $template_id = $manufacturerdetail_template[0]->template_id;
} else {
    $template_desc = "<div style=\"clear: both;\"></div>\r\n<div class=\"manufacturer_name\">{manufacturer_name}</div>\r\n<div class=\"manufacturer_image\">{manufacturer_image}</div>\r\n<div class=\"manufacturer_description\">{manufacturer_description}</div>\r\n<div class=\"manufacturer_product_link\"><a href=\"{manufacturer_allproductslink}\">{manufacturer_allproductslink_lbl}</a></div>\r\n<div style=\"clear: both;\"></div>";
    $template_id = 0;
}
$row = $this->detail[0];
$category = $model->getmanufacturercategory($row->manufacturer_id, $row);
if (strstr($template_desc, '{category_loop_start}') && strstr($template_desc, '{category_loop_end}')) {
    $template_sdata = explode('{category_loop_start}', $template_desc);
    $template_start = $template_sdata[0];
    $template_edata = explode('{category_loop_end}', $template_sdata[1]);
    $template_end = $template_edata[1];
    $template_middle = $template_edata[0];
Ejemplo n.º 28
0
 public function addProductToCart($data = array())
 {
     JPluginHelper::importPlugin('redshop_product');
     $dispatcher = JDispatcher::getInstance();
     $rsUserhelper = new rsUserhelper();
     $redTemplate = new Redtemplate();
     $user = JFactory::getUser();
     $cart = $this->_session->get('cart');
     if (!$cart || !array_key_exists("idx", $cart) || array_key_exists("quotation_id", $cart)) {
         $cart = array();
         $cart['idx'] = 0;
     }
     $idx = (int) $cart['idx'];
     $section = isset($data['giftcard_id']) && $data['giftcard_id'] != 0 ? 13 : 12;
     $row_data = $this->_extraFieldFront->getSectionFieldList($section);
     // Set session for giftcard
     if (isset($data['giftcard_id']) && $data['giftcard_id']) {
         $cart[$idx]['reciver_email'] = $data['reciver_email'];
         $cart[$idx]['reciver_name'] = $data['reciver_name'];
         $cart[$idx]['customer_amount'] = $data['customer_amount'];
         for ($g = 0; $g < count($idx); $g++) {
             if ($cart[$g]['giftcard_id'] == $data['giftcard_id']) {
                 $cart[$idx]['quantity'] += 1;
                 $this->_session->set('cart', $cart);
                 return true;
             }
         }
         $cart[$idx]['quantity'] = 1;
         $giftcardData = $this->_producthelper->getGiftcardData($data['giftcard_id']);
         if ($giftcardData->customer_amount) {
             $giftcard_price = $data['customer_amount'];
         } else {
             $giftcard_price = $giftcardData->giftcard_price;
         }
         $cart[$idx]['product_price'] = $giftcard_price;
         $cart[$idx]['product_price_excl_vat'] = $giftcard_price;
         $cart[$idx]['product_vat'] = 0;
         $cart[$idx]['product_id'] = '';
         if (!$cart['discount_type']) {
             $cart['discount_type'] = 0;
         }
         if (!$cart['discount']) {
             $cart['discount'] = 0;
         }
         $cart[$idx]['giftcard_id'] = $data['giftcard_id'];
         for ($i = 0; $i < count($row_data); $i++) {
             $data_txt = isset($data[$row_data[$i]->field_name]) ? $data[$row_data[$i]->field_name] : '';
             $tmpstr = strpbrk($data_txt, '`');
             if ($tmpstr) {
                 $tmparray = explode('`', $data_txt);
                 $tmp = new stdClass();
                 $tmp = @array_merge($tmp, $tmparray);
                 if (is_array($tmparray)) {
                     $data_txt = implode(",", $tmparray);
                 }
             }
             $cart[$idx][$row_data[$i]->field_name] = $data_txt;
         }
         $cart['idx'] = $idx + 1;
         $this->_session->set('cart', $cart);
         return true;
     }
     if (isset($data['hidden_attribute_cartimage'])) {
         $cart[$idx]['hidden_attribute_cartimage'] = $data['hidden_attribute_cartimage'];
     }
     $product_id = $data['product_id'];
     $quantity = $data['quantity'];
     $product_data = $this->_producthelper->getProductById($product_id);
     if (isset($data['parent_accessory_product_id']) && $data['parent_accessory_product_id'] != 0) {
         $tempdata = $this->_producthelper->getProductById($data['parent_accessory_product_id']);
         $producttemplate = $redTemplate->getTemplate("product", $tempdata->product_template);
         $accessory_template = $this->_producthelper->getAccessoryTemplate($producttemplate[0]->template_desc);
         $data_add = $accessory_template->template_desc;
     } else {
         $producttemplate = $redTemplate->getTemplate("product", $product_data->product_template);
         $data_add = $producttemplate[0]->template_desc;
     }
     /*
      * Check if required userfield are filled or not if not than redirect to product detail page...
      * get product userfield from selected product template...
      */
     if (!AJAX_CART_BOX) {
         $fieldreq = $this->userfieldValidation($data, $data_add, $section);
         if ($fieldreq != "") {
             return $fieldreq;
         }
     }
     // Get product price
     $data['product_price'] = 0;
     // Attribute price added
     $generateAttributeCart = isset($data['cart_attribute']) ? $data['cart_attribute'] : $this->generateAttributeArray($data);
     $retAttArr = $this->_producthelper->makeAttributeCart($generateAttributeCart, $product_data->product_id, 0, $data['product_price'], $quantity);
     $selectProp = $this->_producthelper->getSelectedAttributeArray($data);
     $data['product_old_price'] = $retAttArr[5] + $retAttArr[6];
     $data['product_old_price_excl_vat'] = $retAttArr[5];
     $data['product_price'] = $retAttArr[1];
     $product_vat_price = $retAttArr[2];
     $cart[$idx]['product_price_excl_vat'] = $retAttArr[1];
     $data['product_price'] += $product_vat_price;
     if (!empty($selectProp[0])) {
         $attributeImage = $product_id;
         if (count($selectProp[0]) == 1) {
             $attributeImage .= '_p' . $selectProp[0][0];
         } else {
             $pattributeImage = implode('_p', $selectProp[0]);
             $attributeImage .= '_p' . $pattributeImage;
         }
         if (count($selectProp[1]) == 1) {
             $attributeImage .= '_sp' . $selectProp[1][0];
         } else {
             $sattributeImage = implode('_sp', $selectProp[1]);
             if ($sattributeImage) {
                 $attributeImage .= '_sp' . $sattributeImage;
             }
         }
         $cart[$idx]['attributeImage'] = $attributeImage . '.png';
     }
     if (!empty($data['reorder']) && !empty($data['attributeImage'])) {
         $cart[$idx]['attributeImage'] = $data['attributeImage'];
     }
     $selectedAttrId = $retAttArr[3];
     $isStock = $retAttArr[4];
     $selectedPropId = $selectProp[0];
     $notselectedSubpropId = $retAttArr[8];
     $product_preorder = $product_data->preorder;
     $isPreorderStock = $retAttArr[7];
     if (!$isStock) {
         if ($product_preorder == "global" && !ALLOW_PRE_ORDER || $product_preorder == "no" || $product_preorder == "" && !ALLOW_PRE_ORDER) {
             $msg = urldecode(JText::_('COM_REDSHOP_PRODUCT_OUTOFSTOCK_MESSAGE'));
             return $msg;
         } elseif (!$isPreorderStock) {
             $msg = urldecode(JText::_('COM_REDSHOP_PREORDER_PRODUCT_OUTOFSTOCK_MESSAGE'));
             return $msg;
         }
     }
     // Attribute End
     // Discount calculator procedure start
     $discountArr = array();
     $discountArr = $this->discountCalculatorData($product_data, $data);
     $calc_output = "";
     $calc_output_array = array();
     $product_price_tax = 0;
     if (!empty($discountArr)) {
         $calc_output = $discountArr[0];
         $calc_output_array = $discountArr[1];
         // Calculate price without VAT
         $data['product_price'] += $discountArr[2] + $discountArr[3];
         $cart[$idx]['product_price_excl_vat'] += $discountArr[2];
         $product_vat_price += $discountArr[3];
         $cart[$idx]['discount_calc_price'] = $discountArr[2];
     }
     $cart[$idx]['subscription_id'] = 0;
     if ($product_data->product_type == 'subscription') {
         if (isset($data['subscription_id']) && $data['subscription_id'] != "") {
             $subscription_detail = $this->_producthelper->getProductSubscriptionDetail($data['product_id'], $data['subscription_id']);
             $subscription_price = $subscription_detail->subscription_price;
             if ($subscription_price) {
                 $subscription_vat = $this->_producthelper->getProductTax($data['product_id'], $subscription_price);
             }
             $product_vat_price += $subscription_vat;
             $data['product_price'] = $data['product_price'] + $subscription_price + $subscription_vat;
             $data['product_old_price'] = $data['product_old_price'] + $subscription_price + $subscription_vat;
             $data['product_old_price_excl_vat'] += $subscription_price;
             $cart[$idx]['product_price_excl_vat'] += $subscription_price;
             $cart[$idx]['subscription_id'] = $data['subscription_id'];
         } else {
             $msg = urldecode(JText::_('COM_REDSHOP_PLEASE_SELECT_YOUR_SUBSCRIPTION_PLAN'));
             return $msg;
         }
     }
     // Accessory price
     if (ACCESSORY_AS_PRODUCT_IN_CART_ENABLE) {
         if (isset($data['accessory_data'])) {
             $cart['AccessoryAsProduct'] = array($data['accessory_data'], $data['acc_quantity_data'], $data['acc_attribute_data'], $data['acc_property_data'], $data['acc_subproperty_data']);
         }
         $generateAccessoryCart = array();
         $data['accessory_data'] = "";
         $data['acc_quantity_data'] = "";
         $data['acc_attribute_data'] = "";
         $data['acc_property_data'] = "";
         $data['acc_subproperty_data'] = "";
     } else {
         $generateAccessoryCart = isset($data['cart_accessory']) ? $data['cart_accessory'] : $this->generateAccessoryArray($data);
         if (isset($data['accessory_data']) && ($data['accessory_data'] != "" && $data['accessory_data'] != 0)) {
             if (!$generateAccessoryCart) {
                 $document = JFactory::getDocument();
                 return $document->getError();
             }
         }
     }
     $retAccArr = $this->_producthelper->makeAccessoryCart($generateAccessoryCart, $product_data->product_id);
     $accessory_total_price = $retAccArr[1];
     $accessory_vat_price = $retAccArr[2];
     $cart[$idx]['product_price_excl_vat'] += $accessory_total_price;
     $data['product_price'] += $accessory_total_price + $accessory_vat_price;
     $data['product_old_price'] += $accessory_total_price + $accessory_vat_price;
     $data['product_old_price_excl_vat'] += $accessory_total_price;
     $cart[$idx]['product_vat'] = $product_vat_price + $accessory_vat_price;
     if (!INDIVIDUAL_ADD_TO_CART_ENABLE) {
         /*
          * Check if required attribute is filled or not ...
          */
         $attribute_template = $this->_producthelper->getAttributeTemplate($data_add);
         if (count($attribute_template) > 0) {
             $selectedAttributId = 0;
             if (count($selectedAttrId) > 0) {
                 $selectedAttributId = implode(",", $selectedAttrId);
             }
             $req_attribute = $this->_producthelper->getProductAttribute($data['product_id'], 0, 0, 0, 1, $selectedAttributId);
             if (count($req_attribute) > 0) {
                 $requied_attributeArr = array();
                 for ($re = 0; $re < count($req_attribute); $re++) {
                     $requied_attributeArr[$re] = urldecode($req_attribute[$re]->attribute_name);
                 }
                 $requied_attribute_name = implode(", ", $requied_attributeArr);
                 // Throw an error as first attribute is required
                 $msg = urldecode($requied_attribute_name) . " " . JText::_('COM_REDSHOP_IS_REQUIRED');
                 return $msg;
             }
             $selectedPropertyId = 0;
             if (count($selectedPropId) > 0) {
                 $selectedPropertyId = implode(",", $selectedPropId);
             }
             $notselectedSubpropertyId = 0;
             if (count($notselectedSubpropId) > 0) {
                 $notselectedSubpropertyId = implode(",", $notselectedSubpropId);
             }
             $req_property = $this->_producthelper->getAttibuteProperty($selectedPropertyId, $selectedAttributId, $data['product_id'], 0, 1, $notselectedSubpropertyId);
             if (count($req_property) > 0) {
                 $requied_subattributeArr = array();
                 for ($re1 = 0; $re1 < count($req_property); $re1++) {
                     $requied_subattributeArr[$re1] = urldecode($req_property[$re1]->property_name);
                 }
                 $requied_subattribute_name = implode(",", $requied_subattributeArr);
                 // Give error as second attribute is required
                 $msg = urldecode($requied_subattribute_name) . " " . JText::_('COM_REDSHOP_SUBATTRIBUTE_IS_REQUIRED');
                 if ($data['reorder'] != 1) {
                     return $msg;
                 }
             }
         }
     }
     // ADD WRAPPER PRICE
     $wrapper_price = 0;
     $wrapper_vat = 0;
     if (isset($data['sel_wrapper_id']) && $data['sel_wrapper_id']) {
         $wrapperArr = $this->getWrapperPriceArr(array('product_id' => $data['product_id'], 'wrapper_id' => $data['sel_wrapper_id']));
         $wrapper_vat = $wrapperArr['wrapper_vat'];
         $wrapper_price = $wrapperArr['wrapper_price'];
     }
     $cart[$idx]['product_vat'] += $wrapper_vat;
     $data['product_price'] += $wrapper_price + $wrapper_vat;
     $data['product_old_price'] += $wrapper_price + $wrapper_vat;
     $data['product_old_price_excl_vat'] += $wrapper_price;
     $cart[$idx]['product_price_excl_vat'] += $wrapper_price;
     // END WRAPPER PRICE
     $att_id_total = false;
     $att_acc_total = false;
     $prodcut_id_total = false;
     // Checking For same Product and update Quantity
     $selectAcc = $this->_producthelper->getSelectedAccessoryArray($data);
     $selectAtt = $this->_producthelper->getSelectedAttributeArray($data);
     $sameProduct = false;
     for ($i = 0; $i < $idx; $i++) {
         if ($cart[$i]['product_id'] == $data['product_id']) {
             $sameProduct = true;
             if (isset($data['subscription_id']) && $cart[$i]['subscription_id'] != $data['subscription_id']) {
                 $sameProduct = false;
             }
             if ($cart[$i]['wrapper_id'] != $data['sel_wrapper_id']) {
                 $sameProduct = false;
             }
             $prevSelectAtt = $this->getSelectedCartAttributeArray($cart[$i]['cart_attribute']);
             $newdiff1 = array_diff($prevSelectAtt[0], $selectAtt[0]);
             $newdiff2 = array_diff($selectAtt[0], $prevSelectAtt[0]);
             if (count($newdiff1) > 0 || count($newdiff2) > 0) {
                 $sameProduct = false;
             }
             $newdiff1 = array_diff($prevSelectAtt[1], $selectAtt[1]);
             $newdiff2 = array_diff($selectAtt[1], $prevSelectAtt[1]);
             if (count($newdiff1) > 0 || count($newdiff2) > 0) {
                 $sameProduct = false;
             }
             $prevSelectAcc = $this->getSelectedCartAccessoryArray($cart[$i]['cart_accessory']);
             $newdiff1 = array_diff($prevSelectAcc[0], $selectAcc[0]);
             $newdiff2 = array_diff($selectAcc[0], $prevSelectAcc[0]);
             if (count($newdiff1) > 0 || count($newdiff2) > 0) {
                 $sameProduct = false;
             }
             $newdiff1 = array_diff($prevSelectAcc[1], $selectAcc[1]);
             $newdiff2 = array_diff($selectAcc[1], $prevSelectAcc[1]);
             if (count($newdiff1) > 0 || count($newdiff2) > 0) {
                 $sameProduct = false;
             }
             $newdiff1 = array_diff($prevSelectAcc[2], $selectAcc[2]);
             $newdiff2 = array_diff($selectAcc[2], $prevSelectAcc[2]);
             if (count($newdiff1) > 0 || count($newdiff2) > 0) {
                 $sameProduct = false;
             }
             // Discount calculator
             $array_diff_calc = array_diff_assoc($cart[$i]['discount_calc'], $calc_output_array);
             if (count($array_diff_calc) > 0) {
                 $sameProduct = false;
             }
             /**
              * Previous comment stated it is not used anymore.
              * Changing it for another purpose. It can intercept and decide whether added product should be added as same or new product.
              */
             $dispatcher->trigger('checkSameCartProduct', array(&$cart, $data, &$sameProduct));
             // Product userfiled
             if (!empty($row_data)) {
                 $puf = 1;
                 for ($r = 0; $r < count($row_data); $r++) {
                     $produser_field = $row_data[$r]->field_name;
                     $added_userfield = $data[$produser_field];
                     if (isset($cart[$i][$produser_field]) && $added_userfield != $cart[$i][$produser_field]) {
                         $puf = 0;
                     }
                 }
                 if ($puf != 1) {
                     $sameProduct = false;
                 }
             }
             if ($sameProduct) {
                 $newQuantity = $cart[$i]['quantity'] + $data['quantity'];
                 $newcartquantity = $this->checkQuantityInStock($cart[$i], $newQuantity);
                 if ($newQuantity > $newcartquantity) {
                     $cart['notice_message'] = $newcartquantity . " " . JTEXT::_('COM_REDSHOP_AVAILABLE_STOCK_MESSAGE');
                 } else {
                     $cart['notice_message'] = "";
                 }
                 if ($newcartquantity != $cart[$i]['quantity']) {
                     $cart[$i]['quantity'] = $newcartquantity;
                     /*
                      * trigger the event of redSHOP product plugin support on Same product is going to add into cart
                      *
                      * Usually redSHOP update quantity
                      */
                     $dispatcher->trigger('onSameCartProduct', array(&$cart, $data, $i));
                     $this->_session->set('cart', $cart);
                     $data['cart_index'] = $i;
                     $data['quantity'] = $newcartquantity;
                     $this->update($data);
                     return true;
                 } else {
                     $msg = CART_RESERVATION_MESSAGE != '' && IS_PRODUCT_RESERVE ? CART_RESERVATION_MESSAGE : urldecode(JText::_('COM_REDSHOP_PRODUCT_OUTOFSTOCK_MESSAGE'));
                     return $msg;
                 }
             }
         }
     }
     // Set product price
     if ($data['product_price'] < 0) {
         $data['product_price'] = 0;
     }
     $per_product_total = $product_data->minimum_per_product_total;
     if ($data['product_price'] < $per_product_total) {
         $msg = JText::_('COM_REDSHOP_PER_PRODUCT_TOTAL') . " " . $per_product_total;
         return $msg;
     }
     if (!$sameProduct) {
         // SET VALVUES INTO SESSION CART
         $cart[$idx]['giftcard_id'] = '';
         $cart[$idx]['product_id'] = $data['product_id'];
         $cart[$idx]['discount_calc_output'] = $calc_output;
         $cart[$idx]['discount_calc'] = $calc_output_array;
         $cart[$idx]['product_price'] = $data['product_price'];
         $cart[$idx]['product_old_price'] = $data['product_old_price'];
         $cart[$idx]['product_old_price_excl_vat'] = $data['product_old_price_excl_vat'];
         $cart[$idx]['cart_attribute'] = $generateAttributeCart;
         $cart[$idx]['cart_accessory'] = $generateAccessoryCart;
         if (isset($data['hidden_attribute_cartimage'])) {
             $cart[$idx]['hidden_attribute_cartimage'] = $data['hidden_attribute_cartimage'];
         }
         $cart[$idx]['quantity'] = 0;
         $newQuantity = $data['quantity'];
         $cart[$idx]['quantity'] = $this->checkQuantityInStock($cart[$idx], $newQuantity);
         if ($newQuantity > $cart[$idx]['quantity']) {
             $cart['notice_message'] = $cart[$idx]['quantity'] . " " . JTEXT::_('COM_REDSHOP_AVAILABLE_STOCK_MESSAGE');
         } else {
             $cart['notice_message'] = "";
         }
         if ($cart[$idx]['quantity'] <= 0) {
             $msg = CART_RESERVATION_MESSAGE != '' && IS_PRODUCT_RESERVE ? CART_RESERVATION_MESSAGE : JText::_('COM_REDSHOP_PRODUCT_OUTOFSTOCK_MESSAGE');
             return $msg;
         }
         $cart[$idx]['category_id'] = $data['category_id'];
         $cart[$idx]['wrapper_id'] = $data['sel_wrapper_id'];
         $cart[$idx]['wrapper_price'] = $wrapper_price + $wrapper_vat;
         /**
          * Implement new plugin support before session update
          * trigger the event of redSHOP product plugin support on Before cart session is set - on prepare cart session
          */
         $dispatcher->trigger('onBeforeSetCartSession', array(&$cart, $data));
         $cart['idx'] = $idx + 1;
         for ($i = 0; $i < count($row_data); $i++) {
             $field_name = $row_data[$i]->field_name;
             $data_txt = isset($data[$field_name]) ? $data[$field_name] : '';
             $tmpstr = strpbrk($data_txt, '`');
             if ($tmpstr) {
                 $data_txt = str_replace('`', ',', $data_txt);
             }
             $cart[$idx][$field_name] = $data_txt;
         }
     }
     if (!$cart['discount_type']) {
         $cart['discount_type'] = 0;
     }
     if (!$cart['discount']) {
         $cart['discount'] = 0;
     }
     if (!$cart['cart_discount']) {
         $cart['cart_discount'] = 0;
     }
     if (!isset($cart['user_shopper_group_id']) || isset($cart['user_shopper_group_id']) && $cart['user_shopper_group_id'] == 0) {
         $cart['user_shopper_group_id'] = $rsUserhelper->getShopperGroup($user->id);
     }
     $cart['free_shipping'] = 0;
     $this->_session->set('cart', $cart);
     return true;
 }
Ejemplo n.º 29
0
 public function displayAdditionalImage($product_id = 0, $accessory_id = 0, $relatedprd_id = 0, $property_id = 0, $subproperty_id = 0, $main_imgwidth = 0, $main_imgheight = 0, $redview = "", $redlayout = "")
 {
     $redshopconfig = new Redconfiguration();
     $redTemplate = new Redtemplate();
     $stockroomhelper = new rsstockroomhelper();
     $url = JURI::base();
     $option = JRequest::getVar('option');
     $redhelper = new redhelper();
     if ($accessory_id != 0) {
         $accessory = $this->getProductAccessory($accessory_id);
         $product_id = $accessory[0]->child_product_id;
     }
     $product = $this->getProductById($product_id);
     $producttemplate = $redTemplate->getTemplate("product", $product->product_template);
     // Get template for stockroom status
     if ($accessory_id != 0) {
         $template_desc = $redTemplate->getTemplate("accessory_product");
         $template_desc = $template_desc[0]->template_desc;
     } elseif ($relatedprd_id != 0) {
         $template_desc = $redTemplate->getTemplate("related_product");
         $template_desc = $template_desc[0]->template_desc;
     } else {
         $template_desc = $producttemplate[0]->template_desc;
     }
     $producttemplate = $producttemplate[0]->template_desc;
     if ($redlayout == 'categoryproduct' || $redlayout == 'detail') {
         if (strstr($producttemplate, "{product_thumb_image_3}")) {
             $pimg_tag = '{product_thumb_image_3}';
             $ph_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT_3;
             $pw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH_3;
         } elseif (strstr($producttemplate, "{product_thumb_image_2}")) {
             $pimg_tag = '{product_thumb_image_2}';
             $ph_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT_2;
             $pw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH_2;
         } elseif (strstr($producttemplate, "{product_thumb_image_1}")) {
             $pimg_tag = '{product_thumb_image_1}';
             $ph_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT;
             $pw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH;
         } else {
             $pimg_tag = '{product_thumb_image}';
             $ph_thumb = CATEGORY_PRODUCT_THUMB_HEIGHT;
             $pw_thumb = CATEGORY_PRODUCT_THUMB_WIDTH;
         }
     } else {
         if (strstr($producttemplate, "{product_thumb_image_3}")) {
             $pimg_tag = '{product_thumb_image_3}';
             $ph_thumb = PRODUCT_MAIN_IMAGE_HEIGHT_3;
             $pw_thumb = PRODUCT_MAIN_IMAGE_3;
         } elseif (strstr($producttemplate, "{product_thumb_image_2}")) {
             $pimg_tag = '{product_thumb_image_2}';
             $ph_thumb = PRODUCT_MAIN_IMAGE_HEIGHT_2;
             $pw_thumb = PRODUCT_MAIN_IMAGE_2;
         } elseif (strstr($producttemplate, "{product_thumb_image_1}")) {
             $pimg_tag = '{product_thumb_image_1}';
             $ph_thumb = PRODUCT_MAIN_IMAGE_HEIGHT;
             $pw_thumb = PRODUCT_MAIN_IMAGE;
         } else {
             $pimg_tag = '{product_thumb_image}';
             $ph_thumb = PRODUCT_MAIN_IMAGE_HEIGHT;
             $pw_thumb = PRODUCT_MAIN_IMAGE;
         }
     }
     if (strstr($producttemplate, "{more_images_3}")) {
         $mph_thumb = PRODUCT_ADDITIONAL_IMAGE_HEIGHT_3;
         $mpw_thumb = PRODUCT_ADDITIONAL_IMAGE_3;
     } elseif (strstr($producttemplate, "{more_images_2}")) {
         $mph_thumb = PRODUCT_ADDITIONAL_IMAGE_HEIGHT_2;
         $mpw_thumb = PRODUCT_ADDITIONAL_IMAGE_2;
     } elseif (strstr($producttemplate, "{more_images_1}")) {
         $mph_thumb = PRODUCT_ADDITIONAL_IMAGE_HEIGHT;
         $mpw_thumb = PRODUCT_ADDITIONAL_IMAGE;
     } else {
         $mph_thumb = PRODUCT_ADDITIONAL_IMAGE_HEIGHT;
         $mpw_thumb = PRODUCT_ADDITIONAL_IMAGE;
     }
     if ($main_imgwidth != 0 || $main_imgheight != 0) {
         $pw_thumb = $main_imgwidth;
         $ph_thumb = $main_imgheight;
     }
     $ImageAttributes = $this->getdisplaymainImage($product_id, $property_id, $subproperty_id, $pw_thumb, $ph_thumb, $redview);
     $aHrefImageResponse = $ImageAttributes['aHrefImageResponse'];
     $mainImageResponse = $ImageAttributes['mainImageResponse'];
     $productmainimg = $ImageAttributes['productmainimg'];
     $aTitleImageResponse = $ImageAttributes['aTitleImageResponse'];
     $imagename = $ImageAttributes['imagename'];
     //		$ImageAttributes['type']		= $type;
     $attrbimg = $ImageAttributes['attrbimg'];
     $pr_number = $ImageAttributes['pr_number'];
     //$view				= $ImageAttributes['view'];
     $prodadditionImg = "";
     $propadditionImg = "";
     $subpropadditionImg = "";
     $product_availability_date_lbl = '';
     $product_availability_date = '';
     $media_image = $this->getAdditionMediaImage($product_id, "product");
     $tmp_prodimg = "";
     $val_prodadd = count($media_image);
     for ($m = 0; $m < count($media_image); $m++) {
         $thumb = $media_image[$m]->media_name;
         $alttext = $this->getAltText('product', $media_image[$m]->section_id, '', $media_image[$m]->media_id);
         if (!$alttext) {
             $alttext = $media_image[$m]->media_name;
         }
         if ($thumb && $thumb != $media_image[$m]->product_full_image && is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $thumb)) {
             if (WATERMARK_PRODUCT_ADDITIONAL_IMAGE) {
                 $pimg = $redhelper->watermark('product', $thumb, $mpw_thumb, $mph_thumb, WATERMARK_PRODUCT_ADDITIONAL_IMAGE, "1");
                 $linkimage = $redhelper->watermark('product', $thumb, '', '', WATERMARK_PRODUCT_ADDITIONAL_IMAGE, "0");
                 $hoverimg_path = $redhelper->watermark('product', $thumb, ADDITIONAL_HOVER_IMAGE_WIDTH, ADDITIONAL_HOVER_IMAGE_HEIGHT, WATERMARK_PRODUCT_ADDITIONAL_IMAGE, '2');
             } else {
                 $pimg = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'product', $mpw_thumb, $mph_thumb, USE_IMAGE_SIZE_SWAPPING);
                 $linkimage = REDSHOP_FRONT_IMAGES_ABSPATH . "product/" . $thumb;
                 $hoverimg_path = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'product', ADDITIONAL_HOVER_IMAGE_WIDTH, ADDITIONAL_HOVER_IMAGE_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
             }
             if (PRODUCT_ADDIMG_IS_LIGHTBOX) {
                 $prodadditionImg_div_start = "<div class='additional_image'><a href='" . $linkimage . "' title='" . $alttext . "'  rel=\"myallimg\">";
                 $prodadditionImg_div_end = "</a></div>";
                 $prodadditionImg .= $prodadditionImg_div_start;
                 $prodadditionImg .= "<img src='" . $pimg . "' alt='" . $alttext . "' title='" . $alttext . "'>";
                 $producthrefend = "";
             } else {
                 if (WATERMARK_PRODUCT_ADDITIONAL_IMAGE) {
                     $img_path = $redhelper->watermark('product', $thumb, $pw_thumb, $ph_thumb, WATERMARK_PRODUCT_ADDITIONAL_IMAGE, '0');
                 } else {
                     $img_path = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'product', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                 }
                 $filename_thumb = REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $product->product_thumb_image;
                 $filename_org = REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $media_image[$m]->product_full_image;
                 if (is_file($filename_thumb)) {
                     $thumb_original = $product->product_thumb_image;
                 } elseif (is_file($filename_org)) {
                     $thumb_original = $media_image[$m]->product_full_image;
                 } else {
                     $thumb_original = PRODUCT_DEFAULT_IMAGE;
                 }
                 if (WATERMARK_PRODUCT_THUMB_IMAGE) {
                     $img_path_org = $redhelper->watermark('product', $thumb_original, $pw_thumb, $ph_thumb, WATERMARK_PRODUCT_THUMB_IMAGE, '0');
                 } else {
                     $img_path_org = RedShopHelperImages::getImagePath($thumb_original, '', 'thumb', 'product', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                 }
                 $prodadditionImg_div_start = "<div class='additional_image' onmouseover='display_image_add(\"" . $img_path . "\"," . $product_id . ");' onmouseout='display_image_add_out(\"" . $img_path_org . "\"," . $product_id . ");'>";
                 $prodadditionImg_div_end = "</div>";
                 $prodadditionImg .= $prodadditionImg_div_start;
                 $prodadditionImg .= '<a href="javascript:void(0)" >' . "<img src='" . $pimg . "' alt='" . $alttext . "' title='" . $alttext . "' style='cursor: auto;'>";
                 $producthrefend = "</a>";
             }
             if (ADDITIONAL_HOVER_IMAGE_ENABLE) {
                 $prodadditionImg .= "<img src='" . $hoverimg_path . "' alt='" . $alttext . "' title='" . $alttext . "' class='redImagepreview'>";
             }
             $prodadditionImg .= $producthrefend;
             $prodadditionImg .= $prodadditionImg_div_end;
             $tmp_prodimg = $prodadditionImg;
         }
     }
     if ($val_prodadd == 0) {
         $prodadditionImg = " ";
         $propadditionImg = " ";
     }
     if ($property_id > 0) {
         $media_image = $this->getAdditionMediaImage($property_id, "property");
         if (count($media_image) == 0) {
             $propadditionImg = $tmp_prodimg;
         } else {
             for ($m = 0; $m < count($media_image); $m++) {
                 $thumb = $media_image[$m]->media_name;
                 $alttext = $this->getAltText('property', $media_image[$m]->section_id, '', $media_image[$m]->media_id);
                 if (!$alttext) {
                     $alttext = $thumb;
                 }
                 if ($thumb && $thumb != $media_image[$m]->property_main_image && is_file(REDSHOP_FRONT_IMAGES_RELPATH . "property/" . $thumb)) {
                     if (PRODUCT_ADDIMG_IS_LIGHTBOX) {
                         $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'property', $mpw_thumb, $mph_thumb, USE_IMAGE_SIZE_SWAPPING);
                         $propadditionImg_div_start = "<div class='additional_image'><a href='" . REDSHOP_FRONT_IMAGES_ABSPATH . "property/" . $thumb . "' title='" . $alttext . "' rel=\"myallimg\">";
                         $propadditionImg_div_end = "</a></div>";
                         $propadditionImg .= $propadditionImg_div_start;
                         $propadditionImg .= "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "'>";
                         $prophrefend = "";
                     } else {
                         $imgs_path = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'property', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                         $property_filename_org = REDSHOP_FRONT_IMAGES_RELPATH . "property/" . $imagename;
                         if (is_file($property_filename_org)) {
                             $property_thumb_original = $imagename;
                             $property_img_path_org = RedShopHelperImages::getImagePath($property_thumb_original, '', 'thumb', 'property', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                         } else {
                             $property_thumb_original = $thumb_original;
                             $property_img_path_org = RedShopHelperImages::getImagePath($property_thumb_original, '', 'thumb', 'product', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                         }
                         $propadditionImg_div_start = "<div class='additional_image' onmouseover='display_image_add(\"" . $imgs_path . "\"," . $product_id . ");' onmouseout='display_image_add_out(\"" . $property_img_path_org . "\"," . $product_id . ");'>";
                         $propadditionImg_div_end = "</div>";
                         $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'property', $mpw_thumb, $mph_thumb, USE_IMAGE_SIZE_SWAPPING);
                         $propadditionImg .= $propadditionImg_div_start;
                         $propadditionImg .= "<a href='javascript:void(0)'>" . "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "' style='cursor: auto;'>";
                         $prophrefend = "</a>";
                     }
                     if (ADDITIONAL_HOVER_IMAGE_ENABLE) {
                         $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', 'property', ADDITIONAL_HOVER_IMAGE_WIDTH, ADDITIONAL_HOVER_IMAGE_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                         $propadditionImg .= "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "' class='redImagepreview'>";
                     }
                     $propadditionImg .= $prophrefend;
                     $propadditionImg .= $propadditionImg_div_end;
                 }
             }
         }
     }
     if ($subproperty_id > 0) {
         //Display Sub-Property Number
         $media_image = $this->getAdditionMediaImage($subproperty_id, "subproperty");
         for ($m = 0; $m < count($media_image); $m++) {
             $thumb = $media_image[$m]->media_name;
             $alttext = $this->getAltText('subproperty', $media_image[$m]->section_id, '', $media_image[$m]->media_id);
             if (!$alttext) {
                 $alttext = $thumb;
             }
             $filedir = is_file(REDSHOP_FRONT_IMAGES_RELPATH . "subproperty/" . $thumb) ? 'subproperty' : 'property';
             if ($thumb && $thumb != $media_image[$m]->subattribute_color_main_image && is_file(REDSHOP_FRONT_IMAGES_RELPATH . $filedir . "/" . $thumb)) {
                 if (PRODUCT_ADDIMG_IS_LIGHTBOX) {
                     $subpropadditionImg_div_start = "<div class='additional_image'><a href='" . REDSHOP_FRONT_IMAGES_ABSPATH . $filedir . "/" . $thumb . "' title='" . $alttext . "' rel=\"myallimg\">";
                     $subpropadditionImg_div_end = "</a></div>";
                     $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', $filedir, $mpw_thumb, $mph_thumb, USE_IMAGE_SIZE_SWAPPING);
                     $subpropadditionImg .= $subpropadditionImg_div_start;
                     $subpropadditionImg .= "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "'>";
                     $subprophrefend = "";
                 } else {
                     $imgs_path = RedShopHelperImages::getImagePath($thumb, '', 'thumb', $filedir, $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                     $subproperty_filename_org = REDSHOP_FRONT_IMAGES_RELPATH . "subproperty/" . $imagename;
                     if (is_file($subproperty_filename_org)) {
                         $subproperty_thumb_original = $media_image[$m]->subattribute_color_image;
                         $subproperty_img_path_org = RedShopHelperImages::getImagePath($subproperty_thumb_original, '', 'thumb', 'subproperty', $pw_thumb, $ph_thumb, USE_IMAGE_SIZE_SWAPPING);
                     } else {
                         $subproperty_img_path_org = $property_img_path_org;
                     }
                     $subpropadditionImg_div_start = "<div class='additional_image' onmouseover='display_image_add(\"" . $imgs_path . "\"," . $product_id . ");' onmouseout='display_image_add_out(\"" . $subproperty_img_path_org . "\"," . $product_id . ");' >";
                     $subpropadditionImg_div_end = "</div>";
                     $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', $filedir, $mpw_thumb, $mph_thumb, USE_IMAGE_SIZE_SWAPPING);
                     $subpropadditionImg .= $subpropadditionImg_div_start;
                     $subpropadditionImg .= "<a href='javascript:void(0)'>" . "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "' style='cursor: auto;'>";
                     $subprophrefend = "</a>";
                 }
                 if (ADDITIONAL_HOVER_IMAGE_ENABLE) {
                     $thumbUrl = RedShopHelperImages::getImagePath($thumb, '', 'thumb', $filedir, ADDITIONAL_HOVER_IMAGE_WIDTH, ADDITIONAL_HOVER_IMAGE_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                     $subpropadditionImg .= "<img src='" . $thumbUrl . "' alt='" . $alttext . "' title='" . $alttext . "' class='redImagepreview'>";
                 }
                 $subpropadditionImg .= $subprophrefend;
                 $subpropadditionImg .= $subpropadditionImg_div_end;
             }
         }
     }
     $response = "";
     if ($subpropadditionImg != "") {
         $response = "<div>" . $subpropadditionImg . "</div>";
     } elseif ($propadditionImg != "") {
         $response = "<div>" . $propadditionImg . "</div>";
     } elseif ($prodadditionImg != "") {
         $response = "<div>" . $prodadditionImg . "</div>";
     }
     $ProductAttributeDelivery = "";
     $attributeFlag = false;
     if ($accessory_id == 0) {
         if ($subproperty_id) {
             $ProductAttributeDelivery = $this->getProductMinDeliveryTime($product_id, $subproperty_id, "subproperty", 0);
             if ($ProductAttributeDelivery) {
                 $attributeFlag = true;
             }
         }
         if ($property_id && $attributeFlag == false) {
             $ProductAttributeDelivery = $this->getProductMinDeliveryTime($product_id, $property_id, "property", 0);
             if ($ProductAttributeDelivery) {
                 $attributeFlag = true;
             }
         }
         if ($product_id && $attributeFlag == false) {
             $ProductAttributeDelivery = $this->getProductMinDeliveryTime($product_id);
         }
     }
     $stock_status = '';
     $stockamountTooltip = "";
     $productinstock = 0;
     $stockamountSrc = "";
     $stockImgFlag = false;
     $notify_stock = '';
     if (USE_STOCKROOM == 1 && $accessory_id == 0) {
         if ($subproperty_id) {
             $productinstock = $stockroomhelper->getStockAmountwithReserve($subproperty_id, "subproperty");
             $stockamountList = $stockroomhelper->getStockAmountImage($subproperty_id, "subproperty", $productinstock);
             //				if(count($stockamountList)>0)
             //				{
             $stockImgFlag = true;
             //				}
         }
         if ($property_id && $stockImgFlag == false) {
             $productinstock = $stockroomhelper->getStockAmountwithReserve($property_id, "property");
             $stockamountList = $stockroomhelper->getStockAmountImage($property_id, "property", $productinstock);
             //				if(count($stockamountList)>0)
             //				{
             $stockImgFlag = true;
             //				}
         }
         if ($product_id && $stockImgFlag == false) {
             $productinstock = $stockroomhelper->getStockAmountwithReserve($product_id);
             $stockamountList = $stockroomhelper->getStockAmountImage($product_id, "product", $productinstock);
         }
         if (count($stockamountList) > 0) {
             $stockamountTooltip = $stockamountList[0]->stock_amount_image_tooltip;
             $stockamountSrc = REDSHOP_FRONT_IMAGES_ABSPATH . 'stockroom/' . $stockamountList[0]->stock_amount_image;
         }
     }
     // Stockroom status code->Ushma
     if (strstr($template_desc, "{stock_status") || strstr($template_desc, "{stock_notify_flag}") || strstr($template_desc, "{product_availability_date}")) {
         // for c**t attributes
         $attributes_set = array();
         if ($product->attribute_set_id > 0) {
             $attributes_set = $this->getProductAttribute(0, $product->attribute_set_id, 0, 1);
         }
         $attributes = $this->getProductAttribute($product->product_id);
         $attributes = array_merge($attributes, $attributes_set);
         $totalatt = count($attributes);
         $productStockStatus = $this->getproductStockStatus($product->product_id, $totalatt, $property_id, $subproperty_id);
         if (strstr($template_desc, "{stock_status")) {
             $stocktag = strstr($template_desc, "{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 (!$productStockStatus['regular_stock']) {
                 if ($productStockStatus['preorder'] && !$productStockStatus['preorder_stock'] || !$productStockStatus['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>";
             }
         }
         if (strstr($template_desc, "{stock_notify_flag}")) {
             $userArr = $this->_session->get('rs_user');
             $is_login = $userArr['rs_is_user_login'];
             $users_info_id = $userArr['rs_user_info_id'];
             $user_id = $userArr['rs_userid'];
             $is_notified = $this->isAlreadyNotifiedUser($user_id, $product->product_id, $property_id, $subproperty_id);
             if (!$productStockStatus['regular_stock'] && $is_login && $users_info_id) {
                 if ($productStockStatus['preorder'] && !$productStockStatus['preorder_stock'] || !$productStockStatus['preorder']) {
                     if ($is_notified) {
                         $notify_stock = "<span>" . JText::_('COM_REDSHOP_ALREADY_REQUESTED_FOR_NOTIFICATION') . "</span>";
                     } else {
                         $notify_stock = '<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->product_id . '\',\'' . $property_id . '\', \'' . $subproperty_id . '\');">';
                     }
                 } else {
                     $notify_stock = "";
                 }
             } else {
                 $notify_stock = '';
             }
         }
         if (strstr($template_desc, "{product_availability_date}")) {
             if (!$productStockStatus['regular_stock'] && $productStockStatus['preorder']) {
                 if ($product->product_availability_date != "") {
                     $product_availability_date_lbl = JText::_('COM_REDSHOP_PRODUCT_AVAILABILITY_DATE_LBL') . ": ";
                     $product_availability_date = $redshopconfig->convertDateFormat($product->product_availability_date);
                 } else {
                     $product_availability_date_lbl = "";
                     $product_availability_date = "";
                 }
             } else {
                 $product_availability_date_lbl = "";
                 $product_availability_date = "";
             }
         }
     }
     $ret = array();
     $ret['response'] = $response;
     $ret['aHrefImageResponse'] = $aHrefImageResponse;
     $ret['aTitleImageResponse'] = $aTitleImageResponse;
     $ret['mainImageResponse'] = $mainImageResponse;
     $ret['stockamountSrc'] = $stockamountSrc;
     $ret['stockamountTooltip'] = $stockamountTooltip;
     $ret['ProductAttributeDelivery'] = $ProductAttributeDelivery;
     $ret['attrbimg'] = $attrbimg;
     $ret['pr_number'] = $pr_number;
     $ret['productinstock'] = $productinstock;
     $ret['stock_status'] = $stock_status;
     $ret['product_mainimg'] = $productmainimg;
     $ret['ImageName'] = $imagename;
     $ret['notifyStock'] = $notify_stock;
     $ret['product_availability_date_lbl'] = $product_availability_date_lbl;
     $ret['product_availability_date'] = $product_availability_date;
     //$ret['view']			=$view;
     return $ret;
 }
Ejemplo n.º 30
0
 *
 * @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');
$redTemplate = new Redtemplate();
$carthelper = new rsCarthelper();
$Itemid = JRequest::getInt('Itemid');
$return = JRequest::getString('return');
$session = JFactory::getSession();
$cart = $session->get('cart');
$detail = $this->detail;
$user = JFactory::getUser();
$extra_field = new extra_field();
$quotation_template = $redTemplate->getTemplate("quotation_request");
if (count($quotation_template) > 0 && $quotation_template[0]->template_desc != "") {
    $template_desc = $quotation_template[0]->template_desc;
} else {
    $template_desc = "<fieldset class=\"adminform\"><legend>{order_detail_lbl}</legend> \r\n<table class=\"admintable\">\r\n<tbody>\r\n<tr>\r\n<td>{product_name_lbl}</td>\r\n<td>{quantity_lbl}</td>\r\n</tr>\r\n{product_loop_start}\r\n<tr>\r\n<td>{product_name}<br />{product_attribute}<br />{product_accessory}<br />{product_userfields}</td>\r\n<td>{update_cart}</td>\r\n</tr>\r\n{product_loop_end}\r\n</tbody>\r\n</table>\r\n</fieldset>\r\n<p>{customer_note_lbl}:{customer_note}</p>\r\n<fieldset class=\"adminform\"><legend>{billing_address_information_lbl}</legend> {billing_address}{quotation_custom_field_list} </fieldset> \r\n<table border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td align=\"center\">{cancel_btn}{request_quotation_btn}</td>\r\n</tr>\r\n</tbody>\r\n</table>";
}
?>
<script type="text/javascript">
	function validateInfo() {
		var frm = document.adminForm;

		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

		if (frm.user_email.value == '') {
			alert("<?php 
echo JText::_('COM_REDSHOP_PLEASE_ENTER_EMAIL_ADDRESS');