[-] FO : #PSFV-272 - Add translation + try to not increase global qty of product on choosing "Ship to multiple addresses"

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11986 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-01-02 13:35:42 +00:00
parent 2e09799884
commit e7e22788e7
6 changed files with 43 additions and 19 deletions
+20 -8
View File
@@ -2884,14 +2884,26 @@ class CartCore extends ObjectModel
if (!$keep_quantity)
{
$sql = 'UPDATE '._DB_PREFIX_.'cart_product
SET `quantity` = `quantity` - '.(int)$quantity.'
WHERE id_cart = '.(int)$this->id.'
AND id_product = '.(int)$id_product.'
AND id_shop = '.(int)$this->id_shop.'
AND id_product_attribute = '.(int)$id_product_attribute.'
AND id_address_delivery = '.(int)$id_address_delivery;
Db::getInstance()->execute($sql);
$sql = new DbQuery();
$sql->select('quantity');
$sql->from('cart_product', 'c');
$sql->where('id_product = '.(int)$id_product);
$sql->where('id_product_attribute = '.(int)$id_product_attribute);
$sql->where('id_address_delivery = '.(int)$id_address_delivery);
$sql->where('id_cart = '.(int)$this->id);
$duplicatedQuantity = Db::getInstance()->getValue($sql);
if ($duplicatedQuantity > $quantity) {
$sql = 'UPDATE '._DB_PREFIX_.'cart_product
SET `quantity` = `quantity` - '.(int)$quantity.'
WHERE id_cart = '.(int)$this->id.'
AND id_product = '.(int)$id_product.'
AND id_shop = '.(int)$this->id_shop.'
AND id_product_attribute = '.(int)$id_product_attribute.'
AND id_address_delivery = '.(int)$id_address_delivery;
Db::getInstance()->execute($sql);
}
}
// Checking if there is customizations
+1 -3
View File
@@ -153,9 +153,7 @@ class CartControllerCore extends FrontController
$this->id_product,
$this->id_product_attribute,
$this->id_address_delivery,
(int)Tools::getValue('new_id_address_delivery'),
1,
true
(int)Tools::getValue('new_id_address_delivery')
)
)
{
+1 -1
View File
@@ -67,7 +67,7 @@ function cleanSelectAddressDelivery()
if (address_count < 2) // Need at least two address to allow skipping products to multiple address
$($(item).find('option[value=-2]')).remove();
else if($($(item).find('option[value=-2]')).length == 0)
$(item).append($('<option value="-2">Ship to an other address</option>')); // @todo add translation
$(item).append($('<option value="-2">' + ShipToAnOtherAddress + '</option>'));
});
}
}
+13
View File
@@ -707,9 +707,22 @@ function multishippingMode(it)
cleanSelectAddressDelivery();
$('#fancybox-content').append($('<div class="multishipping_close_container"><a id="multishipping-close" class="button_large" href="#">' + CloseTxt + '</a></div>'));
$('#multishipping-close').click(function() {
var newTotalQty = 0;
$('#fancybox-content .cart_quantity_input').each(function(){
newTotalQty += parseInt($(this).val());
});
if (newTotalQty != totalQty) {
if(!confirm(QtyChanged)) {
return false;
}
}
$.fancybox.close();
return false;
});
totalQty = 0;
$('#fancybox-content .cart_quantity_input').each(function(){
totalQty += parseInt($(this).val());
});
}
});
}
+6 -7
View File
@@ -26,9 +26,9 @@ $_LANG['address_57d056ed0984166336b7879c2af3657f'] = 'Ville';
$_LANG['address_59716c97497eb9694541f7c3d37b1a4d'] = 'Pays';
$_LANG['address_46a2a41cc6e552044816a2d04634545d'] = 'Etat';
$_LANG['address_0f68b904e33d9ac04605aecc958bcf52'] = 'Informations supplémentaires';
$_LANG['address_39916f579f264041641c122e68e545d5'] = 'Vous devez enregistrer au moins un numéro de téléphone';
$_LANG['address_fe66abce284ec8589e7d791185b5c442'] = 'Téléphone domicile';
$_LANG['address_41c2fff4867cc204120f001e7af20f7a'] = 'Téléphone portable';
$_LANG['address_39916f579f264041641c122e68e545d5'] = 'Vous devez enregistrer au moins un numéro de téléphone';
$_LANG['address_6c1c4d5a22e3d6ed8385e7287233396f'] = 'Donnez un titre à cette adresse pour la retrouver plus facilement';
$_LANG['address_ae7bdef7fe2bbbbf02c11e92c5fceb40'] = 'Mon adresse';
$_LANG['address_c9cc8cce247e49bae79f15173ce97354'] = 'Valider';
@@ -102,9 +102,9 @@ $_LANG['authentication_6a1fdb6502fefe71937a62c4d03a810e'] = 'Numéro dans la rue
$_LANG['authentication_846a54955f32846032981f8fe48c35ff'] = 'Adresse (2)';
$_LANG['authentication_092daa39d2b825e4a7fe9b31c2080ecb'] = 'Appartement, suite, l\'unité, bâtiment, étage, etc';
$_LANG['authentication_0f68b904e33d9ac04605aecc958bcf52'] = 'Informations complémentaires';
$_LANG['authentication_39916f579f264041641c122e68e545d5'] = 'Vous devez enregistrer au moins un numéro de téléphone';
$_LANG['authentication_fe66abce284ec8589e7d791185b5c442'] = 'Téléphone domicile';
$_LANG['authentication_41c2fff4867cc204120f001e7af20f7a'] = 'Téléphone portable';
$_LANG['authentication_39916f579f264041641c122e68e545d5'] = 'Vous devez enregistrer au moins un numéro de téléphone';
$_LANG['authentication_6c1c4d5a22e3d6ed8385e7287233396f'] = 'Donnez un titre à cette adresse pour la retrouver plus facilement';
$_LANG['authentication_0ba7583639a274c434bbe6ef797115a4'] = 'S\'inscrire';
$_LANG['best-sales_3cb29f0ccc5fd220a97df89dafe46290'] = 'Meilleures ventes';
@@ -273,6 +273,9 @@ $_LANG['nbr-product-page_74dd2b447f2f9a892177430fd5bf54a0'] = 'produits par page
$_LANG['new-products_9ff0635f5737513b1a6f559ac2bff745'] = 'Nouveaux produits';
$_LANG['new-products_d58424783355b6da2dedc302f2bf4065'] = 'Pas de nouveaux produits';
$_LANG['order-address-multishipping-products_b669d5bfee7c83844d00c007ef74cd2a'] = 'Choisissez une adresse de livraison :';
$_LANG['order-address-multishipping-products_a4d3b161ce1309df1c4e25df28694b7b'] = 'Valider';
$_LANG['order-address-multishipping-products_d996b18c94522e076065f992ba9a49e4'] = 'Les quantités de certain produits ont été changée, merci de les vérifier.';
$_LANG['order-address-multishipping-products_713abca3b7abddc0445099b23c0a3697'] = 'Livrer à plusieurs adresses';
$_LANG['order-address-multishipping-products_deb10517653c255364175796ace3553f'] = 'Produit';
$_LANG['order-address-multishipping-products_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description';
$_LANG['order-address-multishipping-products_12d3c7a4296542c62474856ec452c045'] = 'Ref.';
@@ -338,8 +341,6 @@ $_LANG['order-carrier_1f87346a16cf80c372065de3c54c86d9'] = 'TTC';
$_LANG['order-carrier_21034ae6d01a83e702839a72ba8a77b0'] = 'HT';
$_LANG['order-carrier_c7ffdc38ef6b1ecee2c12c01aa7566b0'] = 'Il n\'y a pas de transporteurs disponibles pour certaines de vos adresses.';
$_LANG['order-carrier_8f90815af11493295587f91f571c2f95'] = 'Il n\'y a pas de transporteur disponible qui délivre à cette adresse.';
$_LANG['order-carrier_21034ae6d01a83e702839a72ba8a77b0'] = 'HT';
$_LANG['order-carrier_8f90815af11493295587f91f571c2f95'] = 'Il n\'y a pas de transporteur disponible qui délivre à cette adresse.';
$_LANG['order-carrier_0d9175fe89fb80d815e7d03698b6e83a'] = 'Cadeau';
$_LANG['order-carrier_ea3bd794dfeb4537c194ee43899516ed'] = 'Je souhaite que ma commande soit emballée dans un papier-cadeau.';
$_LANG['order-carrier_5c2dfd55fea1f5c6adef500fcb6403b4'] = 'Supp. de';
@@ -656,7 +657,6 @@ $_LANG['product_7dcd185f890fd28f69d1ed210292d77f'] = 'Fiche technique';
$_LANG['product_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Télécharger';
$_LANG['product_98edb85b00d9527ad5acebe451b3fae6'] = 'Accessoires';
$_LANG['product_54c02ba7929b1fda4847991a45b58a48'] = 'Personnalisation';
$_LANG['product_98edb85b00d9527ad5acebe451b3fae6'] = 'Accessoires';
$_LANG['product_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Plus';
$_LANG['product_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir';
$_LANG['product_cb3c718c905f00adbb6735f55bfb38ef'] = 'Disponible avec différentes options';
@@ -730,10 +730,9 @@ $_LANG['shopping-cart_444bcb3a3fcf8389296c49467f27e1d6'] = 'ok';
$_LANG['shopping-cart_f7b96335c6a33477579e43f3da368507'] = 'Profitez de nos offres :';
$_LANG['shopping-cart_66c4c5112f455a19afde47829df363fa'] = 'Total :';
$_LANG['shopping-cart_2fb3b950fd7711136f7f251ae5fbdbdc'] = 'Texte n°';
$_LANG['shopping-cart_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
$_LANG['shopping-cart_c8cd21bd2e33378f10611bc4498cf96f'] = 'Supprimer cette personnalisation';
$_LANG['shopping-cart_ec211f7c20af43e742bf2570c3cb84f9'] = 'Ajouter';
$_LANG['shopping-cart_1d9baf077ee87921f57a8fe42d510b65'] = 'Enlever';
$_LANG['shopping-cart_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
$_LANG['shopping-cart_af0f5bdc5be121b9307687aeeae38c17'] = 'Adresse de livraison';
$_LANG['shopping-cart_601d8c4b9f72fc1862013c19b677a499'] = 'Adresse de facturation';
$_LANG['shopping-cart_10ac3d04253ef7e1ddc73e6091c0cd55'] = 'Suivant';
@@ -26,6 +26,8 @@
<p>{l s='Choose the delivery addresses:'}</p>
<script type="text/javascript">
CloseTxt = '{l s='Submit'}';
QtyChanged = '{l s='Some product quantities has changed, please check them.'}';
ShipToAnOtherAddress = '{l s='Ship to multiple addresses'}';
</script>
<div id="order-detail-content" class="table_block">
<table id="cart_summary" class="std">