Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development

This commit is contained in:
sLorenzini
2012-12-05 10:59:47 +01:00
36 changed files with 343 additions and 114 deletions
@@ -154,16 +154,57 @@
<td style="padding-bottom:5px;">
<ul class="listForm">
<li>
<input onclick="toggleDraftWarning(false);showOptions(true);" type="radio" name="active" id="active_on" value="1" {if $product->active || !$product->isAssociatedToShop()}checked="checked" {/if} />
<input onclick="toggleDraftWarning(false);showOptions(true);showRedirectProductOptions(false);" type="radio" name="active" id="active_on" value="1" {if $product->active || !$product->isAssociatedToShop()}checked="checked" {/if} />
<label for="active_on" class="radioCheck">{l s='Enabled'}</label>
</li>
<li>
<input onclick="toggleDraftWarning(true);showOptions(false);" type="radio" name="active" id="active_off" value="0" {if !$product->active && $product->isAssociatedToShop()}checked="checked"{/if} />
<input onclick="toggleDraftWarning(true);showOptions(false);showRedirectProductOptions(true);" type="radio" name="active" id="active_off" value="0" {if !$product->active && $product->isAssociatedToShop()}checked="checked"{/if} />
<label for="active_off" class="radioCheck">{l s='Disabled'}</label>
</li>
</ul>
</td>
</tr>
<tr class="redirect_product_options" style="display:none">
<td class="col-left">
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
<label class="text">{l s='Redirect:'}</label>
</td>
<td style="padding-bottom:5px;">
<select name="redirect_type" id="redirect_type">
<option value="404" {if $product->redirect_type == '404'} selected="selected" {/if}>{l s='No redirect (404)'}</option>
<option value="301" {if $product->redirect_type == '301'} selected="selected" {/if}>{l s='Redirect permanently (301)'}</option>
<option value="302" {if $product->redirect_type == '302'} selected="selected" {/if}>{l s='Redirect temporarily (302)'}</option>
</select>
<span class="hint" name="help_box">
{l s='404 : Not Found = Product does not exist and no redirect'}<br/>
{l s='301 : Moved Permanently = Product Moved Permanently'}<br/>
{l s='302 : Moved Temporarily = Product moved temporarily'}
</span>
</td>
</tr>
<tr class="redirect_product_options redirect_product_options_product_choise" style="display:none">
<td class="col-left">
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
<label class="text">{l s='Related product:'}</label>
</td>
<td style="padding-bottom:5px;">
<input type="hidden" value="" name="id_product_redirected" />
<input value="" id="related_product_autocomplete_input" autocomplete="off" class="ac_input" />
<p>
<script>
var no_related_product = '{l s='No related product'}';
var id_product_redirected = {$product->id_product_redirected|escape:html:'UTF-8'};
var product_name_redirected = '{$product_name_redirected|escape:html:'UTF-8'}';
</script>
<span id="related_product_name">{l s='No related product'}</span>
<span id="related_product_remove" style="display:none">
<a hre="#" onclick="removeRelatedProduct(); return false" id="related_product_remove_link">
<img src="../img/admin/delete.gif" class="middle" alt="" />
</a>
</span>
</p>
</td>
</tr>
<tr>
<td class="col-left">
{include file="controllers/products/multishop/checkbox.tpl" field="visibility" type="default"}
@@ -26,6 +26,7 @@
{if isset($product->id)}
<input type="hidden" name="submitted_tabs[]" value="Quantities" />
<h4>{l s='Available quantities for sale'}</h4>
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Quantities"}
<div class="separation"></div>
<div class="hint" style="display:block; position:'auto';">
<p>{l s='This interface allows you to manage the available quantities for sale of the current product and its combinations on the current shop.'}</p>
@@ -206,8 +207,11 @@
</tr>
{/if}
<tr>
<td class="col-left"><label>{l s='Displayed text when in-stock:'}</label></td>
<td style="padding-bottom:5px;">
<td class="col-left">
{include file="controllers/products/multishop/checkbox.tpl" field="available_now" type="default" multilang="true"}
<label>{l s='Displayed text when in-stock:'}</label>
</td>
<td style="padding-bottom:5px;" class="col-right">
{include file="controllers/products/input_text_lang.tpl"
languages=$languages
input_value=$product->available_now
@@ -216,8 +220,11 @@
</td>
</tr>
<tr>
<td class="col-left"><label>{l s='Displayed text when allowed to be back-ordered:'}</label></td>
<td style="padding-bottom:5px;">
<td class="col-left">
{include file="controllers/products/multishop/checkbox.tpl" field="available_later" type="default" multilang="true"}
<label>{l s='Displayed text when allowed to be back-ordered:'}</label>
</td>
<td style="padding-bottom:5px;" class="col-right">
{include file="controllers/products/input_text_lang.tpl"
languages=$languages
input_value=$product->available_later
+8 -6
View File
@@ -337,12 +337,6 @@ class AddressCore extends ObjectModel
*/
public static function initialize($id_address = null)
{
// set the default address
$address = new Address();
$address->id_country = (int)Context::getContext()->country->id;
$address->id_state = 0;
$address->postcode = 0;
// if an id_address has been specified retrieve the address
if ($id_address)
{
@@ -351,6 +345,14 @@ class AddressCore extends ObjectModel
if (!Validate::isLoadedObject($address))
throw new PrestaShopException('Invalid address');
}
else
{
// set the default address
$address = new Address();
$address->id_country = (int)Context::getContext()->country->id;
$address->id_state = 0;
$address->postcode = 0;
}
return $address;
}
+5 -3
View File
@@ -1509,9 +1509,8 @@ class CartCore extends ObjectModel
// If the cart rule offers a reduction, the amount is prorated (with the products in the package)
if ($cart_rule['obj']->reduction_percent > 0 || $cart_rule['obj']->reduction_amount > 0)
{
$order_total_discount += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_REDUCTION, $package, $use_cache), 2);
}
}
$order_total_discount = min(Tools::ps_round($order_total_discount, 2), $wrapping_fees + $order_total_products + $shipping_fees);
@@ -2600,7 +2599,10 @@ class CartCore extends ObjectModel
// Select carrier tax
if ($use_tax && !Tax::excludeTaxeOption())
$carrier_tax = $carrier->getTaxesRate(new Address((int)$address_id));
{
$address = Address::initialize((int)$address_id);
$carrier_tax = $carrier->getTaxesRate($address);
}
$configuration = Configuration::getMultiple(array(
'PS_SHIPPING_FREE_PRICE',
+1 -1
View File
@@ -418,7 +418,7 @@ class HookCore extends ObjectModel
else if ($hook_retro_callable)
$display = $moduleInstance->{'hook'.$retro_hook_name}($hook_args);
// Live edit
if ($array_return && $array['live_edit'] && Tools::isSubmit('live_edit') && Tools::getValue('ad') && Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee')))
if (!$array_return && $array['live_edit'] && Tools::isSubmit('live_edit') && Tools::getValue('ad') && Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee')))
{
$live_edit = true;
$output .= self::wrapLiveEdit($display, $moduleInstance, $array['id_hook']);
+4 -5
View File
@@ -409,9 +409,8 @@ class ImageCore extends ObjectModel
// Delete auto-generated images
$image_types = ImageType::getImagesTypes();
foreach ($image_types as $image_type)
{
$files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-'.$image_type['name'].'.'.$this->image_format;
}
// Delete watermark image
$files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-watermark.'.$this->image_format;
// delete index.php
@@ -533,11 +532,11 @@ class ImageCore extends ObjectModel
if (!file_exists(_PS_PROD_IMG_DIR_.$this->getImgFolder()))
{
// Apparently sometimes mkdir cannot set the rights, and sometimes chmod can't. Trying both.
$success = @mkdir(_PS_PROD_IMG_DIR_.$this->getImgFolder(), self::$access_rights, true)
|| @chmod(_PS_PROD_IMG_DIR_.$this->getImgFolder(), self::$access_rights);
$success = @mkdir(_PS_PROD_IMG_DIR_.$this->getImgFolder(), self::$access_rights, true);
$chmod = @chmod(_PS_PROD_IMG_DIR_.$this->getImgFolder(), self::$access_rights);
// Create an index.php file in the new folder
if ($success
if (($success || $chmod)
&& !file_exists(_PS_PROD_IMG_DIR_.$this->getImgFolder().'index.php')
&& file_exists($this->source_index))
return @copy($this->source_index, _PS_PROD_IMG_DIR_.$this->getImgFolder().'index.php');
+1 -1
View File
@@ -186,7 +186,7 @@ abstract class PaymentModuleCore extends Module
foreach ($data['package_list'] as $id_package)
{
// Rewrite the id_warehouse
$package_list[$id_address][$id_package]['id_warehouse'] = $this->context->cart->getPackageIdWarehouse($package_list[$id_address][$id_package], (int)$id_carrier);
$package_list[$id_address][$id_package]['id_warehouse'] = (int)$this->context->cart->getPackageIdWarehouse($package_list[$id_address][$id_package], (int)$id_carrier);
$package_list[$id_address][$id_package]['id_carrier'] = $id_carrier;
}
// Make sure CarRule caches are empty
+30 -3
View File
@@ -163,7 +163,13 @@ class ProductCore extends ObjectModel
/** @var boolean Product statuts */
public $active = true;
/** @var boolean Product statuts */
public $redirect_type = '';
/** @var boolean Product statuts */
public $id_product_redirected = 0;
/** @var boolean Product available for order */
public $available_for_order = true;
@@ -272,6 +278,8 @@ class ProductCore extends ObjectModel
'text_fields' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedInt'),
'uploadable_files' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedInt'),
'active' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
'redirect_type' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isString'),
'id_product_redirected' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedId'),
'available_for_order' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
'available_date' => array('type' => self::TYPE_DATE, 'shop' => true, 'validate' => 'isDateFormat'),
'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new', 'used', 'refurbished'), 'default' => 'new'),
@@ -650,7 +658,26 @@ class ProductCore extends ObjectModel
return parent::validateFieldsLang($die, $error_return);
}
public function toggleStatus()
{
//test if the product is active and if redirect_type is empty string and set default value to id_product_redirected & redirect_type
// /!\ after parent::toggleStatus() active will be false, that why we set 404 by default :p
if ($this->active)
{
//case where active will be false after parent::toggleStatus()
$this->id_product_redirected = 0;
$this->redirect_type = '404';
}
else
{
//case where active will be true after parent::toggleStatus()
$this->id_product_redirected = 0;
$this->redirect_type = '';
}
return parent::toggleStatus();
}
public function delete()
{
/*
@@ -798,7 +825,7 @@ class ProductCore extends ObjectModel
SELECT c.`id_category`
FROM `'._DB_PREFIX_.'category_product` cp
LEFT JOIN `'._DB_PREFIX_.'category` c ON (c.`id_category` = cp.`id_category`)
'.Shop::addSqlAssociation('category', 'c', true).'
'.Shop::addSqlAssociation('category', 'c', true, null, true).'
WHERE cp.`id_category` NOT IN ('.implode(',', array_map('intval', $categories)).')
AND cp.id_product = '.$this->id
);
+4 -4
View File
@@ -472,9 +472,9 @@ class ValidateCore
*/
public static function isDate($date)
{
if (!preg_match('/^([0-9]{4})-((0?[0-9])|(1[0-2]))-((0?[0-9])|([1-2][0-9])|(3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $matches))
if (!preg_match('/^([0-9]{4})-((?:0?[0-9])|(?:1[0-2]))-((?:0?[0-9])|(?:[1-2][0-9])|(?:3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $matches))
return false;
return checkdate((int)$matches[2], (int)$matches[5], (int)$matches[0]);
return checkdate((int)$matches[2], (int)$matches[3], (int)$matches[1]);
}
/**
@@ -487,9 +487,9 @@ class ValidateCore
{
if (empty($date) || $date == '0000-00-00')
return true;
if (preg_match('/^([0-9]{4})-((0?[1-9])|(1[0-2]))-((0?[1-9])|([1-2][0-9])|(3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $birth_date))
if (preg_match('/^([0-9]{4})-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[1-2][0-9])|(?:3[01]))([0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $birth_date))
{
if ($birth_date[1] > date('Y') || $birth_date[2] > date('m') || $birth_date[3] > date('d'))
if ($birth_date[1] > date('Y') && $birth_date[2] > date('m') && $birth_date[3] > date('d'))
return false;
return true;
}
+25 -34
View File
@@ -252,12 +252,6 @@ class FrontControllerCore extends Controller
CartRule::autoAddToCart($this->context);
}
$locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8');
setlocale(LC_COLLATE, $locale);
setlocale(LC_CTYPE, $locale);
setlocale(LC_TIME, $locale);
setlocale(LC_NUMERIC, 'en_US.UTF-8');
/* get page name to display it in body id */
// Are we in a payment module
@@ -402,10 +396,8 @@ class FrontControllerCore extends Controller
if ($this->restrictedCountry)
$this->displayRestrictedCountryPage();
//live edit
if (Tools::isSubmit('live_edit') && ($ad = Tools::getValue('ad')) && Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee')))
if (!is_dir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$ad))
die(Tools::displayError());
if (Tools::isSubmit('live_edit') && !$this->checkLiveEditAccess())
die(Tools::displayError());
$this->iso = $iso;
$this->setMedia();
@@ -413,7 +405,7 @@ class FrontControllerCore extends Controller
$this->context->cart = $cart;
$this->context->currency = $currency;
}
public function postProcess()
{
/*// For retrocompatibility with versions before 1.5, preProcess support will be removed on next release
@@ -549,23 +541,24 @@ class FrontControllerCore extends Controller
'display_header' => $this->display_header,
'display_footer' => $this->display_footer,
));
$live_edit_content = '';
// Don't use live edit if on mobile device
if ($this->context->getMobileDevice() == false && Tools::isSubmit('live_edit'))
$this->context->smarty->assign('live_edit', $this->getLiveEditFooter());
if (!$this->context->getMobileDevice() && $this->checkLiveEditAccess())
$live_edit_content = $this->getLiveEditFooter();
$layout = $this->getLayout();
if ($layout)
{
if ($this->template)
$this->context->smarty->assign('template', $this->context->smarty->fetch($this->template));
$this->context->smarty->assign('template', $this->context->smarty->fetch($this->template).$live_edit_content);
else // For retrocompatibility with 1.4 controller
{
ob_start();
$this->displayContent();
$template = ob_get_contents();
ob_clean();
$this->context->smarty->assign('template', $template);
$this->context->smarty->assign('template', $template.$live_edit_content);
}
$this->smartyOutputContent($layout);
}
@@ -583,16 +576,9 @@ class FrontControllerCore extends Controller
if ($this->display_footer)
$this->smartyOutputContent(_PS_THEME_DIR_.'footer.tpl');
// live edit
if (Tools::isSubmit('live_edit') && ($ad = Tools::getValue('ad')) && Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee')))
{
$this->context->smarty->assign(array('ad' => $ad, 'live_edit' => true));
$this->smartyOutputContent(_PS_ALL_THEMES_DIR_.'live_edit.tpl');
}
// END - 1.4 retrocompatibility - will be removed in 1.6
}
return true;
}
@@ -799,16 +785,21 @@ class FrontControllerCore extends Controller
));
}
public function checkLiveEditAccess()
{
$live_token = Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee'));
$ad = Tools::getValue('ad');
return Tools::isSubmit('live_edit') && $ad && Tools::getValue('liveToken') == $live_token && is_dir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$ad);
}
public function getLiveEditFooter()
{
if (Tools::isSubmit('live_edit')
&& ($ad = Tools::getValue('ad'))
&& Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee')))
if ($this->checkLiveEditAccess())
{
$data = $this->context->smarty->createData();
$data->assign(array(
'ad' => $ad,
'ad' => Tools::getValue('ad'),
'live_edit' => true,
'hook_list' => Hook::$executed_hooks,
'id_shop' => $this->context->shop->id
@@ -1144,12 +1135,12 @@ class FrontControllerCore extends Controller
* @return array
*/
public function initLogoAndFavicon()
{
return array(
'favicon_url' => _PS_IMG_.Configuration::get('PS_FAVICON'),
{
return array(
'favicon_url' => _PS_IMG_.Configuration::get('PS_FAVICON'),
'logo_image_width' => ($this->context->getMobileDevice() == false ? Configuration::get('SHOP_LOGO_WIDTH') : Configuration::get('SHOP_LOGO_MOBILE_WIDTH')),
'logo_image_height' => ($this->context->getMobileDevice() == false ? Configuration::get('SHOP_LOGO_HEIGHT') : Configuration::get('SHOP_LOGO_MOBILE_HEIGHT')),
'logo_url' => ($this->context->getMobileDevice() == false ? _PS_IMG_.Configuration::get('PS_LOGO').'?'.Configuration::get('PS_IMG_UPDATE_TIME') : _PS_IMG_.Configuration::get('PS_LOGO_MOBILE').'?'.Configuration::get('PS_IMG_UPDATE_TIME'))
);
}
}
}
@@ -323,7 +323,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
// Set the image path on display in relation to the header image
case 'header':
if (in_array($this->wsObject->method, array('GET','HEAD','PUT')))
$path = _PS_IMG_DIR_.'logo.jpg';
$path = _PS_IMG_DIR_.Configuration::get('PS_LOGO');
else
throw new WebserviceException('This method is not allowed with general image resources.', array(49, 405));
break;
@@ -387,7 +387,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
{
case 'GET':
case 'HEAD':
$this->imgToDisplay = ($path != '' && file_exists($path)) ? $path : $alternative_path;
$this->imgToDisplay = ($path != '' && file_exists($path) && is_file($path)) ? $path : $alternative_path;
return true;
break;
case 'PUT':
+9 -2
View File
@@ -107,6 +107,13 @@ Context::getContext()->country = $defaultCountry;
/* It is not safe to rely on the system's timezone settings, and this would generate a PHP Strict Standards notice. */
@date_default_timezone_set(Configuration::get('PS_TIMEZONE'));
/* Set locales */
$locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8');
setlocale(LC_COLLATE, $locale);
setlocale(LC_CTYPE, $locale);
setlocale(LC_TIME, $locale);
setlocale(LC_NUMERIC, 'en_US.UTF-8');
/* Instantiate cookie */
@@ -122,7 +129,7 @@ else
else
{
$domains = null;
if(Context::getContext()->shop->domain != Context::getContext()->shop->domain_ssl)
if (Context::getContext()->shop->domain != Context::getContext()->shop->domain_ssl)
$domains = array(Context::getContext()->shop->domain_ssl, Context::getContext()->shop->domain);
$cookie = new Cookie('ps-s'.Context::getContext()->shop->id, '', $cookie_lifetime, $domains);
@@ -153,7 +160,7 @@ else
{
$customer = new Customer();
// Change the default group
// Change the default group
if (Group::isFeatureActive())
$customer->id_default_group = Configuration::get('PS_UNIDENTIFIED_GROUP');
}
+1 -1
View File
@@ -202,7 +202,7 @@ class AdminEmailsControllerCore extends AdminController
if (isset($_POST['PS_SHOP_EMAIL']))
$_POST['PS_SHOP_EMAIL'] = Configuration::get('PS_SHOP_EMAIL');
if ($_POST['PS_MAIL_METHOD'] == 2 && (empty($_POST['PS_MAIL_SERVER']) || empty($_POST['PS_MAIL_SMTP_PORT'])))
if (isset($_POST['PS_MAIL_METHOD']) && $_POST['PS_MAIL_METHOD'] == 2 && (empty($_POST['PS_MAIL_SERVER']) || empty($_POST['PS_MAIL_SMTP_PORT'])))
$this->errors[] = Tools::displayError('You must define an SMTP server and an SMTP port. If you do not know, use the PHP mail() function instead.');
}
+6 -3
View File
@@ -95,7 +95,6 @@ class AdminHomeControllerCore extends AdminController
$opti_list = array();
if ($rewrite + $htaccessOptimized + $smartyOptimized + $cccOptimized + $shopEnabled + $htaccessAfterUpdate + $indexRebuiltAfterUpdate != 14)
{
$this->context->smarty->assign('hide_tips', Configuration::get('PS_HIDE_OPTIMIZATION_TIPS'));
$opti_list[] = array(
'title' => $this->l('URL rewriting'),
'href' => $link->getAdminLink('AdminMeta'),
@@ -145,8 +144,12 @@ class AdminHomeControllerCore extends AdminController
'image' => $lights[$htaccessAfterUpdate]['image'],
);
}
$this->context->smarty->assign('opti_list', $opti_list);
$this->context->smarty->assign('content', $content);
$this->context->smarty->assign(array(
'opti_list' => $opti_list,
'content' => $content,
'hide_tips' => Configuration::get('PS_HIDE_OPTIMIZATION_TIPS'))
);
$template = $this->createTemplate('optimizationTips.tpl');
return $template->fetch();
}
@@ -462,6 +462,7 @@ class AdminModulesControllerCore extends AdminController
}
else
$this->errors[] = Tools::displayError('Cannot load module object');
$this->errors = array_merge($this->errors, $module->getErrors());
}
else
$this->errors[] = Tools::displayError('You do not have permission to add here.');
@@ -688,6 +689,7 @@ class AdminModulesControllerCore extends AdminController
}
elseif ($echo === false)
$module_errors[] = array('name' => $name, 'message' => $module->getErrors());
if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && isset(Context::getContext()->tmpOldShop))
{
Context::getContext()->shop = clone(Context::getContext()->tmpOldShop);
+12 -11
View File
@@ -536,13 +536,17 @@ class AdminProductsControllerCore extends AdminController
$this->errors[] = Tools::displayError('You cannot delete the product because there is physical stock left or supply orders in progress.');
}
if ($object->delete())
if (!count($this->errors))
{
$id_category = (int)Tools::getValue('id_category');
$category_url = empty($id_category) ? '' : '&id_category='.(int)$id_category;
$this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token.$category_url;
if ($object->delete())
{
$id_category = (int)Tools::getValue('id_category');
$category_url = empty($id_category) ? '' : '&id_category='.(int)$id_category;
$this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token.$category_url;
}
else
$this->errors[] = Tools::displayError('An error occurred during deletion.');
}
$this->errors[] = Tools::displayError('An error occurred during deletion.');
}
}
else
@@ -632,10 +636,8 @@ class AdminProductsControllerCore extends AdminController
$real_quantity = $stock_manager->getProductRealQuantities($product->id, 0);
if ($physical_quantity > 0 || $real_quantity > $physical_quantity)
$this->errors[] = sprintf(Tools::displayError('You cannot delete the product #%d because there is physical stock left or supply orders in progress.'), $product->id);
else
$success &= $product->delete();
}
else
if (!count($this->errors))
$success &= $product->delete();
}
}
@@ -1704,7 +1706,7 @@ class AdminProductsControllerCore extends AdminController
$this->updateDownloadProduct($object, 1);
$this->updateTags(Language::getLanguages(false), $object);
if ($this->isProductFieldUpdated('category_box') && !$object->updateCategories(Tools::getValue('categoryBox'), true))
if ($this->isProductFieldUpdated('category_box') && !$object->updateCategories(Tools::getValue('categoryBox')))
$this->errors[] = Tools::displayError('An error occurred while linking object.').' <b>'.$this->table.'</b> '.Tools::displayError('To categories');
}
@@ -3299,8 +3301,7 @@ class AdminProductsControllerCore extends AdminController
$data->assign('currency', $currency);
$this->object = $product;
$this->display = 'edit';
$data->assign('product_name_redirected', Product::getProductName((int)$product->id_product_redirected, null, (int)$this->context->language->id));
/*
* Form for adding a virtual product like software, mp3, etc...
*/
@@ -570,7 +570,7 @@ class AdminTranslationsControllerCore extends AdminController
if (isset($tab->class_name) && !empty($tab->class_name))
{
$id_lang = Language::getIdByIso($iso_code);
$tab->name[(int)$id_lang] = pSQL($translations);
$tab->name[(int)$id_lang] = $translations;
// Update this tab
$tab->update();
+1 -1
View File
@@ -256,7 +256,7 @@ class AddressControllerCore extends FrontController
// Assign common vars
$this->context->smarty->assign(array(
'onr_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'),
'one_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'),
'ajaxurl' => _MODULE_DIR_,
'errors' => $this->errors,
'token' => Tools::getToken(false),
+1 -1
View File
@@ -166,7 +166,7 @@ class AuthControllerCore extends FrontController
$days = Tools::dateDays();
$this->context->smarty->assign(array(
'onr_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'),
'one_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'),
'years' => $years,
'sl_year' => (isset($selectedYears) ? $selectedYears : 0),
'months' => $months,
+1 -1
View File
@@ -113,7 +113,7 @@ class OrderFollowControllerCore extends FrontController
parent::setMedia();
$this->addCSS(array(_THEME_CSS_DIR_.'history.css', _THEME_CSS_DIR_.'addresses.css'));
$this->addJqueryPlugin('scrollTo');
$this->addJS(_THEME_JS_DIR_.'history.js', _THEME_JS_DIR_.'tools.js');
$this->addJS(array(_THEME_JS_DIR_.'history.js', _THEME_JS_DIR_.'tools.js'));
}
}
+35 -10
View File
@@ -104,16 +104,45 @@ class ProductControllerCore extends FrontController
* allow showing the product
* In all the others cases => 404 "Product is no longer available"
*/
if (!$this->product->isAssociatedToShop()
|| ((!$this->product->active && ((Tools::getValue('adtoken') != Tools::getAdminToken('AdminProducts'.(int)Tab::getIdFromClassName('AdminProducts').(int)Tools::getValue('id_employee')))
|| !file_exists(_PS_ROOT_DIR_.'/'.Tools::getValue('ad').'/index.php')))))
if (!$this->product->isAssociatedToShop() || !$this->product->active)
{
header('HTTP/1.1 404 page not found');
$this->errors[] = Tools::displayError('Product is no longer available.');
if (Tools::getValue('adtoken') == Tools::getAdminToken('AdminProducts'.(int)Tab::getIdFromClassName('AdminProducts').(int)Tools::getValue('id_employee')))
{
// If the product is not active, it's the admin preview mode
$this->context->smarty->assign('adminActionDisplay', true);
}
else
{
$this->context->smarty->assign('adminActionDisplay', false);
if ($this->product->id_product_redirected == $this->product->id)
$this->product->redirect_type = '404';
switch ($this->product->redirect_type)
{
case '301':
header('HTTP/1.1 301 Moved Permanently');
header('Location: '.$this->context->link->getProductLink($this->product->id_product_redirected));
break;
case '302':
header('HTTP/1.1 302 Moved Temporarily');
header('Cache-Control: no-cache');
header('Location: '.$this->context->link->getProductLink($this->product->id_product_redirected));
break;
case '404':
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
$this->errors[] = Tools::displayError('Product is no longer available.');
break;
}
}
}
else if (!$this->product->checkAccess(isset($this->context->customer) ? $this->context->customer->id : 0))
{
header('HTTP/1.1 403 Forbidden');
header('Status: 403 Forbidden');
$this->errors[] = Tools::displayError('You do not have access to this product.');
}
// Load category
if (isset($_SERVER['HTTP_REFERER'])
&& !strstr($_SERVER['HTTP_REFERER'], Tools::getHttpHost()) // Assure us the previous page was one of the shop
@@ -150,10 +179,6 @@ class ProductControllerCore extends FrontController
// Assign to the template the id of the virtual product. "0" if the product is not downloadable.
$this->context->smarty->assign('virtual', ProductDownload::getIdFromIdProduct((int)$this->product->id));
// If the product is not active, it's the admin preview mode
if (!$this->product->active)
$this->context->smarty->assign('adminActionDisplay', true);
// Product pictures management
require_once('images.inc.php');
$this->context->smarty->assign('customizationFormTarget', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI'])));
+4
View File
@@ -1376,6 +1376,8 @@ CREATE TABLE `PREFIX_product` (
`uploadable_files` tinyint(4) NOT NULL default '0',
`text_fields` tinyint(4) NOT NULL default '0',
`active` tinyint(1) unsigned NOT NULL default '0',
`redirect_type` ENUM('', '404', '301', '302') NOT NULL DEFAULT '',
`id_product_redirected` int(10) unsigned NOT NULL default '0',
`available_for_order` tinyint(1) NOT NULL default '1',
`available_date` date NOT NULL,
`condition` ENUM('new', 'used', 'refurbished') NOT NULL DEFAULT 'new',
@@ -1415,6 +1417,8 @@ CREATE TABLE IF NOT EXISTS `PREFIX_product_shop` (
`uploadable_files` tinyint(4) NOT NULL default '0',
`text_fields` tinyint(4) NOT NULL DEFAULT '0',
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
`redirect_type` ENUM('', '404', '301', '302') NOT NULL DEFAULT '',
`id_product_redirected` int(10) unsigned NOT NULL default '0',
`available_for_order` tinyint(1) NOT NULL DEFAULT '1',
`available_date` date NOT NULL,
`condition` enum('new','used','refurbished') NOT NULL DEFAULT 'new',
+9 -7
View File
@@ -29,6 +29,8 @@
<field name="uploadable_files"/>
<field name="text_fields"/>
<field name="active"/>
<field name="redirect_type"/>
<field name="id_product_redirected"/>
<field name="available_for_order"/>
<field name="available_date"/>
<field name="condition"/>
@@ -41,31 +43,31 @@
<field name="advanced_stock_management"/>
</fields>
<entities>
<product id="iPod_Nano" id_supplier="AppleStore" id_manufacturer="Apple_Computer_Inc" id_category_default="iPods" on_sale="0" online_only="0" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="124.581940" wholesale_price="70.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0.5" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<product id="iPod_Nano" id_supplier="AppleStore" id_manufacturer="Apple_Computer_Inc" id_category_default="iPods" on_sale="0" online_only="0" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="124.581940" wholesale_price="70.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0.5" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" redirect_type="" id_product_redirected="0" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<unity/>
<location/>
</product>
<product id="iPod_shuffle" id_supplier="AppleStore" id_manufacturer="Apple_Computer_Inc" id_category_default="iPods" on_sale="0" online_only="0" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="66.053500" wholesale_price="33.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<product id="iPod_shuffle" id_supplier="AppleStore" id_manufacturer="Apple_Computer_Inc" id_category_default="iPods" on_sale="0" online_only="0" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="66.053500" wholesale_price="33.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" redirect_type="" id_product_redirected="0" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<unity/>
<location/>
</product>
<product id="MacBook_Air" id_supplier="AppleStore" id_manufacturer="Apple_Computer_Inc" id_category_default="Laptops" on_sale="0" online_only="0" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="1504.180602" wholesale_price="1000.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="1.36" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<product id="MacBook_Air" id_supplier="AppleStore" id_manufacturer="Apple_Computer_Inc" id_category_default="Laptops" on_sale="0" online_only="0" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="1504.180602" wholesale_price="1000.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="1.36" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" redirect_type="" id_product_redirected="0" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<unity/>
<location/>
</product>
<product id="MacBook" id_supplier="AppleStore" id_manufacturer="Apple_Computer_Inc" id_category_default="Laptops" on_sale="0" online_only="0" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="1170.568561" wholesale_price="0.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0.75" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<product id="MacBook" id_supplier="AppleStore" id_manufacturer="Apple_Computer_Inc" id_category_default="Laptops" on_sale="0" online_only="0" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="1170.568561" wholesale_price="0.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0.75" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" redirect_type="" id_product_redirected="0" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<unity/>
<location/>
</product>
<product id="iPod_touch" id_supplier="" id_manufacturer="" id_category_default="iPods" on_sale="0" online_only="0" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="241.638796" wholesale_price="200.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<product id="iPod_touch" id_supplier="" id_manufacturer="" id_category_default="iPods" on_sale="0" online_only="0" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="241.638796" wholesale_price="200.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" redirect_type="" id_product_redirected="0" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<unity/>
<location/>
</product>
<product id="Belkin_Leather_Folio_for_iPod_nano_-_Black_Chocolate" id_supplier="" id_manufacturer="" id_category_default="Accessories" on_sale="0" online_only="1" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="25.041806" wholesale_price="0.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<product id="Belkin_Leather_Folio_for_iPod_nano_-_Black_Chocolate" id_supplier="" id_manufacturer="" id_category_default="Accessories" on_sale="0" online_only="1" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="25.041806" wholesale_price="0.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" redirect_type="" id_product_redirected="0" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<unity/>
<location/>
</product>
<product id="Shure_SE210_Sound-Isolating_Earphones_for_iPod_and_iPhone" id_supplier="Shure_Online_Store" id_manufacturer="Shure_Incorporated" id_category_default="Accessories" on_sale="0" online_only="1" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="124.581940" wholesale_price="0.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<product id="Shure_SE210_Sound-Isolating_Earphones_for_iPod_and_iPhone" id_supplier="Shure_Online_Store" id_manufacturer="Shure_Incorporated" id_category_default="Accessories" on_sale="0" online_only="1" ean13="0" upc="" ecotax="0.000000" quantity="0" minimal_quantity="1" price="124.581940" wholesale_price="0.000000" unit_price_ratio="0.000000" additional_shipping_cost="0.00" reference="" supplier_reference="" width="0" height="0" depth="0" weight="0" out_of_stock="2" quantity_discount="0" customizable="0" uploadable_files="0" text_fields="0" active="1" redirect_type="" id_product_redirected="0" available_for_order="1" available_date="0000-00-00" condition="new" show_price="1" indexed="0" cache_is_pack="0" cache_has_attachments="0" is_virtual="0" cache_default_attribute="0" advanced_stock_management="0">
<unity/>
<location/>
</product>
+5 -1
View File
@@ -6,4 +6,8 @@ ALTER TABLE `PREFIX_address` CHANGE `outstanding_allow_amount` `outstanding_all
/* PHP:block_category_1521(); */;
UPDATE `PREFIX_order_state` SET `delivery` = 0 WHERE `id_order_state` = 3 ;
UPDATE `PREFIX_order_state` SET `delivery` = 0 WHERE `id_order_state` = 3;
ALTER TABLE `PREFIX_product_shop` ADD `id_product_redirected` int(10) unsigned NOT NULL default '0' AFTER `active` , ADD `available_for_order` tinyint(1) NOT NULL default '1' AFTER `id_product_redirected`;
ALTER TABLE `PREFIX_product` ADD `id_product_redirected` int(10) unsigned NOT NULL default '0' AFTER `active` , ADD `available_for_order` tinyint(1) NOT NULL default '1' AFTER `id_product_redirected`;
+44 -3
View File
@@ -763,9 +763,8 @@ product_tabs['Attachments'] = new function(){
product_tabs['Informations'] = new function(){
var self = this;
this.bindAvailableForOrder = function (){
$("#available_for_order").click(function(){
$("#available_for_order").click(function()
{
if ($(this).is(':checked') || ($('input[name=\'multishop_check[show_price]\']').lenght && !$('input[name=\'multishop_check[show_price]\']').prop('checked')))
{
$('#show_price').attr('checked', true);
@@ -776,6 +775,37 @@ product_tabs['Informations'] = new function(){
$('#show_price').attr('disabled', false);
}
});
if ($('#active_on').prop('checked'))
{
showRedirectProductOptions(false);
showRedirectProductSelectOptions(false);
}
else
showRedirectProductOptions(true);
$('#redirect_type').change(function () {
redirectSelectChange();
});
$('#related_product_autocomplete_input')
.autocomplete('ajax_products_list.php?excludeIds='+id_product, {
minChars: 1,
autoFill: true,
max:20,
matchContains: true,
mustMatch:true,
scroll:false,
cacheLength:0,
formatItem: function(item) {
return item[0]+' - '+item[1];
}
}).result(function(e, i){
if(i != undefined)
addRelatedProduct(i[1], i[0]);
$(this).val('');
});
addRelatedProduct(id_product_redirected, product_name_redirected);
};
this.bindTagImage = function (){
@@ -1196,6 +1226,8 @@ product_tabs['Quantities'] = new function(){
self.refreshQtyAvailabilityForm();
self.ajaxCall({actionQty: 'out_of_stock', value: $(this).val()});
});
if (display_multishop_checkboxes)
ProductMultishop.checkAllQuantities();
self.refreshQtyAvailabilityForm();
};
@@ -1544,6 +1576,15 @@ var ProductMultishop = new function()
ProductMultishop.checkField($('input[name=\'multishop_check[link_rewrite]['+v.id_lang+']\']').prop('checked'), 'link_rewrite_'+v.id_lang);
});
};
this.checkAllQuantities = function()
{
$.each(languages, function(k, v)
{
ProductMultishop.checkField($('input[name=\'multishop_check[available_later]['+v.id_lang+']\']').prop('checked'), 'available_later_'+v.id_lang);
ProductMultishop.checkField($('input[name=\'multishop_check[available_now]['+v.id_lang+']\']').prop('checked'), 'available_now_'+v.id_lang);
});
};
this.checkAllAssociations = function()
{
+50
View File
@@ -571,6 +571,56 @@ function toggleDraftWarning(show)
$('.draft').show();
}
function showRedirectProductOptions(show)
{
if (show)
$('.redirect_product_options').fadeIn();
else
$('.redirect_product_options').fadeOut();
redirectSelectChange();
}
function redirectSelectChange()
{
if ($('#redirect_type :selected').val() == '404')
showRedirectProductSelectOptions(false);
else
showRedirectProductSelectOptions(true);
}
function addRelatedProduct(id_product_to_add, product_name)
{
if (!id_product_to_add || id_product == id_product_to_add)
return;
$('#related_product_name').html(product_name);
$('#related_product_name').parent('p').css('margin-top', 0);
$('input[name=id_product_redirected]').val(id_product_to_add);
$('#related_product_autocomplete_input').hide();
$('#related_product_remove').show();
}
function removeRelatedProduct()
{
$('#related_product_name').html(no_related_product);
$('#related_product_name').parent('p').css('margin-top', '0.5em');
$('input[name=id_product_redirected]').val(0);
$('#related_product_remove').hide();
$('#related_product_autocomplete_input').fadeIn();
}
function showRedirectProductSelectOptions(show)
{
if (show)
$('.redirect_product_options_product_choise').show();
else
{
$('.redirect_product_options_product_choise').hide();
removeRelatedProduct();
}
}
function showOptions(show)
{
if (show)
+1 -1
View File
@@ -57,7 +57,7 @@
<li class="item"><a href="{$cmslink.link|addslashes}" title="{$cmslink.meta_title|escape:'htmlall':'UTF-8'}">{$cmslink.meta_title|escape:'htmlall':'UTF-8'}</a></li>
{/if}
{/foreach}
<li id="header_link_sitemap"><a href="{$link->getPageLink('sitemap')}" title="{l s='sitemap' mod='blockpermanentlinks'}">{l s='Sitemap' mod='blockpermanentlinks'}</a></li>
<li><a href="{$link->getPageLink('sitemap')}" title="{l s='sitemap' mod='blockcms'}">{l s='Sitemap' mod='blockcms'}</a></li>
{if $display_poweredby}<li class="last_item">{l s='Powered by' mod='blockcms'} <a target="_blank" href="http://www.prestashop.com">PrestaShop</a>&trade;</li>{/if}
</ul>
{$footer_text}
+1 -1
View File
@@ -214,7 +214,7 @@ $(function(){ldelim}
<label for="other">{l s='Additional information'}</label>
<textarea id="other" name="other" cols="26" rows="3">{if isset($smarty.post.other)}{$smarty.post.other}{else}{if isset($address->other)}{$address->other}{/if}{/if}</textarea>
</p>
{if $onr_phone_at_least}
{if $one_phone_at_least}
<p class="inline-infos required">{l s='You must register at least one phone number'} <sup class="required">*</sup></p>
{/if}
<p class="text">
+2 -2
View File
@@ -548,7 +548,7 @@ $(function(){ldelim}
<label for="other">{l s='Additional information'}</label>
<textarea name="other" id="other" cols="26" rows="3">{if isset($smarty.post.other)}{$smarty.post.other}{/if}</textarea>
</p>
{if $onr_phone_at_least}
{if $one_phone_at_least}
<p class="inline-infos">{l s='You must register at least one phone number'}</p>
{/if}
<p class="text">
@@ -556,7 +556,7 @@ $(function(){ldelim}
<input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" />
</p>
<p class="text">
<label for="phone_mobile">{l s='Mobile phone'} {if $onr_phone_at_least}<sup>*</sup>{/if}</label>
<label for="phone_mobile">{l s='Mobile phone'} {if $one_phone_at_least}<sup>*</sup>{/if}</label>
<input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" />
</p>
<p class="required text" id="address_alias">
+3 -2
View File
@@ -147,7 +147,7 @@ function findCombination(firstTime)
//update display of the availability of the product AND the prices of the product
function updateDisplay()
{
if (!selectedCombination['unavailable'] && quantityAvailable > 0 && productAvailableForOrder === 1)
if (!selectedCombination['unavailable'] && quantityAvailable > 0 && parseInt(productAvailableForOrder) === 1)
{
//show the choice of quantities
$('#quantity_wanted_p:hidden').show('slow');
@@ -165,6 +165,7 @@ function updateDisplay()
//availability value management
if (availableNowValue !== '')
{
//update the availability statut of the product
$('#availability_value').removeClass('warning_inline');
$('#availability_value').text(availableNowValue);
@@ -689,7 +690,7 @@ function initLocationChange(time)
function checkUrl()
{
if (original_url !== window.location || first_url_check)
if (original_url != window.url || first_url_check)
{
first_url_check = false;
url = window.location+'';
+1 -1
View File
@@ -72,7 +72,7 @@
<div id="product_reference" {if isset($groups) OR !$product->reference}style="display: none;"{/if}>
<br />
<label for="product_reference">{l s='Reference:'} </label>
<label>{l s='Reference:'} </label>
<span class="editable">{$product->reference|escape:'htmlall':'UTF-8'}</span>
<br />
</div>
+4
View File
@@ -0,0 +1,4 @@
<?php
global $_LANGADM;
$_LANGADM = array();
?>
+4
View File
@@ -0,0 +1,4 @@
<?php
global $_ERRORS;
$_ERRORS = array();
?>
+4
View File
@@ -0,0 +1,4 @@
<?php
global $_FIELDS;
$_FIELDS = array();
?>
+4
View File
@@ -0,0 +1,4 @@
<?php
global $_LANGPDF;
$_LANGPDF = array();
?>
+4
View File
@@ -0,0 +1,4 @@
<?php
$tabs = array();
return $tabs;
?>