{"id":18577388,"url":"https://github.com/ecomplus/shopping-cart","last_synced_at":"2025-04-10T09:30:48.435Z","repository":{"id":36990628,"uuid":"169591056","full_name":"ecomplus/shopping-cart","owner":"ecomplus","description":"Simple JS lib to handle shopping cart object and events","archived":false,"fork":false,"pushed_at":"2025-03-17T04:51:54.000Z","size":4017,"stargazers_count":12,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-19T11:19:22.662Z","etag":null,"topics":["checkout","ecommerce-cart","ecomplus","javascript-library","storefront"],"latest_commit_sha":null,"homepage":"http://developers.e-com.plus/shopping-cart/","language":"JavaScript","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/ecomplus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-07T15:10:54.000Z","updated_at":"2025-02-17T17:51:37.000Z","dependencies_parsed_at":"2023-02-13T01:01:24.219Z","dependency_job_id":"96be8b86-bb0a-4455-b084-1dc40fa9e25a","html_url":"https://github.com/ecomplus/shopping-cart","commit_stats":{"total_commits":336,"total_committers":6,"mean_commits":56.0,"dds":"0.39583333333333337","last_synced_commit":"287e4f8543e8593b1a1c09f3236647de477a2c18"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomplus%2Fshopping-cart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomplus%2Fshopping-cart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomplus%2Fshopping-cart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomplus%2Fshopping-cart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecomplus","download_url":"https://codeload.github.com/ecomplus/shopping-cart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248191638,"owners_count":21062542,"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":["checkout","ecommerce-cart","ecomplus","javascript-library","storefront"],"created_at":"2024-11-06T23:28:59.967Z","updated_at":"2025-04-10T09:30:47.956Z","avatar_url":"https://github.com/ecomplus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shopping Cart\n\n[![Publish](https://github.com/ecomplus/shopping-cart/workflows/Publish/badge.svg)](https://github.com/ecomplus/shopping-cart/actions?workflow=Publish) [![CodeFactor](https://www.codefactor.io/repository/github/ecomplus/shopping-cart/badge)](https://www.codefactor.io/repository/github/ecomplus/shopping-cart) [![npm version](https://img.shields.io/npm/v/@ecomplus/shopping-cart.svg)](https://www.npmjs.org/@ecomplus/shopping-cart) [![license mit](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nSimple vanilla JS library to handle shopping cart with common methods following [E-Com Plus cart object model](https://developers.e-com.plus/docs/api/#/store/carts/carts)\n\n[CHANGELOG](https://github.com/ecomplus/shopping-cart/blob/master/CHANGELOG.md)\n\n## Usage\n\nThe `@ecomplus/shopping-cart` package can be used to persist and treat shopping cart data on E-Com Plus stores (and not only).\n\nIt's available for both Node.js and browser environments.\n\n- [Get started](https://developers.e-com.plus/shopping-cart/module-@ecomplus_shopping-cart.html)\n- [Class reference](https://developers.e-com.plus/shopping-cart/EcomCart.html)\n\n### Example\n\n```js\nimport ecomCart from '@ecomplus/shopping-cart'\n\necomCart.on('change', ({ data }) =\u003e {\n  console.log('Cart was changed!')\n  console.log('Current cart data:', data)\n})\n\necomCart.addItem({\n  _id: '12300000000000000000000f',\n  product_id: '123a5432109876543210cdef',\n  sku: 's-MP_2B4',\n  name: 'Mens Pique Polo Shirt',\n  quantity: 4,\n  price: 42.9,\n  keep_item_price: false\n})\n\necomCart.increaseItemQnt('12300000000000000000000f', 3)\n```\n\n### Installation\n\nIt _may_ require and doesn't include `core-js` (optional) and [`@ecomplus/utils`](https://developers.e-com.plus/utils/) (peer dependency).\n\n#### Webpack\n\n```bash\nnpm i --save core-js @ecomplus/utils @ecomplus/shopping-cart\n```\n\n#### Node.js\n\n```bash\nnpm i --save @ecomplus/utils @ecomplus/shopping-cart\n```\n\n#### CDN\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@ecomplus/shopping-cart/dist/ecom-cart.var.min.js\"\u003e\u003c/script\u003e\n```\n\nWhen importing from CDN, `EventEmitter3` and `ecomUtils` libraries **must be included separately** and available on window scope.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomplus%2Fshopping-cart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecomplus%2Fshopping-cart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomplus%2Fshopping-cart/lists"}