function onShippingConfiguration(&$element) { $config =& hikashop_config(); $this->main_currency = $config->get('main_currency', 1); $currencyClass = hikashop_get('class.currency'); $currency = hikashop_get('class.currency'); $this->currencyCode = $currency->get($this->main_currency)->currency_code; $this->currencySymbol = $currency->get($this->main_currency)->currency_symbol; $this->fedex = JRequest::getCmd('name', 'fedex'); $this->categoryType = hikashop_get('type.categorysub'); $this->categoryType->type = 'tax'; $this->categoryType->field = 'category_id'; $this->nameboxType = hikashop_get('type.namebox'); parent::onShippingConfiguration($element); $js = "\r\n\t\t\tfunction checkAllBox(id, type){\r\n\t\t\t\tvar toCheck = document.getElementById(id).getElementsByTagName('input');\r\n\t\t\t\tfor (i = 0 ; i < toCheck.length ; i++) {\r\n\t\t\t\t\tif (toCheck[i].type == 'checkbox') {\r\n\t\t\t\t\t\tif(type == 'check'){\r\n\t\t\t\t\t\t\ttoCheck[i].checked = true;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttoCheck[i].checked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}"; if (!HIKASHOP_PHP5) { $doc =& JFactory::getDocument(); } else { $doc = JFactory::getDocument(); } $doc->addScriptDeclaration("<!--\n" . $js . "\n//-->\n"); }
function onShippingConfiguration(&$element) { if (!JPluginHelper::isEnabled('hikashopshipping', 'bfmanual')) { $lang = JFactory::getLanguage(); $lang->load('plg_hikashopshipping_bfmanual', JPATH_ADMINISTRATOR); JFactory::getApplication()->redirect('index.php?option=com_hikashop&ctrl=plugins', JText::_('PLG_BF_MANUAL_NOT_ENABLED')); } $this->loadLanguage(); parent::onShippingConfiguration($element); }
function onShippingConfiguration(&$element) { $config =& hikashop_config(); $this->main_currency = $config->get('main_currency', 1); $currencyClass = hikashop_get('class.currency'); $currency = hikashop_get('class.currency'); $this->currencyCode = $currency->get($this->main_currency)->currency_code; $this->currencySymbol = $currency->get($this->main_currency)->currency_symbol; $this->canpar = JRequest::getCmd('name', 'canpar'); $this->categoryType = hikashop_get('type.categorysub'); $this->categoryType->type = 'tax'; $this->categoryType->field = 'category_id'; parent::onShippingConfiguration($element); $elements = array($element); $key = key($elements); if (!empty($elements[$key]->shipping_params->warehousesList)) { $elements[$key]->shipping_params->warehouse = unserialize($elements[$key]->shipping_params->warehousesList); } if (!empty($elements[$key]->shipping_params->methodsList)) { $elements[$key]->shipping_params->methods = unserialize($elements[$key]->shipping_params->methodsList); } $js = ' function deleteRow(divName,inputName,rowName){ var d = document.getElementById(divName); var olddiv = document.getElementById(inputName); if(d && olddiv){ d.removeChild(olddiv); document.getElementById(rowName).style.display=\'none\'; } return false; } function deleteZone(zoneName){ var d = document.getElementById(zoneName); if(d){ d.innerHTML=""; } return false; } '; $js .= "\nfunction checkAllBox(id, type){\n\tvar toCheck = document.getElementById(id).getElementsByTagName('input');\n\tfor (i = 0 ; i < toCheck.length ; i++) {\n\t\tif (toCheck[i].type == 'checkbox') {\n\t\t\tif(type == 'check'){\n\t\t\t\ttoCheck[i].checked = true;\n\t\t\t}else{\n\t\t\t\ttoCheck[i].checked = false;\n\t\t\t}\n\t\t}\n\t}\n}\n"; if (!HIKASHOP_PHP5) { $doc =& JFactory::getDocument(); } else { $doc = JFactory::getDocument(); } $doc->addScriptDeclaration("<!--\n" . $js . "\n//-->\n"); }
function onShippingConfiguration(&$elements) { $this->correios = JRequest::getCmd('name', 'correios'); parent::onShippingConfiguration($elements); }
function onShippingConfiguration(&$element) { $config =& hikashop_config(); $this->main_currency = $config->get('main_currency', 1); $currencyClass = hikashop_get('class.currency'); $currency = hikashop_get('class.currency'); $this->currencyCode = $currency->get($this->main_currency)->currency_code; $this->currencySymbol = $currency->get($this->main_currency)->currency_symbol; $this->fedex = JRequest::getCmd('name', 'fedex'); $this->categoryType = hikashop_get('type.categorysub'); $this->categoryType->type = 'tax'; $this->categoryType->field = 'category_id'; parent::onShippingConfiguration($element); $elements = array($element); $key = key($elements); if (empty($elements[$key]->shipping_params->lang_file_override)) { jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); $folder = JLanguage::getLanguagePath(JPATH_ROOT) . DS . 'overrides'; $path = $folder . DS . 'en-GB.override.ini'; $content_override = ''; if (JFile::exists($path)) { $content_override = JFile::read($path); } $content_override .= ' FEDEX_METER_ID="Meter #"' . ' FEDEX_ACCOUNT_NUMBER="Account #"' . ' FEDEX_API_KEY="API Key"' . ' FEDEX_API_PASSWORD="******"' . ' FEDEX_SHOW_ETA="Show ETA?"' . ' FEDEX_SHOW_ETA_FORMAT="ETA Format"' . ' PACKAGING_TYPE="Packaging Type"' . ' BOX_DIMENSIONS="Box Dimensions"' . ' ORIGINATION_POSTCODE="Ship From Postcode"' . ' SENDER_COMPANY="Sender Company"' . ' SENDER_PHONE="Sender Phone"' . ' SENDER_ADDRESS="Sender Address"' . ' SENDER_CITY="Sender City"' . ' SENDER_STATE="Sender State"' . ' SENDER_POSTCODE="Sender Zip"'; if (!JFolder::exists($folder)) { JFolder::create($folder); } if (JFolder::exists($folder)) { $path = $folder . DS . 'en-GB.override.ini'; $result = JFile::write($path, $content_override); if (!$result) { hikashop_display(JText::sprintf('FAIL_SAVE', $path), 'error'); } else { $elements[$key]->shipping_params->lang_file_override = 1; } } } $js = "\r\n\t\t\tfunction checkAllBox(id, type){\r\n\t\t\t\tvar toCheck = document.getElementById(id).getElementsByTagName('input');\r\n\t\t\t\tfor (i = 0 ; i < toCheck.length ; i++) {\r\n\t\t\t\t\tif (toCheck[i].type == 'checkbox') {\r\n\t\t\t\t\t\tif(type == 'check'){\r\n\t\t\t\t\t\t\ttoCheck[i].checked = true;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttoCheck[i].checked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}"; if (!HIKASHOP_PHP5) { $doc =& JFactory::getDocument(); } else { $doc = JFactory::getDocument(); } $doc->addScriptDeclaration("<!--\n" . $js . "\n//-->\n"); }
function onShippingConfiguration(&$element) { $config =& hikashop_config(); $this->usps = JRequest::getCmd('name', 'usps'); $this->main_currency = $config->get('main_currency', 1); $currencyClass = hikashop_get('class.currency'); $currency = $currencyClass->get($this->main_currency); $this->currencyCode = $currency->currency_code; $this->currencySymbol = $currency->currency_symbol; $this->categoryType = hikashop_get('type.categorysub'); $this->categoryType->type = 'tax'; $this->categoryType->field = 'category_id'; parent::onShippingConfiguration($element); $elements = array($element); }
function onShippingConfigurationSave(&$elements) { parent::onShippingConfiguration($elements); $warehouses = JRequest::getVar('warehouse', array(), '', 'array'); $cats = array(); $methods = array(); $db = JFactory::getDBO(); $zone_keys = ''; if (isset($_REQUEST['data']['shipping_methods'])) { foreach ($_REQUEST['data']['shipping_methods'] as $method) { foreach ($this->ups_methods as $upsMethod) { $name = strtolower($upsMethod['name']); $name = str_replace(' ', '_', $name); if ($name == $method['name']) { $obj = new stdClass(); $methods[strip_tags($method['name'])] = strip_tags($upsMethod['code']); } } } } $elements->shipping_params->methodsList = serialize($methods); if (!empty($warehouses)) { foreach ($warehouses as $id => $warehouse) { if (!empty($warehouse['zone'])) { $zone_keys .= 'zone_namekey=' . $db->Quote($warehouse['zone']) . ' OR '; } } $zone_keys = substr($zone_keys, 0, -4); if (!empty($zone_keys)) { $query = ' SELECT zone_namekey, zone_id, zone_name_english FROM ' . hikashop_table('zone') . ' WHERE ' . $zone_keys; $db->setQuery($query); $zones = $db->loadObjectList(); } foreach ($warehouses as $id => $warehouse) { $warehouse['zone_name'] = ''; if (!empty($zones)) { foreach ($zones as $zone) { if ($zone->zone_namekey == $warehouse['zone']) { $warehouse['zone_name'] = $zone->zone_id . ' ' . $zone->zone_name_english; } } } if (!empty($_REQUEST['warehouse'][$id]['zip'])) { $obj = new stdClass(); $obj->name = strip_tags($_REQUEST['warehouse'][$id]['name']); $obj->zip = strip_tags($_REQUEST['warehouse'][$id]['zip']); $obj->statecode = strip_tags($_REQUEST['warehouse'][$id]['statecode']); $obj->city = strip_tags($_REQUEST['warehouse'][$id]['city']); $obj->country = strip_tags($_REQUEST['warehouse'][$id]['country']); $obj->zone = @strip_tags($_REQUEST['warehouse'][$id]['zone']); $obj->zone_name = $warehouse['zone_name']; $obj->units = strip_tags($_REQUEST['warehouse'][$id]['units']); $obj->currency = strip_tags($_REQUEST['warehouse'][$id]['currency']); $cats[] = $obj; } } $elements->shipping_params->warehousesList = serialize($cats); } if (empty($cats)) { $obj = new stdClass(); $obj->name = ''; $obj->zip = ''; $obj->statecode = ''; $obj->city = ''; $obj->country = ''; $obj->zone = ''; $void[] = $obj; $elements->shipping_params->warehousesList = serialize($void); } return true; }
function onShippingConfiguration(&$element) { $this->aupost2 = JRequest::getCmd('name', 'aupost2'); $this->categoryType = hikashop_get('type.categorysub'); $this->categoryType->type = 'tax'; $this->categoryType->field = 'category_id'; parent::onShippingConfiguration($element); }
/** * */ function onShippingConfiguration(&$element) { parent::onShippingConfiguration($element); $this->envoimoinscher = JRequest::getCmd('name', 'envoimoinscher'); $elements = array($element); $key = key($elements); $js = ' function checkAllBox(id, type) { var toCheck = document.getElementById(id).getElementsByTagName("input"); for(i = 0 ; i < toCheck.length ; i++) { if(toCheck[i].type != "checkbox") continue; toCheck[i].checked = (type == "check") } }'; $doc = JFactory::getDocument(); $doc->addScriptDeclaration("<!--\n" . $js . "\n//-->\n"); }
function onShippingConfiguration(&$element) { $app = JFactory::getApplication(); $app->enqueueMessage('That Australia Post shipping version is deprecated and is using the old Australia post API, Please start using the new Australia Post v2 shipping method'); $this->aupost = JRequest::getCmd('name', 'aupost'); $this->categoryType = hikashop_get('type.categorysub'); $this->categoryType->type = 'tax'; $this->categoryType->field = 'category_id'; parent::onShippingConfiguration($element); }
function onShippingConfiguration(&$element) { $app = JFactory::getApplication(); $config = hikashop_config(); $this->main_currency = $config->get('main_currency', 1); $currencyClass = hikashop_get('class.currency'); $main_currency = $currencyClass->get($this->main_currency); $this->currencyCode = $main_currency->currency_code; $this->currencySymbol = $main_currency->currency_symbol; $this->canadapost = JRequest::getCmd('name', 'canadapost'); $this->categoryType = hikashop_get('type.categorysub'); $this->categoryType->type = 'tax'; $this->categoryType->field = 'category_id'; parent::onShippingConfiguration($element); $elements = array($element); $key = key($elements); if (!empty($elements[$key]->shipping_params->warehousesList)) { $elements[$key]->shipping_params->warehouse = unserialize($elements[$key]->shipping_params->warehousesList); } if (!empty($elements[$key]->shipping_params->methodsList)) { $elements[$key]->shipping_params->methods = unserialize($elements[$key]->shipping_params->methodsList); } if (empty($elements[$key]->shipping_params->merchant_ID)) { $app->enqueueMessage(JText::sprintf('ENTER_INFO', 'Canada POST', JText::_('ATOS_MERCHANT_ID'))); } if (empty($elements[$key]->shipping_params->warehouse[0]->zip)) { $app->enqueueMessage(JText::sprintf('PLEASE_FILL_THE_FIELD', JText::_('POST_CODE')), 'notice'); } $js = ' function deleteRow(divName,inputName,rowName){ var d = document.getElementById(divName); var olddiv = document.getElementById(inputName); if(d && olddiv) { d.removeChild(olddiv); document.getElementById(rowName).style.display = "none"; } return false; } function deleteZone(zoneName) { var d = document.getElementById(zoneName); if(d) d.innerHTML = ""; return false; } function checkAllBox(id, type) { var toCheck = document.getElementById(id).getElementsByTagName("input"); for(i = 0 ; i < toCheck.length ; i++) { if(toCheck[i].type != "checkbox") continue; toCheck[i].checked = (type == "check"); } } '; if (!HIKASHOP_PHP5) { $doc =& JFactory::getDocument(); } else { $doc = JFactory::getDocument(); } $doc->addScriptDeclaration("<!--\n" . $js . "\n//-->\n"); }