Esempio n. 1
0
$for = JRequest::getWord("for", false);
if ($tmpl == 'component' && !$for) {
    $doc->addStyleDeclaration('html { overflow:scroll; }');
}
// 	Getting the configuration
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/redshop.cfg.php';
require_once JPATH_ADMINISTRATOR . '/components/com_redshop/helpers/configuration.php';
$Redconfiguration = new Redconfiguration();
$Redconfiguration->defineDynamicVars();
require_once JPATH_SITE . '/components/com_redshop/helpers/currency.php';
$session = JFactory::getSession('product_currency');
$post = JRequest::get('POST');
$Itemid = JRequest::getVar('Itemid');
require_once JPATH_SITE . '/components/com_redshop/helpers/helper.php';
$redhelper = new redhelper();
$cart_Itemid = $redhelper->getCartItemid();
if ($cart_Itemid == "" || $cart_Itemid == 0) {
    $cItemid = $redhelper->getItemid();
    $tmpItemid = $cItemid;
} else {
    $tmpItemid = $cart_Itemid;
}
if (isset($post['product_currency'])) {
    $session->set('product_currency', $post['product_currency']);
}
$currency_symbol = REDCURRENCY_SYMBOL;
$currency_convert = 1;
$script = "\n\t\twindow.site_url = '" . JURI::root() . "';\n\t\twindow.AJAX_CART_BOX = '" . AJAX_CART_BOX . "';\n\t\twindow.REDSHOP_VIEW = '" . $view . "';\n\t\twindow.REDSHOP_LAYOUT = '" . $layout . "';\n\t\twindow.DEFAULT_CUSTOMER_REGISTER_TYPE = '" . DEFAULT_CUSTOMER_REGISTER_TYPE . "';\n\t\twindow.AJAX_CART_URL = '" . JRoute::_('index.php?option=com_redshop&view=cart&Itemid=' . $tmpItemid, false) . "';\n\t\twindow.REDCURRENCY_SYMBOL = '" . REDCURRENCY_SYMBOL . "';\n\t\twindow.CURRENCY_SYMBOL_CONVERT = '" . $currency_symbol . "';\n\t\twindow.CURRENCY_CONVERT = '" . $currency_convert . "';\n\t\twindow.PRICE_SEPERATOR = '" . PRICE_SEPERATOR . "';\n\t\twindow.COM_REDSHOP_PRODUCT_OUTOFSTOCK_MESSAGE = '" . JText::_('COM_REDSHOP_PRODUCT_OUTOFSTOCK_MESSAGE') . "';\n\t\twindow.COM_REDSHOP_PREORDER_PRODUCT_OUTOFSTOCK_MESSAGE = '" . JText::_('COM_REDSHOP_PREORDER_PRODUCT_OUTOFSTOCK_MESSAGE') . "';\n\t\twindow.CURRENCY_SYMBOL_POSITION = '" . CURRENCY_SYMBOL_POSITION . "';\n\t\twindow.PRICE_DECIMAL = '" . PRICE_DECIMAL . "';\n\t\twindow.COM_REDSHOP_PASSWORD_MIN_CHARACTER_LIMIT = '" . JText::_('COM_REDSHOP_PASSWORD_MIN_CHARACTER_LIMIT') . "';\n\t\twindow.THOUSAND_SEPERATOR = '" . THOUSAND_SEPERATOR . "';\n\t\twindow.COM_REDSHOP_VIEW_CART = '" . JText::_('COM_REDSHOP_VIEW_CART') . "';\n\t\twindow.COM_REDSHOP_CONTINUE_SHOPPING = '" . JText::_('COM_REDSHOP_CONTINUE_SHOPPING') . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_VALID_PHONE = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_VALID_PHONE') . "';\n\t\twindow.COM_REDSHOP_CART_SAVE = '" . JText::_('COM_REDSHOP_CART_SAVE') . "';\n\t\twindow.COM_REDSHOP_IS_REQUIRED = '" . JText::_('COM_REDSHOP_IS_REQUIRED') . "';\n\t\twindow.COM_REDSHOP_ENTER_NUMBER = '" . JText::_('COM_REDSHOP_ENTER_NUMBER') . "';\n\t\twindow.USE_STOCKROOM = '" . USE_STOCKROOM . "';\n\t\twindow.USE_AS_CATALOG = '" . USE_AS_CATALOG . "';\n\t\twindow.AJAX_CART_DISPLAY_TIME = '" . AJAX_CART_DISPLAY_TIME . "';\n\t\twindow.SHOW_PRICE = '" . SHOW_PRICE . "';\n\t\twindow.DEFAULT_QUOTATION_MODE = '" . DEFAULT_QUOTATION_MODE . "';\n\t\twindow.PRICE_REPLACE = '" . PRICE_REPLACE . "';\n\t\twindow.PRICE_REPLACE_URL = '" . PRICE_REPLACE_URL . "';\n\t\twindow.ZERO_PRICE_REPLACE = '" . ZERO_PRICE_REPLACE . "';\n\t\twindow.ZERO_PRICE_REPLACE_URL = '" . ZERO_PRICE_REPLACE_URL . "';\n\t\twindow.OPTIONAL_SHIPPING_ADDRESS = '" . OPTIONAL_SHIPPING_ADDRESS . "';\n\t\twindow.SHIPPING_METHOD_ENABLE = '" . SHIPPING_METHOD_ENABLE . "';\n\t\twindow.PRODUCT_ADDIMG_IS_LIGHTBOX = '" . PRODUCT_ADDIMG_IS_LIGHTBOX . "';\n\t\twindow.ALLOW_PRE_ORDER = '" . ALLOW_PRE_ORDER . "';\n\t\twindow.ATTRIBUTE_SCROLLER_THUMB_WIDTH = '" . ATTRIBUTE_SCROLLER_THUMB_WIDTH . "';\n\t\twindow.ATTRIBUTE_SCROLLER_THUMB_HEIGHT = '" . ATTRIBUTE_SCROLLER_THUMB_HEIGHT . "';\n\t\twindow.PRODUCT_DETAIL_IS_LIGHTBOX = '" . PRODUCT_DETAIL_IS_LIGHTBOX . "';\n\t\twindow.REQUIRED_VAT_NUMBER = '" . REQUIRED_VAT_NUMBER . "';\n\t\twindow.COM_REDSHOP_PLEASE_ENTER_COMPANY_NAME = '" . JText::_('COM_REDSHOP_PLEASE_ENTER_COMPANY_NAME', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_FIRSTNAME = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_FIRSTNAME', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_LASTNAME = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_LASTNAME', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_ADDRESS = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_ADDRESS', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_ZIP = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_ZIP', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_CITY = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_CITY', true) . "';\n\t\twindow.COM_REDSHOP_YOUR_MUST_PROVIDE_A_PHONE = '" . JText::_('COM_REDSHOP_YOUR_MUST_PROVIDE_A_PHONE', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_REQUIRED = '" . JText::_('COM_REDSHOP_THIS_FIELD_REQUIRED', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_REMOTE = '" . JText::_('COM_REDSHOP_THIS_FIELD_REMOTE', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_URL= '" . JText::_('COM_REDSHOP_THIS_FIELD_URL', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_DATE= '" . JText::_('COM_REDSHOP_THIS_FIELD_DATE', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_DATEISO= '" . JText::_('COM_REDSHOP_THIS_FIELD_DATEISO', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_NUMBER= '" . JText::_('COM_REDSHOP_THIS_FIELD_NUMBER', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_DIGITS= '" . JText::_('COM_REDSHOP_THIS_FIELD_DIGITS', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_CREDITCARD= '" . JText::_('COM_REDSHOP_THIS_FIELD_CREDITCARD', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_EQUALTO= '" . JText::_('COM_REDSHOP_THIS_FIELD_EQUALTO', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_ACCEPT= '" . JText::_('COM_REDSHOP_THIS_FIELD_ACCEPT', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_MAXLENGTH= '" . JText::_('COM_REDSHOP_THIS_FIELD_MAXLENGTH', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_MINLENGTH= '" . JText::_('COM_REDSHOP_THIS_FIELD_MINLENGTH', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_RANGELENGTH= '" . JText::_('COM_REDSHOP_THIS_FIELD_RANGELENGTH', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_RANGE= '" . JText::_('COM_REDSHOP_THIS_FIELD_RANGE', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_MAX= '" . JText::_('COM_REDSHOP_THIS_FIELD_MAX', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_MIN= '" . JText::_('COM_REDSHOP_THIS_FIELD_MIN', true) . "';\n\t\twindow.COM_REDSHOP_YOU_MUST_PROVIDE_LOGIN_NAME = '" . JText::_('COM_REDSHOP_YOU_MUST_PROVIDE_LOGIN_NAME', true) . "';\n\t\twindow.COM_REDSHOP_PROVIDE_EMAIL_ADDRESS = '" . JText::_('COM_REDSHOP_PROVIDE_EMAIL_ADDRESS', true) . "';\n\t\twindow.COM_REDSHOP_EMAIL_NOT_MATCH = '" . JText::_('COM_REDSHOP_EMAIL_NOT_MATCH', true) . "';\n\t\twindow.COM_REDSHOP_PASSWORD_NOT_MATCH = '" . JText::_('COM_REDSHOP_PASSWORD_NOT_MATCH', true) . "';\n\t\twindow.NOOF_SUBATTRIB_THUMB_FOR_SCROLLER = '" . NOOF_SUBATTRIB_THUMB_FOR_SCROLLER . "';\n\t\twindow.COM_REDSHOP_NOT_AVAILABLE = '" . JText::_('COM_REDSHOP_NOT_AVAILABLE', true) . "';\n\t\twindow.COM_REDSHOP_PLEASE_INSERT_HEIGHT = '" . JText::_('COM_REDSHOP_PLEASE_INSERT_HEIGHT', true) . "';\n\t\twindow.COM_REDSHOP_PLEASE_INSERT_WIDTH = '" . JText::_('COM_REDSHOP_PLEASE_INSERT_WIDTH', true) . "';\n\t\twindow.COM_REDSHOP_PLEASE_INSERT_DEPTH = '" . JText::_('COM_REDSHOP_PLEASE_INSERT_DEPTH', true) . "';\n\t\twindow.COM_REDSHOP_PLEASE_INSERT_RADIUS = '" . JText::_('COM_REDSHOP_PLEASE_INSERT_RADIUS', true) . "';\n\t\twindow.COM_REDSHOP_PLEASE_INSERT_UNIT = '" . JText::_('COM_REDSHOP_PLEASE_INSERT_UNIT', true) . "';\n\t\twindow.COM_REDSHOP_THIS_FIELD_IS_REQUIRED = '" . JText::_('COM_REDSHOP_THIS_FIELD_IS_REQUIRED', true) . "';\n\t\twindow.COM_REDSHOP_SELECT_SUBSCRIPTION_PLAN = '" . JText::_('COM_REDSHOP_SELECT_SUBSCRIPTION_PLAN', true) . "';\n\t    window.COM_REDSHOP_USERNAME_MIN_CHARACTER_LIMIT = '" . JText::_('COM_REDSHOP_USERNAME_MIN_CHARACTER_LIMIT', true) . "';\n\t\twindow.CREATE_ACCOUNT_CHECKBOX = '" . CREATE_ACCOUNT_CHECKBOX . "';\n\t\twindow.USE_TAX_EXEMPT = '" . USE_TAX_EXEMPT . "';\n\t\twindow.SHOW_EMAIL_VERIFICATION = '" . SHOW_EMAIL_VERIFICATION . "';\n\t\twindow.SHOW_QUOTATION_PRICE = '" . SHOW_QUOTATION_PRICE . "';\n\t\twindow.AJAX_DETAIL_BOX_WIDTH = '" . AJAX_DETAIL_BOX_WIDTH . "';\n\t\twindow.AJAX_DETAIL_BOX_HEIGHT = '" . AJAX_DETAIL_BOX_HEIGHT . "';\n\t\twindow.AJAX_BOX_WIDTH = '" . AJAX_BOX_WIDTH . "';\n\t\twindow.AJAX_BOX_HEIGHT = '" . AJAX_BOX_HEIGHT . "';\n\t\twindow.COM_REDSHOP_EAN_MIN_CHARACTER_LIMIT = '" . JText::_('COM_REDSHOP_EAN_MIN_CHARACTER_LIMIT', true) . "';\n\t";
$doc->addScriptDeclaration($script);
if ($view == 'product') {
    if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . 'slimbox/' . PRODUCT_DETAIL_LIGHTBOX_CLOSE_BUTTON_IMAGE)) {
Esempio n. 2
0
$helper = new redhelper();
// Include redCRM if required
$helper->isredCRM();
$print = JRequest::getCmd('print');
// Adding Redshop CSS
$doc = JFactory::getDocument();
// Use diffrent CSS for print layout
if (!$print) {
    JHTML::Stylesheet('redshop.css', 'components/com_redshop/assets/css/');
} else {
    JHTML::Stylesheet('print.css', 'components/com_redshop/assets/css/');
}
JHTML::Stylesheet('style.css', 'components/com_redshop/assets/css/');
$Itemid = $helper->getCheckoutItemid();
$Itemid = JRequest::getInt('Itemid', $Itemid);
$Itemid = $helper->getCartItemid();
// Include redshop js file.
require_once JPATH_COMPONENT . '/helpers/redshop.js.php';
$controller = JRequest::getCmd('view', 'category');
$task = JRequest::getCmd('task');
$format = JRequest::getWord('format', '');
$layout = JRequest::getWord('layout', '');
$params = $app->getParams('com_redshop');
// Add product in cart from db
$helper->dbtocart();
$categoryid = JRequest::getInt('cid', $params->get('categoryid'));
$productid = JRequest::getInt('pid', 0);
$sgportal = $helper->getShopperGroupPortal();
$portal = 0;
if (count($sgportal) > 0) {
    $portal = $sgportal->shopper_group_portal;
Esempio n. 3
0
 /**
  * Method to delete cart entry from session
  *
  * @return void
  */
 public function delete()
 {
     $option = JRequest::getVar('option');
     $post = JRequest::get('post');
     $cartElement = $post['cart_index'];
     $Itemid = JRequest::getVar('Itemid');
     $redhelper = new redhelper();
     $Itemid = $redhelper->getCartItemid();
     $model = $this->getModel('cart');
     $model->delete($cartElement);
     $this->_carthelper->cartFinalCalculation();
     $this->_carthelper->carttodb();
     $link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);
     $this->setRedirect($link);
 }
Esempio n. 4
0
<?php

/**
 * @package     RedSHOP.Frontend
 * @subpackage  mod_redshop_cart
 *
 * @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('Restricted access');
$producthelper = new producthelper();
$redhelper = new redhelper();
$uri = JURI::getInstance();
$url = $uri->root(true);
$app = JFactory::getApplication();
$itemId = (int) $redhelper->getCartItemid();
$getNewItemId = true;
if ($itemId != 0) {
    $menu = $app->getMenu();
    $item = $menu->getItem($itemId);
    $getNewItemId = false;
    if (isset($item->id) === false) {
        $getNewItemId = true;
    }
}
if ($getNewItemId) {
    $itemId = (int) $redhelper->getCategoryItemid();
}
$display_button = JText::_('COM_REDSHOP_CHECKOUT');
if ($button_text != "") {
    $display_button = $button_text;