Product variant special case problem
-
- Ensign (ENS)
- Posts: 9
- Joined: Thu Oct 09, 2008 4:53 pm
Product variant special case problem
Hi All,
We're setting up a store that sells videos. Customer needs to be able to choose to download either of two formats or have a DVD shipped to them. We've set this up so that each video is a product with 3 variants: format1, format2, and DVD. The first 2 variants have digital goods associated with them, and each variant has a SKU modifier. So far so good.
Here are the challenges:
1. Shipping. We want to expose the shipping options when customer chooses the DVD variant but not the downloadable variants. I haven't been able to figure out how to do this. Any hints?
2. Emails. a) We'd like to trigger email to the warehouse that'll ship the DVD when an order containing a DVD is paid, but not when the order contains only non-shippable variants. b) We'd like to trigger the 'your download is available' mail when a downloadable order is paid, but not when a shippable order is paid. (We're not requiring a serial key.) Again, I'm stumped on these.
Any help will be greatly appreciated!
We're setting up a store that sells videos. Customer needs to be able to choose to download either of two formats or have a DVD shipped to them. We've set this up so that each video is a product with 3 variants: format1, format2, and DVD. The first 2 variants have digital goods associated with them, and each variant has a SKU modifier. So far so good.
Here are the challenges:
1. Shipping. We want to expose the shipping options when customer chooses the DVD variant but not the downloadable variants. I haven't been able to figure out how to do this. Any hints?
2. Emails. a) We'd like to trigger email to the warehouse that'll ship the DVD when an order containing a DVD is paid, but not when the order contains only non-shippable variants. b) We'd like to trigger the 'your download is available' mail when a downloadable order is paid, but not when a shippable order is paid. (We're not requiring a serial key.) Again, I'm stumped on these.
Any help will be greatly appreciated!
Re: Product variant special case problem
Well you can customize the BuyProductDialog to show the custom information when a variant that doesn't contain the digital good is selected. Below is a sample code that shows a message that product could be shipped.1. Shipping. We want to expose the shipping options when customer chooses the DVD variant but not the downloadable variants. I haven't been able to figure out how to do this. Any hints?
Edit the ConLib/BuyProductDialog.ascx.cs file, locate following if statement in the Page_Init method
Code: Select all
if (_Product != null)
{
...............................
...............................
...............................
}
else
{
this.Controls.Clear();
}
Code: Select all
if (_Product != null)
{
...............................
...............................
string optionList = ProductVariantDataSource.GetOptionList(_ProductId, _SelectedOptions, false);
if (!String.IsNullOrEmpty(optionList))
{
bool isShipable = true;
foreach (ProductDigitalGood digtalGood in _Product.DigitalGoods)
{
if (digtalGood.OptionList == optionList)
{
isShipable = false;
}
}
if (isShipable)
{
ShippingMessage.Text = "Shipable";
ShippingMessage.Visible = true;
}
else
{
ShippingMessage.Visible = false;
}
}
else
ShippingMessage.Visible = false;
}
else
{
this.Controls.Clear();
}
Code: Select all
<tr>
<td></td>
<td>
<asp:PlaceHolder ID="InventoryDetailsPanel" runat="server" EnableViewState="false"></asp:PlaceHolder>
</td>
</tr>
Code: Select all
<tr runat="server" enableviewstate="false">
<td colspan="2">
<asp:Label ID="ShippingMessage" runat="server" EnableViewState="false"></asp:Label>
</td>
</tr>
<tr>
<td></td>
<td>
<asp:PlaceHolder ID="InventoryDetailsPanel" runat="server" EnableViewState="false"></asp:PlaceHolder>
</td>
</tr>
Re: Product variant special case problem
You can create your custom template and then create Email contents using the order information with NVelocity help. For example the below the code will send an Email with download message if the order item contains digital good.2. Emails. a) We'd like to trigger email to the warehouse that'll ship the DVD when an order containing a DVD is paid, but not when the order contains only non-shippable variants. b) We'd like to trigger the 'your download is available' mail when a downloadable order is paid, but not when a shippable order is paid. (We're not requiring a serial key.) Again, I'm stumped on these.
Code: Select all
#foreach($orderItem in $order.Items)
#if($orderItem.OrderItemType == "Product")
#if($orderItem.Product.DigitalGoods.Count > 0)
Download Aavailable
#else
#end
#end
#end
-
- Ensign (ENS)
- Posts: 9
- Joined: Thu Oct 09, 2008 4:53 pm
Re: Product variant special case problem
Thanks Mazhar! We'll give this a try.
-
- Ensign (ENS)
- Posts: 9
- Joined: Thu Oct 09, 2008 4:53 pm
Re: Product variant special case problem
Mazhar, just looking at the proposed email solution I'm not sure it will work for the vendor notification case. It looks as though the proposed solution allows us to vary the message text based on the contents of the order; for ex. if order contains downloadable goods send this text, otherwise send this other text. That's fine for the customer (if order contains downloadable goods send 'your goods are ready for download', otherwise send 'thanks for shopping with us') but in the case of mail to the vendor we don't want to send anything at all if the order contains no shippable items. Is there a way to use the order information to specify whether or not the email gets generated at all?
Thanks again,
Paul
Thanks again,
Paul
Re: Product variant special case problem
For this scenario you can remove the trigger from VendorNotification template so that system will not send the Email automatically to the vendor. Then you can send that template manually to the vendors after checking that weather the order contains the shipment or not. For example you can put some code in RecieptPage that checks weather the current order contains some shipment or not. If the order contains shipment then load vendor notification template manually and send it to the vendor.
-
- Ensign (ENS)
- Posts: 9
- Joined: Thu Oct 09, 2008 4:53 pm
Re: Product variant special case problem
Thank you again, Mazhar.
- mfreeze
- Commodore (COMO)
- Posts: 421
- Joined: Mon Jan 24, 2005 2:07 pm
- Location: Washington, NJ
- Contact:
Re: Product variant special case problem
Mazar,
I have a similar situation in 7.0.4. I have products with 2 shippable options (DVD and Cassette) and one that is not shippable (Download). What I need is to not only hide the shipping charge but to not charge shipping for the Digital Good (Download). The main product is marked shippable.
I tried this code but it did nothing. The shipping showed and shipping was charged. Any suggestions?
It would be really nice if shippable/nonshippable was an option on the variations.
I have a similar situation in 7.0.4. I have products with 2 shippable options (DVD and Cassette) and one that is not shippable (Download). What I need is to not only hide the shipping charge but to not charge shipping for the Digital Good (Download). The main product is marked shippable.
I tried this code but it did nothing. The shipping showed and shipping was charged. Any suggestions?
It would be really nice if shippable/nonshippable was an option on the variations.