<commit_before>#MongoidCart

Attempt to bring up the most basic shopping cart for mongoid.

## Features:

* Multiple Models can be put into cart
* CartController already setup
* current_cart view_helpers for cart
* able to set more than one cart (multiple wishlists) (@wip)

__@wip__ This project is still in progress!

Please feel free to contribute (Pull requests).

This project rocks and uses MIT-LICENSE.

## Usage:

Put this into your gemfile

    gem 'mongoid_cart'
    
Mount the cart engine and put this into your routes.rb

    mount MongoidCart::Engine => '/cart'

Now you have the CartController ready setup

Let's add the cart functions to your models (can be more than once).

    include MongoidCart::ActsAsProduct
    
    # Your model MUST HAVE the following fields:
    
    field :title, type: String # Title/Name of the product
    field :sku, type: String # unique Product ID
    field :net_price, type: Float # simple net price for item 
    field :units, type: Array # should provide an array with values for units 
    field :amount, type: Integer # amount of units in cart
    
Now your model has a few new methods like

- add_to_cart 
- remove_from_cart
- in_cart?
- in_stock?

If you wanna add or remove an item to the cart, simply put this into your view

    <%= add_remove_cart_link(your_model_instance) %><commit_msg>upate readme<commit_after>#MongoidCart

Attempt to bring up the most basic shopping cart for mongoid.

## Features:

* Multiple Models can be put into cart
* CartController already setup
* current_cart view_helpers for cart
* able to set more than one cart (multiple wishlists) (@wip)

__@wip__ This project is still in progress!

Please feel free to contribute (Pull requests).

This project rocks and uses MIT-LICENSE.

## Usage:

Put this into your gemfile

    gem 'mongoid_cart'
    
Mount the cart engine and put this into your routes.rb

    mount MongoidCart::Engine => '/cart'

Now you have the CartController ready setup

Let's add the cart functions to your models (can be more than once).

    include MongoidCart::ActsAsProduct
    
    # Your model MUST HAVE the following fields:
    
    field :title, type: String # Title/Name of the product
    field :sku, type: String # unique Product ID
    field :net_price, type: Float # simple net price for item 
    field :units, type: Array # should provide an array with values for units 
    field :amount, type: Integer # amount of units in cart
    
Now your model has a few new methods like

- add_to_cart 
- remove_from_cart
- in_cart?
- in_stock?

If you wanna add or remove an item to the cart, simply put this into your view

    <%= add_or_remove_cart_link(your_model_instance) %>
{'fraction_non_alphanumeric': 0.05930318754633061, 'fraction_numerical': 0.0, 'mean_word_length': 3.60580204778157, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2689285', 'n_tokens_mistral': 785, 'n_tokens_neox': 757, 'n_words': 369}