Paldru Posted December 26, 2014 Share Posted December 26, 2014 How can the cart block be hidden when there are no items in the cart? The cart should also be invisible as soon as all products are removed from the cart through the "remove_link" (line 86 in blockcart.tpl). I am able to hide the empty cart after reload, but not without reload. Link to comment Share on other sites More sharing options...
sandipchandela Posted January 7, 2015 Share Posted January 7, 2015 have you solved this issue? which version are you using ? Link to comment Share on other sites More sharing options...
Paldru Posted January 19, 2015 Author Share Posted January 19, 2015 have you solved this issue? which version are you using ? No, not solved yet. The version I am using is 1.6.0.11. Link to comment Share on other sites More sharing options...
sandipchandela Posted January 20, 2015 Share Posted January 20, 2015 (edited) you want to disable whole cart block ? if so then you have to write some jquery code for that. Check out cart-summary.js file in currently used theme/js directory. And also see jquery file located in js/modules/blockcart/ajax-cart.js. Edited January 20, 2015 by sandipchandela (see edit history) Link to comment Share on other sites More sharing options...
sandipchandela Posted January 20, 2015 Share Posted January 20, 2015 (edited) Just write the script line in below file. You will find below code lines in file around 470 line number. $("#header .cart_block").stop(true, true).slideUp(200); $('.cart_block_no_products:hidden').slideDown(450); $('.cart_block dl.products').remove(); Add this line. $('.shopping_cart').hide(); Edited January 20, 2015 by sandipchandela (see edit history) Link to comment Share on other sites More sharing options...
Ankit Gupta Posted March 19, 2015 Share Posted March 19, 2015 Which file I've to edit in order to auto hide cart when it is empty? Link to comment Share on other sites More sharing options...
sandipchandela Posted March 19, 2015 Share Posted March 19, 2015 You need to change the following file : blockcart - module Change file name - blockcart.tpl 1 Link to comment Share on other sites More sharing options...
Ankit Gupta Posted March 19, 2015 Share Posted March 19, 2015 (edited) Hey sandipchandela, I cannot find $("#header .cart_block").stop(true, true).slideUp(200);$('.cart_block_no_products:hidden').slideDown(450);$('.cart_block dl.products').remove(); anything related to this in blockcart.tpl :/ Edited March 19, 2015 by Ankit Gupta (see edit history) Link to comment Share on other sites More sharing options...
sandipchandela Posted March 20, 2015 Share Posted March 20, 2015 Hey sandipchandela, I cannot find $("#header .cart_block").stop(true, true).slideUp(200); $('.cart_block_no_products:hidden').slideDown(450); $('.cart_block dl.products').remove(); anything related to this in blockcart.tpl :/ File name- ajax-cart.js located in following folder. Location - \prestashop\themes\default-bootstrap\js\modules\blockcart $('.shopping_cart').hide(); Link to comment Share on other sites More sharing options...
boris257 Posted August 3, 2015 Share Posted August 3, 2015 Hi everybody, adding the line (470)... $('.shopping_cart').hide(); ...do the job (file : \prestashop\themes\default-bootstrap\js\modules\blockcart) But i don't want the cart be displayed when first loading the home page ... the cart is empty but displayed ! What can i do to fix this = not display the cart whenever it's empty... that's mean also when first time loading the home page? Thanks. Cheers Link to comment Share on other sites More sharing options...
clint Posted August 4, 2015 Share Posted August 4, 2015 (edited) Hi, There is a much much more simple way to do this in blockcart.tpl above <div class="shopping_cart"> put {if $cart_qties >= 1} and then close it off with {/if} at about line 200 after the closing div That way it won't be loaded till the cart is equal to or greater than 1 item. The pop up confirmation will still load as this is outside the {if $cart_qties >= 1}...{/if} Regards Clint Edited August 4, 2015 by clint (see edit history) Link to comment Share on other sites More sharing options...
boris257 Posted August 4, 2015 Share Posted August 4, 2015 Hi, Thank you Clint... i tried it.. seems to work.. but one drawback : when you put your first product in the cart you need to refresh/reload the page (or change page) in order to see the cart with your product.... I need the cart to be viewed/displayed once the cart is not empty. Thanks for your help. cheers 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