{"id":13759635,"url":"https://github.com/discolabs/cartjs","last_synced_at":"2025-05-16T10:08:02.410Z","repository":{"id":17866439,"uuid":"20799967","full_name":"discolabs/cartjs","owner":"discolabs","description":"A Javascript library to power cart management for Shopify themes.","archived":false,"fork":false,"pushed_at":"2023-10-19T12:37:46.000Z","size":3543,"stargazers_count":483,"open_issues_count":48,"forks_count":84,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-10T05:38:30.763Z","etag":null,"topics":["rivets","shopify","shopify-theme"],"latest_commit_sha":null,"homepage":"https://cartjs.org","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/discolabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-06-13T09:56:25.000Z","updated_at":"2025-05-09T14:08:56.000Z","dependencies_parsed_at":"2024-01-15T03:42:42.404Z","dependency_job_id":null,"html_url":"https://github.com/discolabs/cartjs","commit_stats":{"total_commits":267,"total_committers":6,"mean_commits":44.5,"dds":0.05243445692883897,"last_synced_commit":"45c463d78e6ad00cb299291ff7d70ee24bb2be16"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discolabs%2Fcartjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discolabs%2Fcartjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discolabs%2Fcartjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discolabs%2Fcartjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discolabs","download_url":"https://codeload.github.com/discolabs/cartjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509477,"owners_count":22082891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rivets","shopify","shopify-theme"],"created_at":"2024-08-03T13:00:56.670Z","updated_at":"2025-05-16T10:07:57.400Z","avatar_url":"https://github.com/discolabs.png","language":"CoffeeScript","funding_links":[],"categories":["CoffeeScript"],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/shopify-cartjs.svg)](https://badge.fury.io/js/shopify-cartjs)\n[![Bower version](https://badge.fury.io/bo/shopify-cartjs.svg)](https://badge.fury.io/bo/shopify-cartjs)\n\n# Cart.js\nCart.js is a Javascript library that makes it easy to add dynamic cart features\nto Shopify themes.\n\nIt abstracts away the difficult parts of working with Shopify's AJAX API and\nprovides a simple, consistent interface to manipulating a customer's cart.\nWithout having to worry about the quirks in Shopify's endpoints or about making\nall of your requests synchronous, you can just write code like this:\n\n```js\nfunction example() {\n  // Clear the existing cart.\n  CartJS.clear();\n\n  // Add 3x \"12345678\" items, with a custom \"size\" property of \"XL\".\n  CartJS.addItem(12345678, 3, {\n    \"size\": \"XL\"\n  });\n\n  // Add multiple items in a single call. \n  CartJS.addItems([\n    {\n      id: 12345678,\n      quantity: 3,\n      properties: {\n        \"size\": \"XL\"\n      }\n    },\n    {\n      id: 87654321,\n      quantity: 2\n    }\n  ]);\n\n  // Set a custom cart note.\n  CartJS.setNote('This is a custom cart note.');\n}\n```\n\nNeat, huh? But that's just the beginning.\n\nCart.js bundles two powerful optional modules that make it even easier to build\ndynamic carts into your themes:\n\n\n### Data API Module\nLets you use simple `data-*` markup attributes to hook in to Cart.js methods,\nwithout having to write *any* Javascript yourself.\n\nFor example, to create a button that added a particular product to your cart,\nall that's required is:\n\n```html\n\u003cbutton data-cart-add=\"12345678\"\u003eAdd Product\u003c/button\u003e\n```\n\n\n### DOM Binding Module\nIn combination with [Rivets.js][], the DOM Binding module lets you write HTML\ntemplates in your `.liquid` files that are re-rendered dynamically when the\ncontents of your cart change, like this:\n\n```html\n\u003cdiv data-cart-view\u003e\n    You currently have {cart.item_count} item(s) in your cart, for a total of {cart.total_price | money_with_currency}.\n\u003c/div\u003e\n```\n\n\n## Getting Started and Documentation\nDocumentation and examples are available on the [home page][].\n\nYou can check out a list of who's using Cart.js in production on the\n[Built with Cart.js][] page.\n\n[home page]: https://cartjs.org?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cartjs\n[Built with Cart.js]: https://cartjs.org/pages/built-with-cart-js\n\n\n## Dependencies\nCart.js currently depends on [jQuery][] for its AJAX helpers, custom event\nbindings and utility methods. This usually isn't a problem as most Shopify\nthemes ship with jQuery.\n\n[Rivets.js] is required if you want to use the DOM Binding module. The\ndistribution of Cart.js includes a minified asset (`rivets-cart.min.js`) which\ncontains both the Cart.js library and a bundled version of Rivets.js.\n\n[Rivets.js]: http://rivetsjs.com\n[jQuery]: http://jquery.com\n\n\n## Release History\nRefer to the [change log](https://github.com/discolabs/cartjs/blob/master/CHANGELOG.md)\nfor a full list of changes.\n\n\n## Contributions\nContributions are very much welcome! Read our [contribution guidelines][] for\ndetails on submitting pull requests that will be accepted.\n\n[contribution guidelines]: https://github.com/discolabs/cartjs/blob/master/CONTRIBUTING.md\n\n---\n\n#### About the Author\n[Gavin Ballard][] is the founder, CEO, and occasional developer at [Disco Labs][],\na Shopify Plus partner agency specialising in solutions for merchants with complex\nneeds.\n\n[Gavin Ballard]: http://gavinballard.com/?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cartjs\n[Disco Labs]: https://www.discolabs.com/?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=cartjs\n\n#### Thanks\nThanks to the following people who have contributed their time and code to Cart.js!\n\n* [Michaël Gallego](https://github.com/bakura10)\n* [Michael Shannon](https://github.com/michaelrshannon)\n* [Stewart Knapman](https://github.com/stewartknapman)\n* [Jonathan Moore](https://github.com/jonathanmoore)\n* [Ty Carlson](https://github.com/tywayne)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscolabs%2Fcartjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscolabs%2Fcartjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscolabs%2Fcartjs/lists"}