{"id":20909959,"url":"https://github.com/iamotz/shoppingcart","last_synced_at":"2026-05-21T04:36:50.759Z","repository":{"id":119659297,"uuid":"108140436","full_name":"IAMOTZ/shoppingCart","owner":"IAMOTZ","description":"An OOP program to implement a shopping cart software","archived":false,"fork":false,"pushed_at":"2017-10-25T05:21:28.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-31T22:42:16.305Z","etag":null,"topics":["algorithm","javascript","oop","shopping-cart"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IAMOTZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-10-24T14:41:50.000Z","updated_at":"2018-11-29T21:13:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"622bf112-3bb2-418f-8f21-f64fe9e6f1ee","html_url":"https://github.com/IAMOTZ/shoppingCart","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IAMOTZ/shoppingCart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAMOTZ%2FshoppingCart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAMOTZ%2FshoppingCart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAMOTZ%2FshoppingCart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAMOTZ%2FshoppingCart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IAMOTZ","download_url":"https://codeload.github.com/IAMOTZ/shoppingCart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IAMOTZ%2FshoppingCart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33288911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["algorithm","javascript","oop","shopping-cart"],"created_at":"2024-11-18T14:13:21.230Z","updated_at":"2026-05-21T04:36:50.744Z","avatar_url":"https://github.com/IAMOTZ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shoppingCart\nAn OOP program to implement a shopping cart software\n\nThere are two major classes in this program, one is the ShoppingCart and the other is PromoShoppingCart.  \nEach of them are in different files inside the codes folder.\n\nThe ShoppingCart class does everything that a typical ShoppingCart software is needed to do.\n* You can add item with  `ShoppingCart.addItem(name, quantity, price, discount)` \n* You can remove items with `ShoppingCart.removeItem(name, quantity, price, discount)`\n* You can view the items added with `ShoppingCart.viewItems()`\n* You can get the total price of items added with `ShoppingCart.total`\n* You can get the number of items you added with `ShoppingCart.itemNumber`\n* You can make payments with `ShoppingCart.checkout(payment)`\n\nThe PromoShoppingCart is subclass of the ShoppingCart class.(Inheritance)  \nIt is very similar to the ShoppingCart class but it allows the users to buy 20 items without billing the user.\n* Use thesame methods that ShoppingCart class uses and everything still works fine(polymorphism);\n* Alter the value of `promoValue` property in the constructor to change the no of items the user can buy for free.\n\n# Background Context\n* The discount is to be in percentage\n* The discount parameter is optional\n* There is an Item helper class to handle if an Item has a discount or not.\n\n# To use this project\n* Clone the repo.\n* cd into the projects directory\n* Run the command `npm start` to see the program in action\n    * This would initialize a ShoppingCart class \n    * Add items ('Keyboard', 2, 400, 20)\n    * Add items ('mouse', 2, 300, 10)\n    * Add items ('Joystick', 4, 500)\n    * Then logs the items to the console with viewItems()\n* If you don't use nodejs, then just run the code in any js runtime.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamotz%2Fshoppingcart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamotz%2Fshoppingcart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamotz%2Fshoppingcart/lists"}