protected function getInput() { if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } if (!function_exists('hikashop_config') && !(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) { return 'This menu options cannot be displayed without the Hikashop Component'; } $id = JRequest::getInt('id'); if (HIKASHOP_J30) { $empty = ''; jimport('joomla.html.parameter'); $params = new HikaParameter($empty); $js = ''; $params->set('id', $this->id); $params->set('name', $this->name); $params->set('value', $this->value); $params->set('type', $this->getAttribute('content')); $params->set('menu', $this->getAttribute('menu')); $content = hikashop_getLayout('menus', 'options', $params, $js); $text = '</div></div>' . $content . '<div><div>'; } elseif (!empty($id)) { $config =& hikashop_config(); if (!hikashop_isAllowed($config->get('acl_menus_manage', 'all'))) { return 'Access to the HikaShop options of the menus is restricted'; } $text = '<a title="' . JText::_('HIKASHOP_OPTIONS') . '" href="' . JRoute::_('index.php?option=com_hikashop&ctrl=menus&fromjoomla=1&task=edit&cid[]=' . $id) . '" >' . JText::_('HIKASHOP_OPTIONS') . '</a>'; } else { $text = JText::_('HIKASHOP_OPTIONS_EDIT'); } return $text; }
protected function getInput() { if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } if (!function_exists('hikashop_config') && !(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) { return 'This module can not work without the Hikashop Component'; } $config =& hikashop_config(); $id = JRequest::getInt('id'); if (HIKASHOP_J30 && !in_array(@$_REQUEST['option'], array('com_falang', 'com_joomfish'))) { if (preg_match('/hikashopmodule/', $this->name)) { $associated = false; $cid = JRequest::getVar('id', ''); if (empty($cid)) { $cid = hikashop_getCID(); } foreach ($config->values as $name => $values) { if (preg_match('#menu_[0-9]#', $name)) { $params = unserialize(base64_decode($values->config_value)); $modules = array(); if (isset($params['modules'])) { $modules = explode(',', $params['modules']); } if (in_array($cid, $modules)) { $associated = str_replace('menu_', '', $values->config_namekey); break; } } } if ($associated) { $app = JFactory::getApplication(); $app->enqueueMessage(JText::sprintf('USE_MENU_SETTINGS_INSTEAD_OF_ASSOCIATED_ONES', JRoute::_('index.php?option=com_menus&view=item&layout=edit&id=' . $associated))); } $layout = 'modules'; } else { $layout = 'cartmodules'; } $empty = ''; jimport('joomla.html.parameter'); $params = new HikaParameter($empty); $js = ''; $params->set('id', $this->id); $params->set('name', $this->name); $params->set('value', $this->value); $content = hikashop_getLayout($layout, 'options', $params, $js, true); $text = '</div></div>' . $content . '<div><div>'; } elseif (!empty($id)) { if (!hikashop_isAllowed($config->get('acl_modules_manage', 'all'))) { return 'Access to the HikaShop options of the modules is restricted'; } $text = '<a style="float:left;" title="' . JText::_('HIKASHOP_OPTIONS') . '" href="' . JRoute::_('index.php?option=com_hikashop&ctrl=modules&fromjoomla=1&task=edit&cid[]=' . $id) . '" >' . JText::_('HIKASHOP_OPTIONS') . '</a>'; } else { $text = JText::_('HIKASHOP_OPTIONS_EDIT'); } return $text; }
function showoptions() { $js = ''; jimport('joomla.html.parameter'); $params = new hikaParameter(); $params->set('id', JRequest::getVar('id', 'product')); $params->set('name', JRequest::getVar('id', 'product')); $value = unserialize(JRequest::getVar('value')); $value['content_type'] = JRequest::getVar('content_type', 'product'); $params->set('value', $value); echo hikashop_getLayout('modules', 'options', $params, $js); }
function display($cachable = false, $urlparams = array()) { $cart_type = JRequest::getString('cart_type', 'cart'); $empty = ''; jimport('joomla.html.parameter'); $params = new HikaParameter($empty); $js = ''; $params->set('cart_type', $cart_type); $html = trim(hikashop_getLayout('product', 'cart', $params, $js)); if (!empty($html)) { JRequest::setVar('savecart', '1'); echo '<div class="hikashop_cart_display" id="hikashop_cart_display">' . $html . '</div>'; } }
function show() { $data_id = JRequest::getVar('data_id', 0, 'default', 'int'); $data_type = JRequest::getVar('main_ctrl', 'product', 'default', 'string', 0); $empty = $js = ''; jimport('joomla.html.parameter'); $params = new HikaParameter($empty); $params->set('vote_ref_id', $data_id); $params->set('main_ctrl', $data_type); $params->set('vote_type', $data_type); ob_get_clean(); echo hikashop_getLayout('vote', 'listing', $params, $js); exit; }
?> </div> <div id="hikashop_checkout_<?php echo $this->type; ?> _address_zone"> <?php if (empty($this->addresses)) { $js = ''; $params = new stdClass(); $params->type = $this->type; $params->address_id = 0; //(int)$address->address_id; $params->edit = true; $params->fieldset_id = 'hikashop_checkout_' . $this->type . '_address_zone'; echo hikashop_getLayout('address', 'show', $params, $js); } ?> </div> <?php static $hikashop_address_select_once = false; if (!$hikashop_address_select_once) { $hikashop_address_select_once = true; ?> <script type="text/javascript"> if(!window.localPage) window.localPage = {}; window.localPage.switchAddr = function(el, type) { var d = document, w = window, o = w.Oby, target = d.getElementById('hikashop_checkout_selected_' + type + '_address'); if(el === 0 || el.value == '0') { if(target)
public function upload() { JRequest::checkToken() || die('Invalid Token'); $this->initController(); $config = hikashop_config(); $upload_key = JRequest::getVar('field', ''); if (empty($this->base_controller)) { exit; } $uploadConfig = $this->base_controller->getUploadSetting($upload_key, 'upload'); if ($uploadConfig === false) { header('HTTP/1.1 403 Forbidden'); exit; } $layout = 'upload'; if (!empty($uploadConfig['layout'])) { $layout = $uploadConfig['layout']; } $viewName = ''; if (!empty($uploadConfig['view'])) { $viewName = $uploadConfig['view']; } $type = 'image'; if (!empty($uploadConfig['type'])) { $type = $uploadConfig['type']; } $options = array(); if (!empty($uploadConfig['options'])) { $options = $uploadConfig['options']; } $extra_data = array(); if (!empty($uploadConfig['extra'])) { $extra_data = $uploadConfig['extra']; } if (empty($extra_data['field'])) { $extra_data['field'] = $upload_key; } if (empty($viewName)) { $viewName = $type == 'image' ? 'image_entry' : 'file_entry'; } $this->processUploadOption($options, $type); if (empty($options) || empty($options['upload_dir'])) { return false; } $max_width = (int) $config->get('max_image_size_width', 0); $max_height = (int) $config->get('max_image_size_height', 0); $uploadHelper = hikashop_get('helper.upload'); $ret = $uploadHelper->process($options); if ($ret !== false && empty($ret->error) && empty($ret->partial)) { $helperImage = null; if ($type == 'image') { $helperImage = hikashop_get('helper.image'); } $file = new stdClass(); $file->file_description = ''; $file->file_name = $ret->name; $file->file_type = $type; $file->file_path = $options['sub_folder'] . $r->name; $file->file_url = $options['upload_url'] . $options['sub_folder']; foreach ($extra_data as $k => $v) { $file->{$k} = $v; } if (strpos($file->file_name, '.') !== false) { $file->file_name = substr($file->file_name, 0, strrpos($file->file_name, '.')); } $ret->file = $file; $ret->html = ''; $js = ''; if ($type == 'image') { if ($max_height > 0 || $max_width > 0) { } $img = $helperImage->getThumbnail($file->file_path, array(100, 100), array('default' => true)); $ret->thumbnail_url = $img->url; $params = new stdClass(); $params->file_path = $file->file_path; $params->file_name = $file->file_name; $params->file_url = $file->file_url; } else { $params = new stdClass(); $params->file_name = $file->file_name; $params->file_path = $file->file_path; $params->file_url = $file->file_url; $params->file_limit = -1; $params->file_size = @filesize($options['upload_dir'] . $options['sub_folder'] . $file->file_name); } foreach ($extra_data as $k => $v) { $params->{$k} = $v; } $ret->params = $params; $this->base_controller->manageUpload($upload_key, $ret, $uploadConfig, 'upload'); if (empty($r->html)) { $ret->html = hikashop_getLayout($layout, $viewName, $ret->params, $js); } } unset($ret->path); unset($ret->params); echo json_encode($ret); exit; }
static function store($config, $item) { $html = '<div class="nspHikashopBlock">'; // $currencyHelper = hikashop_get('class.currency'); $mainCurr = $currencyHelper->mainCurrency(); $app = JFactory::getApplication(); $currCurrency = $app->getUserState(HIKASHOP_COMPONENT . '.currency_id', $mainCurr); $msrpCurrencied = $currencyHelper->convertUniquePrice($item['product_msrp'], $mainCurr, $currCurrency); if ($msrpCurrencied == $item['product_msrp']) { $html .= '<span>' . $currencyHelper->format($item['product_msrp'], $mainCurr) . '</span>'; } else { $html .= '<span>' . $currencyHelper->format($msrpCurrencied, $currCurrency) . ' (' . $currencyHelper->format($item['product_msrp'], $mainCurr) . ')' . '</span>'; } if ($config['hikashop_add_to_cart'] > 0) { if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php'; JHTML::_('behavior.framework'); $hs_config = hikashop_config(); $productClass = hikashop_get('class.product'); $_SESSION['hikashop_product'] = $productClass->get($item['id']); $params = new JRegistry(''); // enable quantity field if ($config['hikashop_add_to_cart'] == 2) { $params->set('show_quantity_field', 1); } else { $params->set('show_quantity_field', 0); } $params->set('price_with_tax', $hs_config->get('price_with_tax', 1)); $params->set('add_to_cart', 1); $js = ''; $html .= hikashop_getLayout('product', 'add_to_cart_listing', $params, $js); } $html .= '</div>'; return $html; }
*/ defined('_JEXEC') or die('Restricted access'); hikashop_loadJslib('jquery'); $js = ''; $params = null; $this->params->set('vote_type', 'product'); if (isset($this->element->main)) { $product_id = $this->element->main->product_id; } else { $product_id = $this->element->product_id; } $this->params->set('vote_ref_id', $product_id); $this->params->set('productlayout', 'show_tabular'); $layout_vote_mini = hikashop_getLayout('vote', 'mini', $this->params, $js); $layout_vote_listing = hikashop_getLayout('vote', 'listing', $this->params, $js); $layout_vote_form = hikashop_getLayout('vote', 'form', $this->params, $js); $config =& hikashop_config(); $status_vote = $config->get('enable_status_vote'); $hide_specs = 1; if ($this->element->product_manufacturer_id != 0 || $this->element->product_weight != 0 || $this->element->product_width != 0 || $this->element->product_height != 0 || $this->element->product_length != 0 || @$this->element->main->product_weight != 0 || @$this->element->main->product_width != 0 || @$this->element->main->product_height != 0 || @$this->element->main->product_length != 0) { $hide_specs = 0; } foreach ($this->fields as $fieldName => $oneExtraField) { $value = ''; if (empty($this->element->{$fieldName}) && !empty($this->element->main->{$fieldName})) { $this->element->{$fieldName} = $this->element->main->{$fieldName}; } if (isset($this->element->{$fieldName})) { $value = trim($this->element->{$fieldName}); } if (!empty($value)) {
?> "> <fieldset class="input"> <h2 id="hika_registration_type"><?php if ($this->registration[2] && $registration_count == 1) { echo JText::_('GUEST'); } else { echo JText::_('HIKA_REGISTRATION'); } ?> </h2> <?php $usersConfig = JComponentHelper::getParams('com_users'); $allowRegistration = $usersConfig->get('allowUserRegistration'); if ($allowRegistration || $this->registration[2]) { echo hikashop_getLayout('user', 'registration', $params, $js); } else { echo JText::_('REGISTRATION_NOT_ALLOWED'); } ?> </fieldset> </div> <?php if ($display_login) { ?> <div id="hikashop_checkout_login_form" class=" <?php echo $classLogin; ?> "> <fieldset class="input"> <h2><?php
function form() { $dashboard = false; $config =& hikashop_config(); $widget_id = hikashop_getCID('widget_id'); $class = hikashop_get('class.widget'); $db = JFactory::getDBO(); if (!empty($widget_id)) { $element = $class->get($widget_id); $task = 'edit'; } else { $element = new stdClass(); $element->widget_published = 1; $task = 'add'; $element->widget_params = new stdClass(); $element->widget_params->display = 'line'; $element->widget_params->content = 'sales'; $element->widget_params->date_group = '%j %Y'; $element->widget_params->date_type = 'created'; $element->widget_params->periodType = 'proposedPeriod'; $element->widget_params->proposedPeriod = 'thisMonth'; $element->widget_params->format = 'UTF-8'; $element->widget_params->period_compare = 'none'; $element->widget_name = 'New report ' . $widget_id; $element->widget_params->limit = '7'; } $class->loadDatas($element); if (isset($element->widget_params->table)) { $row_id = count($element->widget_params->table); $this->assignRef('row_id', $row_id); foreach ($element->widget_params->table as $row) { $class->loadDatas($row); } } else { $row_id = 0; $this->assignRef('row_id', $row_id); } if ($element->widget_params->display != 'table') { if ($element->widget_params->display != 'listing' && ($element->widget_params->content == 'products' || $element->widget_params->content == 'categories' || $element->widget_params->content == 'discount')) { $element->widget_params->content = 'orders'; } } hikashop_setTitle(JText::_($this->nameForm), $this->icon, $this->ctrl . '&task=' . $task . '&widget_id=' . $widget_id); $this->toolbar = array(array('name' => 'link', 'icon' => 'archive', 'alt' => JText::_('HIKA_EXPORT'), 'url' => hikashop_completeLink('report&task=csv&cid[]=' . $widget_id) . '&' . hikashop_getFormToken() . '=1', 'display' => hikashop_level(2) && !empty($widget_id) && hikashop_isAllowed($config->get('acl_report_view', 'all'))), '|', array('name' => 'save', 'display' => hikashop_isAllowed($config->get('acl_report_manage', 'all'))), array('name' => 'save2new', 'display' => version_compare(JVERSION, '1.7', '>=') && hikashop_isAllowed($config->get('acl_report_manage', 'all'))), array('name' => 'apply', 'display' => hikashop_isAllowed($config->get('acl_report_manage', 'all'))), 'cancel', '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-form')); $this->assignRef('element', $element); $translation = false; $transHelper = hikashop_get('helper.translation'); if ($transHelper && $transHelper->isMulti()) { $translation = true; $transHelper->load('hikashop_widget', @$element->widget_id, $element); $config =& hikashop_config(); $multilang_display = $config->get('multilang_display', 'tabs'); if ($multilang_display == 'popups') { $multilang_display = 'tabs'; } $tabs = hikashop_get('helper.tabs'); $this->assignRef('tabs', $tabs); $this->assignRef('transHelper', $transHelper); } $toggle = hikashop_get('helper.toggle'); $this->assignRef('toggle', $toggle); $this->assignRef('translation', $translation); $currencyClass = hikashop_get('class.currency'); $this->assignRef('currencyHelper', $currencyClass); $periodType = hikashop_get('type.period'); $this->assignRef('periodType', $periodType); $widget_dataType = hikashop_get('type.widget_data'); $this->assignRef('widget_dataType', $widget_dataType); $status = hikashop_get('type.categorysub'); $status->type = 'status'; $this->assignRef('status', $status); $delay = hikashop_get('type.delay'); $this->assignRef('delay', $delay); $region = hikashop_get('type.region'); $this->assignRef('region', $region); if (hikashop_level(2)) { $encoding = hikashop_get('type.charset'); $this->assignRef('encoding', $encoding); } $widgetClass = hikashop_get('class.widget'); $this->assignRef('widgetClass', $widgetClass); $dateGroup = hikashop_get('type.dategroup'); $this->assignRef('dateGroup', $dateGroup); $dateType = hikashop_get('type.datetype'); $this->assignRef('dateType', $dateType); $shippingMethods = hikashop_get('type.plugins'); $shippingMethods->type = 'shipping'; $shippingMethods->manualOnly = true; $this->assignRef('shippingMethods', $shippingMethods); $paymentMethods = hikashop_get('type.plugins'); $paymentMethods->type = 'payment'; $paymentMethods->manualOnly = true; $this->assignRef('paymentMethods', $paymentMethods); $dashboard = JRequest::getVar('dashboard'); $this->assignRef('dashboard', $dashboard); $nameboxType = hikashop_get('type.namebox'); $this->assignRef('nameboxType', $nameboxType); JHTML::_('behavior.modal'); $script = "\r\n\tfunction deleteRow(divName,inputName,rowName){\r\n\t\tvar d = document.getElementById(divName);\r\n\t\tvar olddiv = document.getElementById(inputName);\r\n\t\tif(d && olddiv){\r\n\t\t\td.removeChild(olddiv);\r\n\t\t\tdocument.getElementById(rowName).style.display='none';\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction updatePeriodSelection(){\r\n\t\tselectedPeriod = document.getElementById('display_proposed_period').checked;\r\n\t\tdocument.getElementById('period_start').disabled=false;\r\n\t\tdocument.getElementById('period_end').disabled=false;\r\n\t\tdocument.getElementById('delayvalue1').disabled=false;\r\n\t\tdocument.getElementById('delaytype1').disabled=false;\r\n\t\tdocument.getElementById('datawidgetwidget_paramsproposedPeriod').disabled=false;\r\n\t\tif(selectedPeriod==true){\r\n\t\t\tdocument.getElementById('period_start').disabled=true;\r\n\t\t\tdocument.getElementById('period_end').disabled=true;\r\n\t\t\tdocument.getElementById('delayvalue1').disabled=true;\r\n\t\t\tdocument.getElementById('delaytype1').disabled=true;\r\n\t\t}else{\r\n\t\t\tdocument.getElementById('datawidgetwidget_paramsproposedPeriod').disabled=true;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateCompare(){\r\n\t\tselectedCompare = document.getElementById('compare_with_values').checked;\r\n\t\tdocument.getElementById('compares_order_status').disabled=false;\r\n\t\tdocument.getElementById('compares_order_currency_id').disabled=false;\r\n\t\tdocument.getElementById('compares_order_payment_method').disabled=false;\r\n\t\tdocument.getElementById('compares_order_shipping_method').disabled=false;\r\n\t\tdocument.getElementById('compares_order_discount_code').disabled=false;\r\n\t\tdocument.getElementById('compares_products').disabled=false;\r\n\t\tdocument.getElementById('compares_categories').disabled=false;\r\n\t\tdocument.getElementById('compare_period').disabled=false;\r\n\t\tif(selectedCompare==true){\r\n\t\t\tdocument.getElementById('compare_period').disabled=true;\r\n\t\t}else{\r\n\t\t\tdocument.getElementById('compares_order_status').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_currency_id').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_payment_method').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_shipping_method').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_discount_code').disabled=true;\r\n\t\t\tdocument.getElementById('compares_products').disabled=true;\r\n\t\t\tdocument.getElementById('compares_categories').disabled=true;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateDisplayType(){\r\n\t\ttheType=false;\r\n\t\tvalues = new Array('gauge', 'column', 'graph', 'line', 'pie', 'area', 'map', 'listing', 'table');\r\n\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\tnewType = document.getElementById('widget_display_'+values[i]).checked;\r\n\t\t\tif(newType==true){\r\n\t\t\t\tdisplayType = document.getElementById('widget_display_'+values[i]).value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='pie'){\r\n\t\t\tvalues = new Array('orders', 'sales', 'taxes', 'partners', 'customers');\r\n\t\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\t\tif(newType==true){\r\n\t\t\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(theType=='customers' || theType=='partners'){\r\n\t\t\t\t document.getElementById('type_orders').checked=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='map'){\r\n\t\t\tvalues = new Array('orders', 'sales', 'taxes', 'partners', 'customers');\r\n\t\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\t\tif(newType==true){\r\n\t\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tdocument.getElementById('map_options').style.display='none';\r\n\t\t\tdocument.getElementById('filters').style.display='';\r\n\t\t\tif(theType=='orders' || theType=='sales' || theType=='taxes'){\r\n\t\t\t\tdocument.getElementById('map_options').style.display='';\r\n\t\t\t}\r\n\t\t\tif(theType=='customers' || theType=='partners'){\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='gauge' || displayType=='line' || displayType=='area' || displayType=='graph' || displayType=='column'){\r\n\t\t\tvalues = new Array('orders', 'sales', 'taxes', 'partners', 'customers');\r\n\t\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\t\tif(newType==true){\r\n\t\t\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(theType==false){\r\n\t\t\t\ttheType='orders';\r\n\t\t\t \ttheType = document.getElementById('type_orders').checked=true;\r\n\t\t\t}\r\n\t\t\tdocument.getElementById('widget_compare').style.display='';\r\n\t\t\tif(theType=='orders' || theType=='sales' || theType=='taxes'){\r\n\t\t\t\tdocument.getElementById('widget_compare').style.display='';\r\n\t\t\t}\r\n\t\t\tif(theType=='customers' || theType=='partners'){\r\n\t\t\t\tdocument.getElementById('widget_compare').style.display='none';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='table'){\r\n\t\t\tdocument.getElementById('products_options').style.display='none';\r\n\t\t\tdocument.getElementById('filters').style.display='none';\r\n\t\t\tdocument.getElementById('customers_options').style.display='none';\r\n\t\t\tdocument.getElementById('partners_options').style.display='none';\r\n\t\t\tdocument.getElementById('orders_options').style.display='none';\r\n\t\t\tdocument.getElementById('product_datas').style.display='none';\r\n\t\t\tdocument.getElementById('widget_compare').style.display='none';\r\n\t\t\tdocument.getElementById('widget_limit').style.display='none';\r\n\t\t\tdocument.getElementById('widget_region').style.display='none';\r\n\t\t\tdocument.getElementById('map_options').style.display='none';\r\n\t\t}\r\n\t\tif(displayType!='listing'){ return 0; }\r\n\r\n\t\tvalues = new Array('orders', 'products', 'customers', 'partners', 'categories', 'discounts');\r\n\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\tif(newType==true){\r\n\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(!theType){\r\n\t\t\tdocument.getElementById('type_orders').checked=true;\r\n\t\t\ttheType='orders';\r\n\t\t}\r\n\t\tdocument.getElementById('products_options').style.display='none';\r\n\t\tdocument.getElementById('filters').style.display='none';\r\n\t\tdocument.getElementById('customers_options').style.display='none';\r\n\t\tdocument.getElementById('partners_options').style.display='none';\r\n\t\tdocument.getElementById('orders_options').style.display='none';\r\n\t\tdocument.getElementById('product_datas').style.display='none';\r\n\r\n\t\tif(theType=='orders' || theType=='products' || theType=='categories' || theType=='discounts' || theType=='customers' || theType== 'partners'){\r\n\t\t\tdocument.getElementById('filters').style.display='';\r\n\t\t\tdocument.getElementById('product_datas').style.display='';\r\n\t\t\tif(theType=='categories'){\r\n\t\t\t\tdocument.getElementById('data_hits').style.display='none';\r\n\t\t\t\tclicksValue = document.getElementById('data_clicks').checked;\r\n\t\t\t\tif(clicksValue==true){\r\n\t\t\t\t\tdocument.getElementById('data_orders').checked=true;\r\n\t\t\t\t}\r\n\t\t\t}else if(theType=='products'){\r\n\t\t\t\tdocument.getElementById('data_hits').style.display='';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(theType=='discounts'){\r\n\t\t\tdocument.getElementById('product_datas').style.display='none';\r\n\t\t}\r\n\t\tif(theType=='products' || theType=='categories' || theType=='discounts'){\r\n\t\t\tdocument.getElementById('products_options').style.display='';\r\n\t\t}\r\n\t\tif(theType=='customers'){\r\n\t\t\tdocument.getElementById('customers_options').style.display='';\r\n\t\t}\r\n\t\tif(theType=='partners'){\r\n\t\t\tdocument.getElementById('partners_options').style.display='';\r\n\t\t}\r\n\t\tif(theType=='orders'){\r\n\t\t\tdocument.getElementById('orders_options').style.display='';\r\n\t\t}\r\n\r\n\t}\r\n\twindow.hikashop.ready( function(){ updateDisplayType(); });\r\n\twindow.hikashop.ready( function(){ updatePeriodSelection(); });\r\n\twindow.hikashop.ready( function(){ updateCompare(); });\r\n\r\n\t\t\t\t"; if (!HIKASHOP_PHP5) { $doc =& JFactory::getDocument(); } else { $doc = JFactory::getDocument(); } $doc->addScriptDeclaration($script); $js = ''; $params = $element; echo hikashop_getLayout('dashboard', 'widget', $params, $js); }
<?php } if (!empty($cid)) { ?> <div id="div_module_content" class="row-fluid"> <fieldset id="module_content" class="adminform"> <legend><?php echo JText::_('ASSOCIATED_MODULES'); ?> </legend> <?php foreach ($cid as $element) { echo "<fieldset id=\"module_content_" . $element->id . "\">"; echo '<legend>' . $element->title . '</legend>'; $js = ''; echo hikashop_getLayout('modules', 'form', $element->id, $js); echo "</fieldset>"; } ?> </fieldset> </div> <?php } ?> <div class="clr"></div> <input type="hidden" name="option" value="<?php echo HIKASHOP_COMPONENT; ?> " /> <input type="hidden" name="menu[id]" value="<?php
function displayAddress(&$fields, &$address, $view = 'address', $text = false) { $params = new HikaParameter(''); if (HIKASHOP_J25) { $params->set('address', $address); } $js = ''; $fieldsClass = hikashop_get('class.field'); $html = '' . hikashop_getLayout($view, 'address_template', $params, $js); if (!empty($fields)) { foreach ($fields as $field) { $fieldname = $field->field_namekey; if (!empty($address->{$fieldname})) { $html = str_replace('{' . $fieldname . '}', $fieldsClass->show($field, $address->{$fieldname}), $html); } } } $html = str_replace("\n\n", "\n", trim(str_replace("\r\n", "\n", trim(preg_replace('#{(?:(?!}).)*}#i', '', $html))), "\n")); if (!$text) { $html = str_replace("\n", "<br/>\n", $html); } return $html; }
</span> <div id="hikashop_product_vote_mini" class="hikashop_product_vote_mini"> <?php if ($this->params->get('show_vote_product') == '-1') { $this->params->set('show_vote_product', $config->get('show_vote_product')); } if ($this->params->get('show_vote_product')) { $js = ''; $this->params->set('vote_type', 'product'); if (isset($this->element->main)) { $product_id = $this->element->main->product_id; } else { $product_id = $this->element->product_id; } $this->params->set('vote_ref_id', $product_id); echo hikashop_getLayout('vote', 'mini', $this->params, $js); } ?> </div> <?php if (!empty($this->element->extraData->rightMiddle)) { echo implode("\r\n", $this->element->extraData->rightMiddle); } ?> <?php $this->setLayout('show_block_dimensions'); echo $this->loadTemplate(); ?> </span><br /> <?php if ($this->params->get('characteristic_display') != 'list') {
public function updatecart() { hikashop_nocache(); $app = JFactory::getApplication(); $product_id = (int) JRequest::getCmd('product_id', 0); $module_id = (int) JRequest::getCmd('module_id', 0); $cart_type = JRequest::getString('hikashop_cart_type_' . $product_id . '_' . $module_id, 'null'); if ($cart_type == 'null') { $cart_type = JRequest::getString('hikashop_cart_type_' . $module_id, 'null'); } if ($cart_type == 'null') { $cart_type = JRequest::getString('cart_type', 'cart'); } $cart_type_id = $cart_type . '_id'; $class = hikashop_get('class.cart'); $class->cart_type = $cart_type; $cart_id = 0; if ($class->hasCart(JRequest::getInt('cart_id', 0, 'GET'))) { $cart_id = $class->cart->cart_id; } $addTo = JRequest::getString('add_to', ''); if ($addTo != '') { $from_id = $cart_id; if ($addTo == 'cart') { JRequest::setVar('from_id', $cart_id); } $cart_id = $app->getUserState(HIKASHOP_COMPONENT . '.' . $addTo . '_id', 0); $cart_type_id = $addTo . '_id'; JRequest::setVar('cart_type', $addTo); } else { JRequest::setVar('cart_type', $cart_type); } JRequest::setVar($cart_type_id, $cart_id); $char = JRequest::getString('characteristic', ''); if (!empty($char)) { return $this->show(); } $tmpl = JRequest::getCmd('tmpl', 'index'); $add = JRequest::getCmd('add', ''); if (!empty($add)) { $add = 1; } else { $add = 0; } if (empty($product_id)) { $product_id = JRequest::getCmd('cid', 0); } $cart_product_id = JRequest::getCmd('cart_product_id', 0); $quantity = JRequest::getInt('quantity', 1); if (hikashop_loadUser() != null || $cart_type != 'wishlist') { if (!empty($product_id)) { $type = JRequest::getWord('type', 'product'); if ($type == 'product') { $product_id = (int) $product_id; } $status = $class->update($product_id, $quantity, $add, $type); } elseif (!empty($cart_product_id)) { $status = $class->update($cart_product_id, $quantity, $add, 'item'); } else { $formData = JRequest::getVar('item', array(), '', 'array'); if (!empty($formData)) { $class->update($formData, 0, $add, 'item'); } else { $formData = JRequest::getVar('data', array(), '', 'array'); if (!empty($formData)) { $class->update($formData, 0, $add); } } } } $app->setUserState(HIKASHOP_COMPONENT . '.' . $cart_type . '_new', '1'); if (@$class->errors && $tmpl != 'component') { if (!empty($_SERVER['HTTP_REFERER'])) { if (strpos($_SERVER['HTTP_REFERER'], HIKASHOP_LIVE) === false && preg_match('#^https?://.*#', $_SERVER['HTTP_REFERER'])) { return false; } $app->redirect(str_replace('&popup=1', '', $_SERVER['HTTP_REFERER'])); } else { echo '<html><head><script type="text/javascript">history.back();</script></head><body></body></html>'; exit; } } $app->setUserState(HIKASHOP_COMPONENT . '.shipping_method', null); $app->setUserState(HIKASHOP_COMPONENT . '.shipping_id', null); $app->setUserState(HIKASHOP_COMPONENT . '.shipping_data', null); $app->setUserState(HIKASHOP_COMPONENT . '.payment_method', null); $app->setUserState(HIKASHOP_COMPONENT . '.payment_id', null); $app->setUserState(HIKASHOP_COMPONENT . '.payment_data', null); $config =& hikashop_config(); $checkout = JRequest::getString('checkout', ''); if (!empty($checkout)) { global $Itemid; $url = 'checkout'; if (!empty($Itemid)) { $url .= '&Itemid=' . $Itemid; } $url = hikashop_completeLink($url, false, true); $this->setRedirect($url); } else { if ($cart_type == 'wishlist') { $app->setUserState(HIKASHOP_COMPONENT . '.popup_cart_type', 'wishlist'); if (hikashop_loadUser() == null) { $url = JRequest::getVar('return_url', ''); if (!empty($url)) { $url = base64_decode(urldecode($url)); } $url = str_replace(array('&popup=1', '?popup=1'), '', $url); if ($config->get('redirect_url_after_add_cart', 'stay_if_cart') != 'ask_user') { $app->enqueueMessage(JText::_('LOGIN_REQUIRED_FOR_WISHLISTS')); } if ($tmpl != 'component') { if (!empty($_SERVER['HTTP_REFERER'])) { if (strpos($_SERVER['HTTP_REFERER'], HIKASHOP_LIVE) === false && preg_match('#^https?://.*#', $_SERVER['HTTP_REFERER'])) { return false; } if ($config->get('redirect_url_after_add_cart', 'stay_if_cart') == 'ask_user') { $app->enqueueMessage(JText::_('LOGIN_REQUIRED_FOR_WISHLISTS')); } $app->redirect(str_replace('&popup=1', '', $_SERVER['HTTP_REFERER'])); } } else { echo 'notLogged'; exit; } } else { $redirectConfig = $config->get('redirect_url_after_add_cart', 'stay_if_cart'); $url = ''; $stay = 0; switch ($redirectConfig) { case 'ask_user': $url = JRequest::getVar('return_url', ''); if (!empty($url)) { $url = base64_decode(urldecode($url)); } $url = str_replace(array('&popup=1', '?popup=1'), '', $url); if (JRequest::getInt('popup', 0) && empty($_COOKIE['popup']) || JRequest::getInt('quantity', 0)) { if (strpos($url, '?')) { $url .= '&'; } else { $url .= '?'; } $url .= 'popup=1'; $app->setUserState(HIKASHOP_COMPONENT . '.popup', '1'); } JRequest::setVar('cart_type', 'wishlist'); break; case 'stay': $stay = 1; break; //$stay = 1; && $url =''; //$stay = 1; && $url =''; case 'checkout': break; //$stay = 0; && $url =''; //$stay = 0; && $url =''; case 'stay_if_cart': default: $module = JModuleHelper::getModule('hikashop_wishlist', false); if ($module != null) { $stay = 1; } break; } if ($redirectConfig != 'checkout') { $module = JModuleHelper::getModule('hikashop_wishlist', false); $params = new HikaParameter(@$module->params); if (!empty($module)) { $module_options = $config->get('params_' . $module->id); } if (empty($module_options)) { $module_options = $config->get('default_params'); } $data = $params->get('hikashopwishlistmodule'); if (HIKASHOP_J30 && (empty($data) || !is_object($data))) { $db = JFactory::getDBO(); $query = 'SELECT params FROM ' . hikashop_table('modules', false) . ' WHERE id = ' . (int) $module->id; $db->setQuery($query); $itemData = json_decode($db->loadResult()); if (!empty($itemData->hikashopwishlistmodule) && is_object($itemData->hikashopwishlistmodule)) { $data = $itemData->hikashopwishlistmodule; $params->set('hikashopwishlistmodule', $data); } } if (!empty($data) && is_object($data)) { foreach ($data as $k => $v) { $module_options[$k] = $v; } } foreach ($module_options as $key => $optionElement) { $params->set($key, $optionElement); } if (!empty($module)) { foreach (get_object_vars($module) as $k => $v) { if (!is_object($v)) { $params->set($k, $v); } } $params->set('from', 'module'); } $params->set('return_url', $url); $params->set('cart_type', 'wishlist'); $js = ''; hikashop_getLayout('product', 'cart', $params, $js); } } if (empty($url)) { global $Itemid; if (isset($from_id)) { $cart_id = $from_id; } if (JRequest::getInt('new_' . $cart_type . '_id', 0) != 0 && JRequest::getInt('delete', 0) == 0) { $cart_id = JRequest::getInt('new_' . $cart_type . '_id', 0); } $cart = $class->get($cart_id, false, $cart_type); if (!empty($cart) && (int) $cart_id != 0) { $url = 'cart&task=showcart&cart_type=wishlist&cart_id=' . $cart_id . '&Itemid=' . $Itemid; } else { $url = 'cart&task=showcarts&cart_type=wishlist&Itemid=' . $Itemid; } $url = hikashop_completeLink($url, false, true); } if (!isset($stay)) { $stay = JRequest::getInt('stay', 0); } if ($stay == 0) { if (hikashop_disallowUrlRedirect($url)) { return false; } if (JRequest::getVar('from_form', true)) { JRequest::setVar('cart_type', 'wishlist'); $this->setRedirect($url); return false; } else { ob_clean(); echo 'URL|' . $url; exit; } } else { echo '<html><head><script type="text/javascript">history.back();</script></head><body></body></html>'; exit; } } else { $app->setUserState(HIKASHOP_COMPONENT . '.popup_cart_type', 'cart'); $url = JRequest::getVar('return_url', ''); if (empty($url)) { $url = JRequest::getVar('url', ''); $url = urldecode($url); } else { $url = base64_decode(urldecode($url)); } $url = str_replace(array('&popup=1', '?popup=1'), '', $url); if (hikashop_disallowUrlRedirect($url)) { $url = ''; } if (empty($url)) { global $Itemid; $url = 'checkout'; if (!empty($Itemid)) { $url .= '&Itemid=' . $Itemid; } $url = hikashop_completeLink($url, false, true); } $params = new HikaParameter(@$module->params); if ($tmpl == 'component' && $config->get('redirect_url_after_add_cart', 'stay_if_cart') != 'checkout') { $js = ''; jimport('joomla.application.module.helper'); global $Itemid; if (isset($Itemid) && empty($Itemid)) { $Itemid = null; JRequest::setVar('Itemid', null); } $module = JModuleHelper::getModule('hikashop_cart', false); $config =& hikashop_config(); $params = new HikaParameter(@$module->params); if (!empty($module)) { $module_options = $config->get('params_' . $module->id); } if (empty($module_options)) { $module_options = $config->get('default_params'); } $data = $params->get('hikashopcartmodule'); if (HIKASHOP_J30 && (empty($data) || !is_object($data))) { $db = JFactory::getDBO(); $query = 'SELECT params FROM ' . hikashop_table('modules', false) . ' WHERE id = ' . (int) $module->id; $db->setQuery($query); $itemData = json_decode($db->loadResult()); if (!empty($itemData->hikashopcartmodule) && is_object($itemData->hikashopcartmodule)) { $data = $itemData->hikashopcartmodule; $params->set('hikashopcartmodule', $data); } } if (!empty($data) && is_object($data)) { foreach ($data as $k => $v) { $module_options[$k] = $v; } } foreach ($module_options as $key => $optionElement) { $params->set($key, $optionElement); } if (!empty($module)) { foreach (get_object_vars($module) as $k => $v) { if (!is_object($v)) { $params->set($k, $v); } } $params->set('from', 'module'); } $params->set('return_url', $url); hikashop_getLayout('product', 'cart', $params, $js); return true; } else { $config =& hikashop_config(); $url = str_replace(array('&popup=1', '?popup=1'), '', $url); if (JRequest::getInt('popup', 0) || @JRequest::getInt('quantity', 0) && $config->get('redirect_url_after_add_cart', 'stay_if_cart') == 'ask_user') { if (strpos($url, '?')) { $url .= '&'; } else { $url .= '?'; } $url .= 'popup=1'; $app->setUserState(HIKASHOP_COMPONENT . '.popup', '1'); } if (JRequest::getInt('hikashop_ajax', 0) == 0) { // $config->get('ajax_add_to_cart','1') == '0'){ $this->setRedirect($url); return false; } else { ob_clean(); if ($params->get('from', 'module') != 'module' || $config->get('redirect_url_after_add_cart', 'stay_if_cart') == 'checkout') { echo 'URL|' . $url; exit; } else { $this->setRedirect($url); return false; } } } } } }
</tr> <tr> <td class="key"><?php echo JText::_('WATERMARK_ON_IMAGES'); ?> </td> <td><?php if (hikashop_level(2)) { $options = array('upload' => true, 'gallery' => true, 'text' => JText::_('HIKA_DEFAULT_IMAGE_EMPTY_UPLOAD'), 'uploader' => array('config', 'watermark')); $params = new stdClass(); $params->file_path = $this->config->get('watermark', ''); $params->delete = true; $params->uploader_id = 'hikashop_config_watermark_image'; $params->field_name = 'config[watermark]'; $js = ''; $content = hikashop_getLayout('upload', 'image_entry', $params, $js); if (!empty($params->empty)) { $options['empty'] = true; } echo $this->uploaderType->displayImageSingle('hikashop_config_watermark_image', $content, $options); } else { echo hikashop_getUpgradeLink('business'); } ?> </td> </tr> <tr> <td class="key"><?php echo JText::_('WATERMARK_OPACITY'); ?> </td>
function addimage() { $legacy = JRequest::getInt('legacy', 0); if ($legacy) { $element = JRequest::getInt('cid'); $rows = array(); if (!empty($element)) { $database = JFactory::getDBO(); $query = 'SELECT * FROM ' . hikashop_table('file') . ' WHERE file_id =' . $element; $database->setQuery($query); $rows = $database->loadObjectList(); if (!HIKASHOP_PHP5) { $document =& JFactory::getDocument(); } else { $document = JFactory::getDocument(); } $id = JRequest::getInt('id'); $js = "window.hikashop.ready( function() {\r\n\t\t\t\t\t\twindow.top.deleteRow('image_div_" . $rows[0]->file_id . '_' . $id . "','image[" . $rows[0]->file_id . "][" . $id . "]','image_" . $rows[0]->file_id . '_' . $id . "');\r\n\t\t\t\t\t\tvar dstTable = window.top.document.getElementById('image_listing');\r\n\t\t\t\t\t\tvar srcTable = document.getElementById('result');\r\n\t\t\t\t\t\tfor (var c = 0,m=srcTable.rows.length;c<m;c++){\r\n\t\t\t\t\t\t\tvar rowData = srcTable.rows[c].cloneNode(true);\r\n\t\t\t\t\t\t\tdstTable.appendChild(rowData);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\twindow.parent.hikashop.closeBox();\r\n\t\t\t\t\t\t},200);\r\n\t\t\t\t});"; $document->addScriptDeclaration($js); } $this->assignRef('rows', $rows); $image = hikashop_get('helper.image'); $this->assignRef('image', $image); $popup = hikashop_get('helper.popup'); $this->assignRef('popup', $popup); return true; } $files_id = JRequest::getVar('cid', array(), '', 'array'); $product_id = JRequest::getInt('product_id', 0); $output = '[]'; if (!empty($files_id)) { JArrayHelper::toInteger($files_id); $query = 'SELECT * FROM ' . hikashop_table('file') . ' WHERE file_id IN (' . implode(',', $files_id) . ')'; $db = JFactory::getDBO(); $db->setQuery($query); $files = $db->loadObjectList(); $helperImage = hikashop_get('helper.image'); $ret = array(); foreach ($files as $file) { $params = new stdClass(); $params->product_id = $product_id; $params->file_id = $file->file_id; $params->file_path = $file->file_path; $params->file_name = $file->file_name; $ret[] = hikashop_getLayout('product', 'form_image_entry', $params, $js); } if (!empty($ret)) { $output = json_encode($ret); } } $js = 'window.hikashop.ready(function(){window.top.hikashop.submitBox({images:' . $output . '});});'; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); return false; }
?> <td> <fieldset class="adminform" id="htmlfieldset_shipping"> <legend style="background-color: #FFFFFF;"><?php echo JText::_('HIKASHOP_SHIPPING_ADDRESS'); ?> </legend> <?php $override = false; if (method_exists($this->currentShipping, 'getShippingAddress')) { $override = $this->currentShipping->getShippingAddress($this->element->order_shipping_id); } if ($override !== false) { echo $override; } else { $html = hikashop_getLayout('address', 'address_template', $params, $js); if (!empty($this->element->fields)) { foreach ($this->element->fields as $field) { $fieldname = $field->field_namekey; $html = str_replace('{' . $fieldname . '}', $this->fieldsClass->show($field, $this->element->shipping_address->{$fieldname}), $html); } } echo str_replace("\n", "<br/>\n", str_replace("\n\n", "\n", preg_replace('#{(?:(?!}).)*}#i', '', $html))); } ?> </fieldset> </td><?php } ?> </tr> </table>
} $js = ''; $params->set('from_module', $module->id); hikashop_initModule(); $config =& hikashop_config(); $module_options = $config->get('params_' . $module->id); if (empty($module_options)) { $module_options = $config->get('default_params'); } $data = $params->get('hikashopcartmodule'); if (!empty($data) && is_object($data)) { foreach ($data as $k => $v) { $module_options[$k] = $v; } } if (is_array($module_options)) { foreach ($module_options as $key => $option) { if ($key != 'moduleclass_sfx') { $params->set($key, $option); } } } foreach (get_object_vars($module) as $k => $v) { if (!is_object($v) && $params->get($k, null) == null) { $params->set($k, $v); } } $params->set('cart_type', 'cart'); $params->set('from', 'module'); $html = trim(hikashop_getLayout('product', 'cart', $params, $js)); require JModuleHelper::getLayoutPath('mod_hikashop_cart');
if (!empty($data) && is_object($data)) { foreach ($data as $k => $v) { $module_options[$k] = $v; } } $type = $module_options['content_type']; if ($type == 'manufacturer') { $type = 'category'; } if (empty($module_options['itemid']) && $type == 'category' && !JRequest::getVar('hikashop_front_end_main')) { $module_options['content_synchronize'] = 0; $menu = hikashop_get('class.menus'); $menu->createMenu($module_options, $module->id); $configData = new stdClass(); $configData->{$key_name} = $module_options; $config->save($configData); } foreach ($module_options as $key => $option) { if ($key != 'moduleclass_sfx') { $params->set($key, $option); } } $moduleClass = hikashop_get('class.modules'); $moduleClass->loadParams($module); foreach (get_object_vars($module) as $k => $v) { if (!is_object($v) && $params->get($k, null) == null) { $params->set($k, $v); } } $html = trim(hikashop_getLayout($type, 'listing', $params, $js)); require JModuleHelper::getLayoutPath('mod_hikashop');
if (!empty($html)) { echo '<div class="hikashop_subcategories_listing">' . $html . '</div>'; } if (!$this->module) { $data = $this->params->get('data'); if (isset($data->hk_product) && is_object($data->hk_product)) { $js = ''; $empty = ''; jimport('joomla.html.parameter'); $params = new HikaParameter($empty); foreach ($data->hk_product as $k => $v) { $params->set($k, $v); } $main_div_name = 'hikashop_category_information_module_' . $params->get('id'); $params->set('main_div_name', $main_div_name); echo '<div class="hikashop_submodules" style="clear:both">' . hikashop_getLayout('product', 'listing', $params, $js) . '</div>'; } else { if (!empty($this->modules)) { $html = ''; jimport('joomla.application.module.helper'); foreach ($this->modules as $module) { $html .= JModuleHelper::renderModule($module); } if (!empty($html)) { echo '<div class="hikashop_submodules" style="clear:both">' . $html . '</div>'; } } } } $html = ob_get_clean(); if (!empty($html)) {
</td> </tr> <tr> <td> <table width="100%" style="border: 1px solid #DDDDDD;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;"> <?php $params = null; $js = ''; $fieldsClass = hikashop_get('class.field'); $app = JFactory::getApplication(); if ($app->isAdmin()) { $view = 'order'; } else { $view = 'address'; } $template = trim(hikashop_getLayout($view, 'address_template', $params, $js)); if (!empty($data->cart->billing_address)) { $billing = $template; foreach ($data->order_addresses_fields as $field) { $fieldname = $field->field_namekey; $address = $data->order_addresses[$data->cart->billing_address->address_id]; $billing = str_replace('{' . $fieldname . '}', $fieldsClass->show($field, $address->{$fieldname}), $billing); } echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">' . JText::_('HIKASHOP_BILLING_ADDRESS') . '</td></tr><tr><td>'; echo str_replace(array("\r\n", "\r", "\n"), '<br/>', preg_replace('#{(?:(?!}).)*}#i', '', $billing)) . '<br/></td></tr>'; } if (!empty($data->order_shipping_method)) { $currentShipping = hikashop_import('hikashopshipping', $data->order_shipping_method); if (method_exists($currentShipping, 'getShippingAddress')) { $override = $currentShipping->getShippingAddress($data->order_shipping_id); if ($override !== false) {
.hikashop_inserted_product .hikashop_product_stock { text-align: center; display:block; margin-bottom:5px; } .hikashop_inserted_product span.hikashop_add_to_cart{ text-align: center; display:block; margin-bottom:5px; } .hikashop_inserted_product .hikashop_product_quantity_field{ float: none !important; width: 25px !important; } </style> <span class="hikashop_add_to_cart"> <?php $params->set('price_with_tax', $config->get('price_with_tax', 1)); $params->set('add_to_cart', 1); $add_to_cart = hikashop_getLayout('product', 'add_to_cart_listing', $params, $js); echo $add_to_cart; ?> </span> <!-- EO ADD TO CART BUTTON AREA --><?php } if ($this->border == 1) { echo '</div>'; } echo '</div>'; } }
function displayButton($name, $map, &$params, $url = '', $ajax = "", $options = "", $max_quantity = 0, $min_quantity = 1, $classname = '', $inc = true) { $config =& hikashop_config(); $button = $config->get('button_style', 'normal'); static $i = 0; if ($inc) { $i++; } if (!empty($ajax)) { $ajax = 'onclick="var field=document.getElementById(\'hikashop_product_quantity_field_' . $i . '\');' . $ajax . '" '; } if (!empty($classname) && substr($classname, 0, 1) != ' ') { $classname = ' ' . $classname; } if ($this->override && function_exists('hikashop_button_render')) { $html = hikashop_button_render($map, $name, $ajax, $options, $url, $classname); } else { switch ($button) { case 'rounded': //deprecated $params->set('main_div_name', 'hikashop_button_' . $i); $moduleHelper = hikashop_get('helper.module'); $moduleHelper->setCSS($params); $url = 'href="' . $url . '" '; $html = ' <div id="' . $params->get('main_div_name') . '"> <div class="hikashop_container"> <div class="hikashop_subcontainer"> <a rel="nofollow" class="hikashop_cart_rounded_button' . $classname . '" ' . $url . $ajax . $options . '>' . $name . '</a> </div> </div> </div> '; break; case 'css': if (empty($url)) { $url = '#'; } $url = 'href="' . $url . '" '; $html = '<a rel="nofollow" class="hikashop_cart_button' . $classname . '" ' . $options . ' ' . $url . $ajax . '>' . $name . '</a>'; break; case 'normal': default: $type = 'submit'; if (in_array($map, array('new', 'refresh', 'wishlist'))) { $type = 'button'; } $app = JFactory::getApplication(); if ($app->isAdmin()) { $class = 'btn'; } else { $class = HK_GRID_BTN; } $html = '<input type="' . $type . '" class="' . $class . ' button hikashop_cart_input_button' . $classname . '" name="' . $map . '" value="' . $name . '" ' . $ajax . $options . '/>'; break; } } if ($map == 'add') { $show_quantity_field = $config->get('show_quantity_field', 0); if ($params->get('show_quantity_field', 0) == '-1') { $params->set('show_quantity_field', $show_quantity_field); } if ($params->get('show_quantity_field', 0) == 1) { $max_quantity = (int) $max_quantity; $min_quantity = (int) $min_quantity; static $first = false; if (!$first && $map == 'add') { $first = true; $js = ' function hikashopQuantityChange(field,plus,max,min){ var fieldEl=document.getElementById(field); var current = fieldEl.value; current = parseInt(current); if(plus){ if(max==0 || current<max){ fieldEl.value=parseInt(fieldEl.value)+1; }else if(max && current==max){ alert(\'' . JText::_('NOT_ENOUGH_STOCK', true) . '\'); } }else{ if(current>1 && current>min){ fieldEl.value=current-1; } } return false; } function hikashopCheckQuantityChange(field,max,min){ var fieldEl=document.getElementById(field); var current = fieldEl.value; current = parseInt(current); if(max && current>max){ fieldEl.value=max; alert(\'' . JText::_('NOT_ENOUGH_STOCK', true) . '\'); }else if(current<min){ fieldEl.value=min; } return false; } '; $setJS = $params->get('js'); if (!$setJS) { if (!HIKASHOP_PHP5) { $doc =& JFactory::getDocument(); } else { $doc = JFactory::getDocument(); } $doc->addScriptDeclaration("<!--\n" . $js . "\n//-->\n"); } else { echo '<script type="text/javascript">' . "<!--\n" . $js . "\n//-->\n" . '</script>'; } } if ($this->override && function_exists('hikashop_quantity_render')) { $html = hikashop_quantity_render($html, $i, $max_quantity, $min_quantity); } else { $js = ''; $params->set('i', $i); $params->set('min_quantity', $min_quantity); $params->set('max_quantity', $max_quantity); $params->set('html', $html); $html = hikashop_getLayout('product', 'show_quantity', $params, $js); } } elseif ($params->get('show_quantity_field', 0) == 0) { $html .= '<input id="hikashop_product_quantity_field_' . $i . '" type="hidden" value="' . $min_quantity . '" class="hikashop_product_quantity_field" name="quantity" />'; } elseif ($params->get('show_quantity_field', 0) == -1) { static $second = false; if (!$second) { $second = true; $js = ' function hikashopQuantityChange(field,plus,max,min){ var fieldEl=document.getElementById(field); var current = fieldEl.value; current = parseInt(current); if(plus){ if(max==0 || current<max){ fieldEl.value=parseInt(fieldEl.value)+1; }else if(max && current==max){ alert(\'' . JText::_('NOT_ENOUGH_STOCK', true) . '\'); } }else{ if(current>1 && current>min){ fieldEl.value=current-1; } } return false; } '; $setJS = $params->get('js'); if (!$setJS) { $doc = JFactory::getDocument(); $doc->addScriptDeclaration("\n<!--\n" . $js . "\n//-->\n"); } else { echo '<script type="text/javascript">' . "<!--\n" . $js . "\n//-->\n" . '</script>'; } } $html = '<input id="hikashop_product_quantity_field_' . $i . '" type="text" value="' . JRequest::getInt('quantity', $min_quantity) . '" class="hikashop_product_quantity_field" name="quantity" onchange="hikashopCheckQuantityChange(\'hikashop_product_quantity_field_' . $i . '\',' . $max_quantity . ',' . $min_quantity . ');" />' . $html; } elseif ($params->get('show_quantity_field', 0) == 2) { } } return $html; }
</table> </td> </tr> <tr> <td height="10"> </td> </tr> <tr> <td> <table width="100%" style="border: 1px solid #DDDDDD;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;"> <?php $params = null; $js = ''; $fieldsClass = hikashop_get('class.field'); $app = JFactory::getApplication(); $template = trim(hikashop_getLayout($app->isAdmin() ? 'order' : 'address', 'address_template', $params, $js)); if (!empty($data->cart->billing_address)) { $billing = $template; foreach ($data->cart->fields as $field) { $fieldname = $field->field_namekey; $billing = str_replace('{' . $fieldname . '}', $fieldsClass->show($field, $data->cart->billing_address->{$fieldname}), $billing); } echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">' . JText::_('HIKASHOP_BILLING_ADDRESS') . '</td></tr><tr><td>'; echo str_replace(array("\r\n", "\r", "\n"), '<br/>', preg_replace('#{(?:(?!}).)*}#i', '', $billing)) . '<br/></td></tr>'; } if (!empty($data->cart->order_shipping_id) && (!empty($data->cart->shipping_address) || !empty($data->cart->override_shipping_address))) { echo '<tr><td style="font-weight:bold;background-color:#DDDDDD">' . JText::_('HIKASHOP_SHIPPING_ADDRESS') . '</td></tr><tr><td>'; if (!empty($data->cart->override_shipping_address)) { echo $data->cart->override_shipping_address . '<br/></td></tr>'; } else { $shipping = $template;
function display($field, $value, $map, $inside, $options = '', $test = false, $allFields = null, $allValues = null) { $config = hikashop_config(); $uploaderType = hikashop_get('type.uploader'); $id = $this->prefix . @$field->field_namekey . $this->suffix; $options = array('upload' => true, 'gallery' => false, 'text' => JText::_('HIKA_DEFAULT_IMAGE_EMPTY_UPLOAD'), 'uploader' => array('order', $field->field_table . '-' . $field->field_namekey), 'ajax' => true, 'vars' => array('field_map' => $map, 'uploader_id' => $id)); $params = new stdClass(); $params->file_name = $value; $params->file_path = $value; $params->field_name = $map . '[name]'; $params->file_size = 0; $params->delete = empty($field->field_required); $params->uploader_id = $id; if (!empty($value)) { $path = JPath::clean(HIKASHOP_ROOT . DS . trim($config->get('uploadsecurefolder'), DS . ' ') . DS); $v = ''; if (JFile::exists($path . $value)) { $v = md5_file($path . $value); $params->file_size = filesize($path . $value); $params->working_path = $path; $n = $map . '[sec]'; $params->extra_fields = array($n => $v); } } $params->origin_url = hikashop_completeLink('order&task=download&field_table=' . $field->field_table . '&field_namekey=' . urlencode(base64_encode($field->field_namekey)) . '&name=' . urlencode(base64_encode($value))); if ($this->mode == 'image' && !empty($value)) { $thumbnail_x = 100; $thumbnail_y = 100; $thumbnails_params = '&thumbnail_x=' . $thumbnail_x . '&thumbnail_y=' . $thumbnail_y; $params->thumbnail_url = hikashop_completeLink('order&task=download&field_table=' . $field->field_table . '&field_namekey=' . urlencode(base64_encode($field->field_namekey)) . '&name=' . urlencode(base64_encode($value)) . $thumbnails_params); } $js = ''; $content = ''; if (!empty($value)) { $content = hikashop_getLayout($this->layoutName, $this->viewName, $params, $js); } if ($this->mode == 'image') { return $uploaderType->displayImageSingle($id, $content, $options); } return $uploaderType->displayFileSingle($id, $content, $options); }
function onProcessCategoryMassActiondisplayResults(&$elements, &$action, $k) { $params = $this->massaction->_displayResults('category', $elements, $action, $k); $params->action_id = $k; $js = ''; $app = JFactory::getApplication(); if ($app->isAdmin() && JRequest::getVar('ctrl', 'massaction') == 'massaction') { echo hikashop_getLayout('massaction', 'results', $params, $js); } }
function pay() { if (!$this->_check()) { return false; } $order_id = hikashop_getCID('order_id'); if (empty($order_id)) { parent::listing(); return false; } $class = hikashop_get('class.order'); $order = $class->loadFullOrder($order_id, true); if (empty($order->order_id)) { $app =& JFactory::getApplication(); $app->enqueueMessage('The order ' . $order_id . ' could not be found'); parent::listing(); return false; } $config =& hikashop_config(); $unpaid_statuses = explode(',', $config->get('order_unpaid_statuses', 'created')); if (!in_array($order->order_status, $unpaid_statuses)) { $app =& JFactory::getApplication(); $app->enqueueMessage('The order ' . $order->order_number . ' cannot be paid anymore.'); parent::listing(); return false; } if (empty($order->order_currency_id)) { $null = new stdClass(); $null->order_currency_id = hikashop_getCurrency(); $null->order_id = $order->order_id; $order->order_currency_id = $null->order_currency_id; $class->save($null); } $new_payment_method = JRequest::getVar('new_payment_method', ''); $config =& hikashop_config(); if ($config->get('allow_payment_change', 1) && !empty($new_payment_method)) { $new_payment_method = explode('_', $new_payment_method); $payment_id = array_pop($new_payment_method); $payment_method = implode('_', $new_payment_method); if ($payment_id != $order->order_payment_id || $payment_method != $order->order_payment_method) { $updateOrder = new stdClass(); $updateOrder->order_id = $order->order_id; $updateOrder->order_payment_id = $payment_id; $updateOrder->order_payment_method = $payment_method; $paymentClass = hikashop_get('class.payment'); $payment = $paymentClass->get($payment_id); if (!empty($payment->payment_params) && is_string($payment->payment_params)) { $payment->payment_params = unserialize($payment->payment_params); } $full_price_without_payment = $order->order_full_price - $order->order_payment_price; $new_payment = $payment; $new_payment_price = $paymentClass->computePrice($order, $new_payment, $full_price_without_payment, @$payment->payment_price, hikashop_getCurrency()); $new_payment_tax = @$new_payment->payment_tax; $updateOrder->order_payment_price = $new_payment_price; $updateOrder->order_full_price = $full_price_without_payment + $new_payment_price + $new_payment_tax; $updateOrder->history = new stdClass(); $updateOrder->history->history_payment_id = $payment_id; $updateOrder->history->history_payment_method = $payment_method; $class->save($updateOrder); $order->order_payment_id = $payment_id; $order->order_payment_method = $payment_method; $order->order_payment_price = $updateOrder->order_payment_price; $order->order_full_price = $updateOrder->order_full_price; } } $userClass = hikashop_get('class.user'); $order->customer = $userClass->get($order->order_user_id); $db = JFactory::getDBO(); $query = 'SELECT * FROM ' . hikashop_table('payment') . ' WHERE payment_type=' . $db->Quote($order->order_payment_method); $db->setQuery($query); $paymentData = $db->loadObjectList('payment_id'); $pluginsClass = hikashop_get('class.plugins'); $pluginsClass->params($paymentData, 'payment'); if (empty($paymentData)) { $app =& JFactory::getApplication(); $app->enqueueMessage('The payment method ' . $order->order_payment_method . ' could not be found'); parent::listing(); return false; } $order->cart =& $order; $order->cart->coupon = new stdClass(); $price = new stdClass(); $price->price_value_with_tax = $order->order_full_price; $order->cart->full_total = new stdClass(); $order->cart->full_total->prices = array($price); $price2 = new stdClass(); $total = 0; $class = hikashop_get('class.currency'); $order->cart->total = new stdClass(); $price2 = $class->calculateTotal($order->products, $order->cart->total, $order->order_currency_id); $order->cart->coupon->discount_value =& $order->order_discount_price; $shippingClass = hikashop_get('class.shipping'); $methods = $shippingClass->getMethods($order->cart); $data = hikashop_import('hikashopshipping', $order->order_shipping_method); if (!empty($data)) { $order->cart->shipping = $data->onShippingSave($order->cart, $methods, $order->order_shipping_id); } $app = JFactory::getApplication(); $app->setUserState(HIKASHOP_COMPONENT . '.shipping_address', $order->order_shipping_address_id); $app->setUserState(HIKASHOP_COMPONENT . '.billing_address', $order->order_billing_address_id); ob_start(); $data = hikashop_import('hikashoppayment', $order->order_payment_method); if (!empty($data)) { $needCC = false; if (method_exists($data, 'needCC')) { $method =& $paymentData[$order->order_payment_id]; $needCC = $data->needCC($method); } if (!$needCC) { $itemid_for_checkout = $config->get('checkout_itemid', '0'); if ($itemid_for_checkout) { global $Itemid; $Itemid = $itemid_for_checkout; } if (method_exists($data, 'onAfterOrderConfirm')) { $data->onAfterOrderConfirm($order, $paymentData, $order->order_payment_id); } } else { $paymentClass = hikashop_get('class.payment'); $do = false; $app->setUserState(HIKASHOP_COMPONENT . '.payment_method', $order->order_payment_method); $app->setUserState(HIKASHOP_COMPONENT . '.payment_id', $order->order_payment_id); $app->setUserState(HIKASHOP_COMPONENT . '.payment_data', $method); if ($paymentClass->readCC()) { $do = true; if (method_exists($data, 'onBeforeOrderCreate')) { $data->onBeforeOrderCreate($order, $do); } } if (!$do) { $app->setUserState(HIKASHOP_COMPONENT . '.cc_number', ''); $app->setUserState(HIKASHOP_COMPONENT . '.cc_month', ''); $app->setUserState(HIKASHOP_COMPONENT . '.cc_year', ''); $app->setUserState(HIKASHOP_COMPONENT . '.cc_CCV', ''); $app->setUserState(HIKASHOP_COMPONENT . '.cc_type', ''); $app->setUserState(HIKASHOP_COMPONENT . '.cc_owner', ''); $params = ''; $js = ''; echo hikashop_getLayout('checkout', 'ccinfo', $params, $js); } else { $order->history->history_notified = 1; $class = hikashop_get('class.order'); $updateOrder = new stdClass(); $updateOrder->order_id = $order->order_id; $updateOrder->order_status = $order->order_status; $updateOrder->order_payment_id = $payment_id; $updateOrder->order_payment_method = $payment_method; $updateOrder->history =& $order->history; $class->save($updateOrder); $app->redirect(hikashop_completeLink('checkout&task=after_end', false, true)); } } } $html = ob_get_clean(); if (empty($html)) { $app =& JFactory::getApplication(); $app->enqueueMessage('The payment method ' . $order->order_payment_method . ' does not handle payments after the order has been created'); parent::listing(); return false; } echo $html; return true; }