bradniedt / little_shop_base_small Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mgoodhart5/little_shop_base_small
This project forked from mgoodhart5/little_shop_base_small
.generate_slug
the slug will = the user email downcased
url_encode method https://apidock.com/ruby/ERB/Util/url_encode
qty match method must determine if the quantity is within a range of the discount quantities.
Order show page needs to be able to tell if there was a discount applied
The cart show page should show a small message on the item if that item has a discount.
user has many discounts
add test to show that if an item was added at qty 10 a discount message shows, and if you reduce by one, the discount message disappears.
The order show page needs to show if that order had a discount applied to it.
will match the discount, then serve up the discount in a string format of "5%" or "$5"
Create Discount table
has an integer and a user_id
has a threshold integer OR RANGE (so you can say is item.qty in range?)
belongs to item
Discount index page - each discount has a link to edit that discount
slug:string:uniq:index
check to see if I need to add slugs into the seed data
merchant's discounts can only be all dollars or all percents.
If a merchant adds one discount, every discount they create after that will need to be the same type.
When they create their first discount, they can choose any type.
.generate_slug
the slug will = the item name downcased + a random number .
OR add discounted price
discount index page has a card for each discount with its id, type, and amount. Also each has a link to edit and delete that discount.
a method that takes a cart item ID and qty as an argument. The method checks if that item's merchant has discounts, then if the quantity qualifies it for any discounts. If it does, get the cart item subtotal, reduce it by the discount, then divide the subtotal by the quantity, and set the new cart item price. this should run for every item every time you visit the cart show page.
Discount index page should have an option to delete each discount
When a user checks out and creates order items, the order item's price should be reduced by the discount divided by the quantity.
If no discount is present, just keep the same item price.
merchant new discount form, discount new and create methods, discount show page.
slug:string:uniq:index
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.