Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Simple shopping cart, how to add remove items from cart base on the quantity

$
0
0

@Levitay wrote:

Hi, i hope someone can help in here..
i like to create a simple shopping cart
this is the list of items i display with ng-repeat=item in items in list item
in this list html i also have a quantity that is zero (0) for each item

$scope.items = [
    {'code': '1111', 'name':'itemA', 'price':1,},
    {'code': '2222', 'name':'itemB', 'price':2,},
    {'code': '3333', 'name':'itemC', 'price':3,}
    ];

this is the list of order created by the user (cart)
i like to add items in to it (add with code, name, price and quantity)
if user select item quantity is more than 0 i like to add it to the order array
and if the user reduce the quantity to zero, i like to remove the item from the array

$scope.order = [];

what function i should add to do it (add/remove)??

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>