This repository was archived by the owner on Dec 1, 2020. It is now read-only.
[*] Project : refactoring all javascript s code about the module blockcart #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update: Solved merge issue of this one PrestaShop/PrestaShop#1829
Ok this is a big one.
It's a first step but really necessary. All the website I had to do with prestashop, the blockcart is allways the longer and the hardest part to integrate. Even if you want to just override the javascript from the template you have to read all the javascrpti code to copy past only the needed part and remove all the template-related interraction.
So the main idea here is to begin by separate the data part (ajax-cart.js) and the interaction part (blockcart.js). I also made a huge effort into the comment part for the ajax-cart.js functions.
With that you will just need to override the blockcart.js file and call the function from the ajax-cart.js. You don't need to go through a dirty javascript file to pull out the data call in way to interact with your custom template !
Every input is very welcome because for me the cart part of every shop I made is a least 30% of the time I past in the template part of a Prestashop.
Hope you will enjoy and contribute and sorry for my poor English ;)