Comments (13)
Are there any plans on adding an ajax cart option as part of slate? specifically with ajax cart drawer functionality.
One of the goals of Slate is to focus on being an unopinionated starting point for developers. Timber was a starting point but was also was very opinionated about how it approached particular problems. Ultimately, this limited Timber's usefulness to developers who wanted to do things differently.
The problem with including AJAX Cart Drawer code (Liquid, CSS, and JS) inside Slate is that it would be a single, opinionated approach to a problem with tons of different solutions. Just look at the AJAX Cart Drawer in Brooklyn vs. Boundless vs. Narrative themes. They all try to solve the same problem, but do so in very different ways.
We are currently working on expanding cart.js
so that it has more helpful functions like cart.addItem()
, cart.changeItem()
, etc. The functions included in this file should make creating an AJAX cart a lot easier, while not being opinionated on how the Liquid and CSS is written. Hoping to have a PR open in the near future.
We are interested in exploring the best way to share helpful theme code (Liquid, CSS, and JS) like the AJAX Cart Drawer found in Timber, but do not feel that it's home should be inside of Slate. Any ideas and opinions on how this could be best done would be more then welcome 😄
Since timber is no longer being maintained, will my theme's ajax cart functionality possibly experience issues in the future?
The Timber AJAX Cart uses the Cart API. At Shopify, we always prioritize improving the platform without breaking backwards compatibility, so the Timber cart should continue to work just fine.
I think the Ajax cart itself could do with simplifying too.
@ptcampbell are you referring to the Cart API docs. If so, we totally agree and would like to improve and simplify them.
If you are referring to the the Liquid, CSS, and JS which make up the Timber AJAX Cart Drawer then we totally agree with that too! This is exactly why we need to let opinionated approaches to problems live in a separately so that they can grow and improve.
from slate.
For what it's worth, I think that Slate is still too opinionated on the styling side of things. For example, I don't think we need to get into the business of determining breakpoints, variables, mixins etc.
You're welcome to change those files (grid.scss
, variables.scss
) as you see fit @ptcampbell. grid.scss
generates class names like .grid__item
and .medium-up--one-half
, but those classes are nowhere in the markup of the template files. There's no expectation that you'll use our grid system, so you can easily swap it for your prefered one without having to remove class names in the HTML.
from slate.
Dropping in on this almost a year later. We are trying to bring in the the ajax-cart functionality but there seem to be way too many hiccups in getting it ported over. Has anyone on the slate team had any luck with it?
from slate.
+1 with this one. I think the Ajax cart itself could do with simplifying too.
from slate.
Hey, thanks for the response. I am happy to continue using Timber's cart.js for now.
For what it's worth, I think that Slate is still too opinionated on the styling side of things. For example, I don't think we need to get into the business of determining breakpoints, variables, mixins etc. I would always do that myself. So I ended up removing most of the imported stylesheets.
Thanks!
from slate.
Thanks for the feedback @ptcampbell!
from slate.
Cart.js is way to complicated for most developers to spin up their own ajax cart. Why can't the timber shopping cart be included into this project? It's frustrating to see Abandoned projects like timber. I'd love to use slate, but I don't want to spend months developing a custom ajax cart which a requirement of any shopify theme.
At the very least you can provide clean instructions for copying timber ajax cart into the slate theme and having it work?
Thank you.
from slate.
@ckizer thanks for your feedback! We are exploring ways of including 'learning by example' materials in the next version of Slate. This would be a good example to have.
from slate.
from slate.
Timber is open source so all the code you need is there. There is nothing special about the code that would stop it from working in Slate. It will just take time to identify what code is needed, copy it over, and get things working smoothly.
You're welcome to fork Slate and give it a shot! Like I said before, there is a chance we will explore this in the future as an example -- but when that will happen is still to be determined.
from slate.
Not from the slate team but I used Cart.js on OrientWatchUSA.com and it worked really nicely. Also, the Cart.js documentation provides support for rivetts which is a small DOM manipulation library for updating amounts directly on the cart slide out we created. For the panel, we simply used a tweening library to animate the different states. All in all it took us less than a few hours to set it up and getting working. It will do all of the Ajax handling and callbacks with a few lines of js.
from slate.
@yangkennyk I ported much of the timber ajax cart into a mini api that makes building an ajax cart relatively easy! https://github.com/the-couch/richer would love some support on extending it further but it's served my needs thus far.
from slate.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from slate.
Related Issues (20)
- Asset Server always binds to en0, even if it is not the "default" network interface.
- Slate is NOT uploading settings_data.json (since I edited it with CMS) HOT 3
- Cannot read property 'pop' of undefined HOT 4
- No template-based JS bundles are imported on Product and Collection template alternatives HOT 2
- Is Shopify theme developer experience the Internet Explorer of today? HOT 5
- ReferenceError: Unknown plugin "transform-async-to-generator"
- Is there a way to get chunking / code-splitting prefixed with the store's CDN url? HOT 1
- How to disable clearConsole() HOT 1
- Continued Support for Slate? HOT 9
- My styles are not reflecting on actual mobile device but reflects on google inspect tool
- SSL certificate script not working in ZSH HOT 1
- Does 0.x version of slate tool minify JS and CSS files
- bugsnag broke script on product page HOT 8
- Shopify theme : There is a layer of haze on my background pic
- IE 11 with Babel HOT 1
- yarn start not working on Ubuntu 2020 HOT 1
- slate: Classification Check HOT 1
- ReferenceError: primordials is not defined
- ARM64 (Apple M1) support HOT 6
- Variable not showing the correct picture
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 slate.