[+] FO : Missing old default templates
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
@@ -0,0 +1,63 @@
|
||||
$(document).ready(function()
|
||||
{
|
||||
bindStateInputAndUpdate();
|
||||
});
|
||||
|
||||
function bindStateInputAndUpdate()
|
||||
{
|
||||
$('.id_state, .dni, .postcode').css({'display':'none'});
|
||||
updateState();
|
||||
updateNeedIDNumber();
|
||||
updateZipCode();
|
||||
|
||||
$('select#id_country').change(function(){
|
||||
updateState();
|
||||
updateNeedIDNumber();
|
||||
updateZipCode();
|
||||
});
|
||||
|
||||
if ($('select#id_country_invoice').length !== 0)
|
||||
{
|
||||
$('select#id_country_invoice').change(function(){
|
||||
updateState('invoice');
|
||||
updateNeedIDNumber('invoice');
|
||||
updateZipCode('invoice');
|
||||
});
|
||||
updateState('invoice');
|
||||
updateNeedIDNumber('invoice');
|
||||
updateZipCode('invoice');
|
||||
}
|
||||
}
|
||||
|
||||
function updateState(suffix)
|
||||
{
|
||||
$('select#id_state'+(suffix !== undefined ? '_'+suffix : '')+' option:not(:first-child)').remove();
|
||||
var states = countries[$('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val()];
|
||||
if(typeof(states) !== 'undefined')
|
||||
{
|
||||
$(states).each(function (key, item){
|
||||
$('select#id_state'+(suffix !== undefined ? '_'+suffix : '')).append('<option value="'+item.id+'"'+ (idSelectedCountry === item.id ? ' selected="selected"' : '') + '>'+item.name+'</option>');
|
||||
});
|
||||
$('.id_state'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow');;
|
||||
}
|
||||
else
|
||||
$('.id_state'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast');
|
||||
}
|
||||
|
||||
function updateNeedIDNumber(suffix)
|
||||
{
|
||||
var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val());
|
||||
if ($.inArray(idCountry, countriesNeedIDNumber) >= 0)
|
||||
$('.dni'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow');
|
||||
else
|
||||
$('.dni'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast');
|
||||
}
|
||||
|
||||
function updateZipCode(suffix)
|
||||
{
|
||||
var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val());
|
||||
if (countriesNeedZipCode[idCountry] !== 0)
|
||||
$('.postcode'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow');
|
||||
else
|
||||
$('.postcode'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast');
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
//animate the opening of the branch (span.grower jQueryElement)
|
||||
function openBranch(jQueryElement, noAnimation) {
|
||||
jQueryElement.addClass('OPEN').removeClass('CLOSE');
|
||||
if(noAnimation)
|
||||
jQueryElement.parent().find('ul:first').show();
|
||||
else
|
||||
jQueryElement.parent().find('ul:first').slideDown();
|
||||
}
|
||||
//animate the closing of the branch (span.grower jQueryElement)
|
||||
function closeBranch(jQueryElement, noAnimation) {
|
||||
jQueryElement.addClass('CLOSE').removeClass('OPEN');
|
||||
if(noAnimation)
|
||||
jQueryElement.parent().find('ul:first').hide();
|
||||
else
|
||||
jQueryElement.parent().find('ul:first').slideUp();
|
||||
}
|
||||
|
||||
//animate the closing or opening of the branch (ul jQueryElement)
|
||||
function toggleBranch(jQueryElement, noAnimation) {
|
||||
if(jQueryElement.hasClass('OPEN'))
|
||||
closeBranch(jQueryElement, noAnimation);
|
||||
else
|
||||
openBranch(jQueryElement, noAnimation);
|
||||
}
|
||||
|
||||
//when the page is loaded...
|
||||
$(document).ready(function () {
|
||||
//to do not execute this script as much as it's called...
|
||||
if(!$('ul.tree.dhtml').hasClass('dynamized'))
|
||||
{
|
||||
//add growers to each ul.tree elements
|
||||
$('ul.tree.dhtml ul').prev().before("<span class='grower OPEN'> </span>");
|
||||
|
||||
//dynamically add the '.last' class on each last item of a branch
|
||||
$('ul.tree.dhtml ul li:last-child, ul.tree.dhtml li:last-child').addClass('last');
|
||||
|
||||
//collapse every expanded branch
|
||||
$('ul.tree.dhtml span.grower.OPEN').addClass('CLOSE').removeClass('OPEN').parent().find('ul:first').hide();
|
||||
$('ul.tree.dhtml').show();
|
||||
|
||||
//open the tree for the selected branch
|
||||
$('ul.tree.dhtml .selected').parents().each( function() {
|
||||
if ($(this).is('ul'))
|
||||
toggleBranch($(this).prev().prev(), true);
|
||||
});
|
||||
toggleBranch( $('ul.tree.dhtml .selected').prev(), true);
|
||||
|
||||
//add a fonction on clicks on growers
|
||||
$('ul.tree.dhtml span.grower').click(function(){
|
||||
toggleBranch($(this));
|
||||
});
|
||||
//mark this 'ul.tree' elements as already 'dynamized'
|
||||
$('ul.tree.dhtml').addClass('dynamized');
|
||||
|
||||
$('ul.tree.dhtml').removeClass('dhtml');
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user