engineerHopf Posted June 23, 2014 Share Posted June 23, 2014 Hi All! I am currently working for an online store, and I've been doing some modifications. At the time of being in the shopping cart with the products chosen by the user, showing the specific product, the total weight of all the stock, everything is ok until now., the problem is this: If you increase or decreases the amount of any product, the total weight does not change, and for that to happen you must manually refresh the page. Any idea how I fix it? This is the code: <td class="cart_quantity" colspan="2"> {if isset($cannotModify) AND $cannotModify == 1} <span>{if $quantityDisplayed == 0 AND isset($customizedDatas.$productId.$productAttributeId)}{$customizedDatas.$productId.$productAttributeId|@count}{else}{$product.cart_quantity-$quantityDisplayed}{/if}</span> {else} <input type="hidden" value="{$customization.quantity}" name="quantity_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}_{$product.id_address_delivery|intval}_hidden"/> <input type="text" value="{$customization.quantity}" class="cart_quantity_input form-control grey" name="quantity_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}_{$product.id_address_delivery|intval}"/> <div class="cart_quantity_button clearfix"> {if $product.minimal_quantity < ($customization.quantity -$quantityDisplayed) OR $product.minimal_quantity <= 1} <a id="cart_quantity_down_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}_{$product.id_address_delivery|intval}" class="cart_quantity_down btn btn-default button-minus" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery}&id_customization={$id_customization}&op=down&token={$token_cart}")|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Subtract'}"> <span><i class="icon-minus"></i></span> </a> {else} <a id="cart_quantity_down_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}" class="cart_quantity_down btn btn-default button-minus disabled" href="#" title="{l s='Subtract'}"> <span><i class="icon-minus"></i></span> </a> {/if} <a id="cart_quantity_up_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}_{$product.id_address_delivery|intval}" class="cart_quantity_up btn btn-default button-plus" href="{$link->getPageLink('cart', true, NULL, "add=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery}&id_customization={$id_customization}&token={$token_cart}")|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add'}"> <span><i class="icon-plus"></i></span> </a> </div> {/if} </td> PS: Sorry for my english, im learning Link to comment Share on other sites More sharing options...
engineerHopf Posted June 23, 2014 Author Share Posted June 23, 2014 This is the code, to calculate the total Weight: {if $product->weight>0} <div class="product_weight" > <h1>{l s='Product weight: ' js=1}{sprintf("%.2f",$product ->weight)} {Configuration::get('PS_WEIGHT_UNIT')} </h1> </div> {/if} Link to comment Share on other sites More sharing options...
Alugart Posted August 4, 2014 Share Posted August 4, 2014 wow, you managed to add that total weight thing into shopping cart! could you please post here 1 post how you did that? What files you edited and what you have added! 1 Link to comment Share on other sites More sharing options...
oskar86 Posted October 5, 2014 Share Posted October 5, 2014 Hi, have a look here, I have weight update working correctly in shopping cart(my PS v. 1.6.0.9): http://www.prestashop.com/forums/topic/45353-solved-how-to-show-weight-of-the-order-in-shopping-cart/page-3 Link to comment Share on other sites More sharing options...
Claudiocool Posted March 26, 2017 Share Posted March 26, 2017 Hi, have a look here, I have weight update working correctly in shopping cart(my PS v. 1.6.0.9): http://www.prestashop.com/forums/topic/45353-solved-how-to-show-weight-of-the-order-in-shopping-cart/page-3 Hi Oskar86, does the weight change, when products are added or removed directly in the cart? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now