Giter Site home page Giter Site logo

Plans for ajax cart? about slate HOT 13 CLOSED

shopify avatar shopify commented on August 19, 2024 2
Plans for ajax cart?

from slate.

Comments (13)

t-kelly avatar t-kelly commented on August 19, 2024 4

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.

NathanPJF avatar NathanPJF commented on August 19, 2024 4

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.

leofrozenyogurt avatar leofrozenyogurt commented on August 19, 2024 2

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.

ptcampbell avatar ptcampbell commented on August 19, 2024

+1 with this one. I think the Ajax cart itself could do with simplifying too.

from slate.

ptcampbell avatar ptcampbell commented on August 19, 2024

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.

t-kelly avatar t-kelly commented on August 19, 2024

Thanks for the feedback @ptcampbell!

from slate.

ckizer avatar ckizer commented on August 19, 2024

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.

t-kelly avatar t-kelly commented on August 19, 2024

@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.

ckizer avatar ckizer commented on August 19, 2024

from slate.

t-kelly avatar t-kelly commented on August 19, 2024

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.

el-rotny avatar el-rotny commented on August 19, 2024

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.

iamkevingreen avatar iamkevingreen commented on August 19, 2024

@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.

lock avatar lock commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.