An open API service indexing awesome lists of open source software.

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

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.


Add this item for download

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.


Download the items

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":


Empty your shopping cart

To use an action without clearing the cart use "contents: keep":


Delete the selected items

You can pass on other patterns to the action "patterns: pat-modal":


Delete the selected items

You can configure patterns passed on to the action by prepending data-pat-shopping-cart to the pattern:


Delete the selected items