- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 11:47 AM
I am interested in a couple of things dealing with the cart:
1. How would we remove the Requested For, Deliver to and Special Instructions from the cart view? Many of our options are service based and we don't really deliver an AD account to an address.. lol. I'd imagine this is something where we'd clone the widget and do some modifications but I'm no widget guru.
2. How would I push a quantity value stored in a catalog item's variable (u_quantity) into the shopping cart when it's added and then prevent the user from changing it in the cart view?
Ex. Someone orders a door stop with a quantity of 35, I want the quantity to be 35 in the cart on the portal but not let them alter it without altering the quantity on the original request.
How would a fella go about doing that?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2017 06:44 AM
Through much trial and error I have had a breakthrough in updating the quantity on the portal shopping cart using a business rule. Sharing that wealth in case anyone else needs this.
1. I created a variable set that will be used with only the Quantity field on it. This is imperative as we will use this variable's system id as a condition on the business rule to prevent it from running other than for quantity updates.
2. I created a Before Insert/Update BR on the sc_item_option table with a condition that the Question be the variable that was setup in Step 1. I initially tried to do this on the cart item; however, it appears the item option isn't created before the cart item so I would never get any results when I attempted to query the related table.
3. I wrote a pretty simple glide query to get the values of the Cart Item and Value from the current Item Option form, search the Cart Items table until it found a match on the related cart and then updated it's quantity with the value of the variable.
// Get the Current Cart Item and Value from the catalog item option.
var cartItem = current.cart_item;
var qty = current.value;
// Query the cart and update it's quantity value with the variable's value.
var gr = new GlideRecord('sc_cart_item');
gr.addQuery('sys_id', cartItem);
gr.query();
while(gr.next()){
gr.quantity = qty;
gr.update();
}
s);
And that was it.
Catalog Item - Add to Cart
Shopping Cart Display
I hope this helps anyone else who is struggling with dealing with this. It was a two day nightmare for me but we finally have somewhat of a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2017 11:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2017 06:44 AM
Through much trial and error I have had a breakthrough in updating the quantity on the portal shopping cart using a business rule. Sharing that wealth in case anyone else needs this.
1. I created a variable set that will be used with only the Quantity field on it. This is imperative as we will use this variable's system id as a condition on the business rule to prevent it from running other than for quantity updates.
2. I created a Before Insert/Update BR on the sc_item_option table with a condition that the Question be the variable that was setup in Step 1. I initially tried to do this on the cart item; however, it appears the item option isn't created before the cart item so I would never get any results when I attempted to query the related table.
3. I wrote a pretty simple glide query to get the values of the Cart Item and Value from the current Item Option form, search the Cart Items table until it found a match on the related cart and then updated it's quantity with the value of the variable.
// Get the Current Cart Item and Value from the catalog item option.
var cartItem = current.cart_item;
var qty = current.value;
// Query the cart and update it's quantity value with the variable's value.
var gr = new GlideRecord('sc_cart_item');
gr.addQuery('sys_id', cartItem);
gr.query();
while(gr.next()){
gr.quantity = qty;
gr.update();
}
s);
And that was it.
Catalog Item - Add to Cart
Shopping Cart Display
I hope this helps anyone else who is struggling with dealing with this. It was a two day nightmare for me but we finally have somewhat of a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2018 10:33 AM
When someone edits their product in the cart, they can't go back and throw in an attachment. Have you already addressed this limitation?
Thanks