Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope.addToCart = function(key, size, price) {
- //Add selected size and price
- //Add 'extra' for selected price and size
- $scope.selectedProduct.extra = {};
- $scope.selectedProduct.extra = {
- //price is a float
- price: price,
- //$scope.productSizes is a single array that
- //changes int values to sizes (1 => individual, 2 => medium ...)
- size: $scope.productSizes[size],
- //size is the int value of the size
- sizeInt: size
- };
- $scope.cart.push($scope.selectedProduct);
- };
- 0 Object
- extra: Object
- price: "1.99"
- size: "Individual"
- sizeInt: 1
- 0: Object
- extra: Object
- price: "6.5"
- size: "Large"
- sizeInt: 3
- 1: Object
- extra: Object
- price: "6.5"
- size: "Large"
- sizeInt: 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement