summaryrefslogtreecommitdiff
path: root/src/core/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/utils')
-rw-r--r--src/core/utils/cart.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/utils/cart.js b/src/core/utils/cart.js
index 16befdf7..dcb104f9 100644
--- a/src/core/utils/cart.js
+++ b/src/core/utils/cart.js
@@ -30,12 +30,13 @@ const setCart = (cart) => {
return false
}
-const addCart = async (product_id, qty, selected, programLineId = null) => {
+const addCart = async (product_id, qty, selected, programLineId = null, source) => {
const data = {
'product_id' : product_id,
'qty' : qty,
'selected' : selected,
- 'program_line_id' : programLineId
+ 'program_line_id' : programLineId,
+ 'source' : source
}
const id = getAuth()?.id
@@ -94,12 +95,12 @@ const getItemCart = ({ productId }) => {
* @param {boolean} [options.selected=false] - The new selected status of the product in the cart. Default is `false`.
* @returns {boolean} - Returns `true`.
*/
-const updateItemCart = async ({ productId, quantity, selected = false , programLineId}) => {
+const updateItemCart = async ({ productId, quantity, selected = false , programLineId, source}) => {
let cart = getCart()
quantity = parseInt(quantity)
cart[productId] = { productId, quantity, selected }
setCart(cart)
- await addCart(productId, quantity, selected, programLineId)
+ await addCart(productId, quantity, selected, programLineId, source)
return true
}