Comments (16)
No I didn't. You're good to go.๐๐ฝ
from liquid-ajax-cart.
@haroldao
Aha. So it means that your PJAX root element is not body but under it.
What if you subscribe to the page change event (i think it is possible) and remove the js-cart-open
class on every page change. I think it should be the only problem. All the other LAC classes depend on the cart state and shouldn't be changed after page change.
from liquid-ajax-cart.
I use "Operator" https://github.com/estrattonbailey/operator with Shopify Theme Lab https://github.com/uicrooks/shopify-theme-lab
from liquid-ajax-cart.
I don't use Slater but you can see Operator here (https://github.com/the-couch/slater/blob/master/packages/theme/src/scripts/router.js)
from liquid-ajax-cart.
Here's what I've got in my console
from liquid-ajax-cart.
Hey @haroldao . Can you guide me how I can replicate this issue on my local computer?
So as I understand I need to install the "shopify-theme-lab" theme, then install the "operator". Then I need to see the code how you use the operator and Liquid Ajax Cart.
Btw does this issue disappear if you remove the "operator" ?
from liquid-ajax-cart.
Here's the file where I imported L.A.C
from liquid-ajax-cart.
from liquid-ajax-cart.
@haroldao
Yeah, for sure it is not related to the Operator or any other package. It should be a problem with Webpack/Module system. I'll install the shopify-theme-lab tomorrow and try to import LAC. For now you can include LAC as you did it on the previous project โ using <script type="module">. After I find out what is the issue -- I let you know and you install LAC using npm again.
Can you also tell me if you did any changes in the "package.json" or any config files and if they are different from the current shopify-theme-lab repository?
from liquid-ajax-cart.
Side note : It's almost working (with your "manual" solution).... but when we change the page it's not working anymore since we have to "reload" the JS each time a page transition happens
from liquid-ajax-cart.
Hey @haroldao , I guess I found what was the issue. Can you please try if the updated version works for you:
https://github.com/EvgeniyMukhamedjanov/liquid-ajax-cart/blob/dev/docs/releases/liquid-ajax-cart-v1.10.1.js
Just download the file and put it next to the main.js and include it like this:
import './liquid-ajax-cart-v1.10.1.js';
and check if it works for you.
Please pay attention that Liquid Ajax Cart applies CSS classes to the body
tag. It means if your PJAX root element is the body
tag then after page change the classes will be missed. If it is the case then I can add an option to LAC to apply classes to the html
tag.
Once all is good I'll upload the v1.10.1 to npm as well.
from liquid-ajax-cart.
yeah it's working well
Okay that's fine. I'll get rid of PJAX for this project then.
from liquid-ajax-cart.
@haroldao
Why do you want to get rid of PJAX? LAC should work well with PJAX because LAC listens only document events thus you can change DOM as you want.
Does LAC work after PJAX page change?
from liquid-ajax-cart.
no it's not working well.
here's a quick example : When I click a button (to open the cart drawer) and I change the page, the class js-cart-open
is still set on the body
from liquid-ajax-cart.
Hey @haroldao
I've just updated the npm version, so you can remove the local file and install it from npm.
Let me know if it works for you and I'll close the issue then :-)
from liquid-ajax-cart.
thank you man
from liquid-ajax-cart.
Related Issues (19)
- data-ajax-cart-quantity-input with input[type="number"] and .stepUp() / .stepDown() HOT 14
- Clear errors on another product form when a different product form is submitted. HOT 1
- cart.item_count not updating on the first add to cart HOT 3
- Cart Item Count not updating when navigating back HOT 9
- The cart ajax is break when Shopify Markets is turned on. HOT 6
- Liquid Ajax Cart: the HTML for the "ajax-cart-section" section was requested but the response is null HOT 2
- Sometimes getting double add to cart requests HOT 2
- there is a data-ajax-cart-section element that is not inside a Shopify section
- Having a hard time getting a data-ajax-cart-section to update after ATC button clicks HOT 6
- Conditional doesn't work HOT 5
- How to implement discount code? HOT 2
- Add to cart event was firing twice
- cartRequestAdd doesn't work HOT 10
- add_to_cart event fires twice HOT 5
- Floating cart not updating on add to cart HOT 6
- Detect when a product has been removed from cart HOT 2
- Lazy Loading HOT 4
- No more than 2 times the same product in the cart HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquid-ajax-cart.