Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Free Shipping on Orders over a certain amount View modes: 
User avatar
Member
Member
iweber - 6/28/2013 1:44:28 PM
   
Free Shipping on Orders over a certain amount
I noticed that this was in the 5.5 documentation, but is this still available in version 6 and 7? I would like to have free shipping for customers who order more than 10 items. Then, they can get additional free shipping if they order at least 10 more, but no less than 10 more. So if they ordered 11, they would get free shipping on the first 10, but would have to pay shipping for that 1 additional item. But if they ordered 20, they would get free shipping on both sets of 10.

User avatar
Member
Member
iweber - 6/28/2013 1:46:05 PM
   
RE:Free Shipping on Orders over a certain amount
Sorry for triple post. I encountered an error when posting, and foolishly tried additional attempts at submitting. Let's just use this thread, and hopefully a moderator will kill the other threads. Again, sorry for triple spamming.

User avatar
Member
Member
iweber - 7/3/2013 8:52:22 AM
   
RE:Free Shipping on Orders over a certain amount
I developed a solution to my original problem, but need to add an additional piece of logic. I need to avoid this free shipping on 10 items or more, if the shipping is going to Alaska or Hawaii. Ie., when a customer selects the Hawaii or Alaska shipping option during checkout, the shipping calculation rules change.

I will need to have some sort of if(Alaska_or_Hawaii) { ... } in my c# code that I am using to override the shipping calculation.

My questions is simply this: does anyone know what database tables the shipping options are located in? Does anyone know how to query the database, or otherwise somehow get the shipping options when the user selects them during the checkout process? Thanks.

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 7/4/2013 1:54:31 AM
   
RE:Free Shipping on Orders over a certain amount
Hi,

We have been resolving this issue via email, I am posting this information for anyone reading this thread. You can set shipping to zero if the shipping option code name is "alaska" and the number of items in the order is more than 10, using custom info provider with this code:

namespace CustomProviders
{
/// <summary>
/// Customized CustomShippingOptionInfoProvider provider.
/// </summary>
public class CustomShippingOptionInfoProvider : ShippingOptionInfoProvider
{
/// <summary>
/// Calculates shipping cost for the given shopping cart. Shipping free limit is applied. Shipping taxes are not included. Result is in site main currency.
/// </summary>
/// <param name="cartObj">Shopping cart object</param>
protected override double CalculateShippingInternal(ShoppingCartInfo cartObj)
{

// Check validity
if (cartObj != null && cartObj.ShoppingCartShippingOptionID != 0 && ShippingOptionInfoProvider.GetShippingOptionInfo(cartObj.ShoppingCartShippingOptionID) != null)
{
// Check free shipping conditions
if (cartObj.TotalUnits > 10 && Convert.ToString(ShippingOptionInfoProvider.GetShippingOptionInfo(cartObj.ShoppingCartShippingOptionID)["ShippingOptionName"]).ToLower() == "alaska")
{
return 0;
}
}
return base.CalculateShippingInternal(cartObj);
}
}
}


Regards,
Josef Dvorak