[*] BO : add an available date when product is out of stock
This commit is contained in:
@@ -99,7 +99,7 @@
|
||||
float: right
|
||||
}
|
||||
#primary_block #buy_block span.our_price_display { float: right }
|
||||
#primary_block #buy_block span#availability_label {
|
||||
#primary_block #buy_block span#availability_label, #primary_block #buy_block span#availability_date_label {
|
||||
float: left;
|
||||
margin-right: 1em
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ function oosHookJsCode()
|
||||
}
|
||||
|
||||
//add a combination of attributes in the global JS sytem
|
||||
function addCombination(idCombination, arrayOfIdAttributes, quantity, price, ecotax, id_image, reference, unit_price, minimal_quantity)
|
||||
function addCombination(idCombination, arrayOfIdAttributes, quantity, price, ecotax, id_image, reference, unit_price, minimal_quantity, available_date_combi)
|
||||
{
|
||||
globalQuantity += quantity;
|
||||
|
||||
@@ -64,6 +64,7 @@ function addCombination(idCombination, arrayOfIdAttributes, quantity, price, eco
|
||||
combination['reference'] = reference;
|
||||
combination['unit_price'] = unit_price;
|
||||
combination['minimal_quantity'] = minimal_quantity;
|
||||
combination['available_date_combi'] = available_date_combi;
|
||||
combinations.push(combination);
|
||||
|
||||
}
|
||||
@@ -119,6 +120,9 @@ function findCombination(firstTime)
|
||||
if (combinations[combination]['image'] && combinations[combination]['image'] != -1)
|
||||
displayImage( $('#thumb_'+combinations[combination]['image']).parent() );
|
||||
|
||||
//get available_date for combination product
|
||||
selectedCombination['available_date_combi'] = combinations[combination]['available_date_combi'];
|
||||
|
||||
//update the display
|
||||
updateDisplay();
|
||||
|
||||
@@ -163,6 +167,10 @@ function updateDisplay()
|
||||
|
||||
//hide the hook out of stock
|
||||
$('#oosHook').hide();
|
||||
|
||||
//hide availability date
|
||||
$('#availability_date_label').hide();
|
||||
$('#availability_date_value').hide();
|
||||
|
||||
//availability value management
|
||||
if (availableNowValue != '')
|
||||
@@ -233,7 +241,25 @@ function updateDisplay()
|
||||
$('#oosHook').hide();
|
||||
}
|
||||
$('#availability_statut:hidden').show();
|
||||
|
||||
|
||||
//display availability date
|
||||
var date_combi = selectedCombination['available_date_combi'];
|
||||
tab_date = date_combi.split('-');
|
||||
var time_combi = new Date(tab_date[2], tab_date[1], tab_date[0]);
|
||||
time_combi.setMonth(time_combi.getMonth()-1);
|
||||
var now = new Date();
|
||||
// date displayed only if time_combi
|
||||
if (now.getTime() < time_combi.getTime())
|
||||
{
|
||||
$('#availability_date_value').text(selectedCombination['available_date_combi']);
|
||||
$('#availability_date_label').show();
|
||||
$('#availability_date_value').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#availability_date_label').hide();
|
||||
$('#availability_date_value').hide();
|
||||
}
|
||||
|
||||
//show the 'add to cart' button ONLY IF it's possible to buy when out of stock AND if it was previously invisible
|
||||
if (allowBuyWhenOutOfStock && !selectedCombination['unavailable'] && productAvailableForOrder == 1)
|
||||
|
||||
@@ -414,9 +414,9 @@ $_LANG['order-opc-new-account_bd9014fe70f4f8bb1beed74e3b708483'] = 'Code postal'
|
||||
$_LANG['order-opc-new-account_57d056ed0984166336b7879c2af3657f'] = 'Ville';
|
||||
$_LANG['order-opc-new-account_59716c97497eb9694541f7c3d37b1a4d'] = 'Pays';
|
||||
$_LANG['order-opc-new-account_7cb32e708d6b961d476baced73d362bb'] = 'Numéro de TVA';
|
||||
$_LANG['order-opc-new-account_46a2a41cc6e552044816a2d04634545d'] = 'État';
|
||||
$_LANG['order-opc-new-account_b60bb13a87fe3ae5463aeb0980a5a8a1'] = 'Numéro d\'identification fiscale';
|
||||
$_LANG['order-opc-new-account_ea318a4ad37f0c2d2c368e6c958ed551'] = 'DNI / NIF / NIE';
|
||||
$_LANG['order-opc-new-account_46a2a41cc6e552044816a2d04634545d'] = 'État';
|
||||
$_LANG['order-opc-new-account_0f68b904e33d9ac04605aecc958bcf52'] = 'Informations complémentaires';
|
||||
$_LANG['order-opc-new-account_fe66abce284ec8589e7d791185b5c442'] = 'Téléphone';
|
||||
$_LANG['order-opc-new-account_41c2fff4867cc204120f001e7af20f7a'] = 'Téléphone portable';
|
||||
@@ -449,7 +449,6 @@ $_LANG['order-payment_f5bf48aa40cad7891eb709fcf1fde128'] = 'produit';
|
||||
$_LANG['order-payment_86024cad1e83101d97359d7351051156'] = 'produits';
|
||||
$_LANG['order-payment_59319ac504f7ad04ae16126cf49e7f7e'] = 'Votre méthode de paiement';
|
||||
$_LANG['order-payment_9e6d9b3daa15e41d36806a289c42674d'] = 'Choisissez votre méthode de paiement';
|
||||
$_LANG['order-payment_df33aeec3bf8aa7e8c63b2c4b04898c5'] = 'Merci de choisir votre moyen de paiement afin de régler la somme de';
|
||||
$_LANG['order-payment_1f87346a16cf80c372065de3c54c86d9'] = 'TTC';
|
||||
$_LANG['order-payment_8e1263b23607508e7ba8ff39aec8031d'] = 'Aucun module de paiement n\'a encore été installé.';
|
||||
$_LANG['order-payment_dd1f775e443ff3b9a89270713580a51b'] = 'Précédent';
|
||||
@@ -563,6 +562,7 @@ $_LANG['product_2c59ffd0a6631127450d729861975719'] = 'Quantité :';
|
||||
$_LANG['product_07d814a3df5cfd2d637e77b215519034'] = 'Vous devez ajouter au minimum ';
|
||||
$_LANG['product_f3bbad73b35f19730399b3da21c3ef32'] = ' quantités pour acheter ce produit.';
|
||||
$_LANG['product_8c751c4aab0db0b811cdfbddf0b4ea56'] = 'Disponibilité :';
|
||||
$_LANG['product_0aaaa7c13d1b589640482d1e53135eb4'] = 'Réapprovisionnement le:';
|
||||
$_LANG['product_4b98be16b76b0941840140f2043432a9'] = 'pièce disponible';
|
||||
$_LANG['product_e16d56df08bbd47e53e153fc6dfc8ad8'] = 'pièces disponibles';
|
||||
$_LANG['product_0d83f0026f6d2923b2aa3a208156918c'] = 'Attention : dernières pièces disponibles !';
|
||||
@@ -573,8 +573,8 @@ $_LANG['product_8beee69f53dcd358f9e333de43a3f506'] = 'quantités';
|
||||
$_LANG['product_221d2a4bfdae13dbd5aeff3b02adb8c1'] = 'quantité';
|
||||
$_LANG['product_71948aa4f6e12cdaa5e2e63a5eb8f142'] = 'En savoir plus';
|
||||
$_LANG['product_7dcd185f890fd28f69d1ed210292d77f'] = 'Fiche technique';
|
||||
$_LANG['product_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Télécharger';
|
||||
$_LANG['product_98edb85b00d9527ad5acebe451b3fae6'] = 'Accessoires';
|
||||
$_LANG['product_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Télécharger';
|
||||
$_LANG['product_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Plus';
|
||||
$_LANG['product_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir';
|
||||
$_LANG['product_cb3c718c905f00adbb6735f55bfb38ef'] = 'Disponible avec différentes options';
|
||||
|
||||
@@ -108,7 +108,7 @@ var fieldRequired = '{l s='Please fill in all required fields, then save the cus
|
||||
{if isset($groups)}
|
||||
// Combinations
|
||||
{foreach from=$combinations key=idCombination item=combination}
|
||||
addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}', {$combination.unit_impact}, {$combination.minimal_quantity});
|
||||
addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}', {$combination.unit_impact}, {$combination.minimal_quantity}, '{$combination.available_date_combi}');
|
||||
{/foreach}
|
||||
// Colors
|
||||
{if $colors|@count > 0}
|
||||
@@ -340,6 +340,11 @@ var fieldRequired = '{l s='Please fill in all required fields, then save the cus
|
||||
<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>
|
||||
{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}
|
||||
</span>
|
||||
|
||||
{if ($product->available_date && $product->available_date != 0) && ($product->available_date|date_format:"%Y-%m-%d" >= $smarty.now|date_format:"%Y-%m-%d") && $product->quantity <= 0}<br /><span id="availability_date_label">{l s='Restocking:'}</span><span id="availability_date_value" class="success_inline">{$product->available_date|date_format:"%d-%m-%Y"}</span>
|
||||
{else}
|
||||
<br /><span id="availability_date_label" style="display:none;">{l s='Restocking:'}</span><span id="availability_date_value" class="success_inline" style="display:none;">{$product->available_date|date_format:"%d-%m-%Y"}</span>
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
<!-- number of item in stock -->
|
||||
|
||||
Reference in New Issue
Block a user