https://github.com/patternslib/pat-shopping-cart
Move from gitlab
https://github.com/patternslib/pat-shopping-cart
hacktoberfest javascript patternslib ui-components
Last synced: about 1 year ago
JSON representation
Move from gitlab
- Host: GitHub
- URL: https://github.com/patternslib/pat-shopping-cart
- Owner: Patternslib
- Created: 2017-12-01T15:14:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T00:48:56.000Z (over 3 years ago)
- Last Synced: 2025-02-01T19:28:15.895Z (over 1 year ago)
- Topics: hacktoberfest, javascript, patternslib, ui-components
- Language: JavaScript
- Homepage:
- Size: 3.66 MB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
Awesome Lists containing this project
README
# pat-shopping-cart
Add a value to a "shopping cart" and process this "shopping cart".
This can be used to implement a bulk download feature e.g.
When an item is added to the cart, the element is given the .in-cart css class.
A .pat-shopping-cart element is also used for processing the cart.
A list of the id values is submitted to the action URL using the POST method as a comma separated string.
The shopping cart action element gets the .has-items css class when there are items in the cart, and .is-empty otherwise.
To add a button to empty the cart use "action: empty":
To use an action without clearing the cart use "contents: keep":
You can pass on other patterns to the action "patterns: pat-modal":
You can configure patterns passed on to the action by prepending data-pat-shopping-cart to the pattern: