I am new to Episerver and I am looking for a way to determine if I have a bundle(s) in the cart.
In our solution the customer can add multiple products/Lineitems to the cart. I am looking for at way to determine the bundles I have in the cart based on the lineitems.
If it makes sense to you? Could you please push me in the right direction?
I have been looking at this:
Bundle does not really make sense in cart, one it's in cart, it becomes individual SKUs - so it's just more convenient for customer to add multiple items to cart at once.
You might consider the Package instead.
Hi Quan Mai,
Thanks for your reply.
I've been looking around in our solution and get what you explained. Because we are using Bundle in our solution/case the user can add a Bundle to the cart but can also add the products in the bundle one at the time and still get the "bundle discount". That would not be the case using the Package - I think - right?
On our bundles, we have something called a MixMatch code. What I was hoping I could do was to add this code to each Line Item that make up the bundle. This is not a problem when the user adds the bundle to the cart at once. But if he surf around the site and add one product at a time it starts to get a little tricky to determine if the collection of Line items represent a particular bundle and therefore must have our "MixMatch code". And a product can also exist in multiple bundles.
That sounds like a dead end. But I would appreciate any suggestions.
I might not fully understand your problem here - but what I see that you're referring to Package, which you can set the price on it own. So if your package has item A and B, you can still set it price to C, while C < A+B, as a "discount".
And of course you can have some promotion so if the cart contains certain items, customer will be awarded with a discount.
Hello Quan Mai,
I have had a look at Promotions that you refer to.
I am working in Episerver 8. Is it possible to grab the "Promotion Name" for each product? I would like to do it during checkout, so I later on can use that information.
I have looked here: http://world.episerver.com/documentation/Items/Developers-Guide/Episerver-Commerce/8/Marketing/Promotions/
I think it is hard finding examples on the internet.
I'm not sure what you meant "Promotion Name for each product", but is it the name of the promtion which was applied to the line item in the purchase order?
OrderForm, Shipment and LineItem all have Discounts property, which are collections of Mediachase.Commerce.Orders.Discount. Discount has DiscountName which is usually set to the name of the promotion.
I would continue to use bundles and not packages. If you want to see if an product or variation belongs to a bundle there is a an extension method in EPiServer.Business.Commere.Extensions
Then you can check the child entries to get the other products / skus that belong to it.
Hey Quan Mai and Mark Hall,
Thank you so much for your answers.
What I tried to do was(Sorry if not everything make sense - I am new to Episerver):
We often offer special offers where we get refund from the vendor. These speciel offers are most of the time put together in a bundle. To provide the back office a better overview of these "refund-products" we would like to add a code / ID on these product but only if they act together in the basket.
My first solution was two make it posible for the web editor to add a code / ID to the bundles. That code / ID would again be added to the LineItem when the user added the Bundle to the basket. The problem is that I can not add the code if the customer surf the website and add each product separately.
I also tried to use promotions and do something like this:
item [Constants.Metadata.LineItem.MixMatchCode] = GetDisplayName (itemRecord.PromotionItem.DataRow, Thread.CurrentThread.CurrentCulture.Name); But we do not allwayes add discount to every lineitems.
I went back to the first solution that we are going to release tomorrow. In one of the next releaes I will try out adding "EPiServer.Business.Commere.Extensions" to the project. And then use entryConent.GetParentBundles () and bundleContent.GetEntries (). But I also considering investigating the possibilities to build something myself in Episerver.
Learning every day:)
If I could understand it correctly, Your sales team want to see the products that has been sold as bundle.
This can be achived via a schedule job also, without adding columns in line items. In schedule Job you will be loading the orders and doing processing for your sales team and generating a report for them, you will be using entryConent.GetParentBundles() to find the bundles.