Hi All,
I'm using the HidePaymentMethod of IPaymentMethod interface.
For now working ok but have only a little question:
If the product have a discount the price still is the base price, because using the (ShoppingCartItem cart) I can't access the PriceIncludingTax for example.
A few idea in how to access the product price including tax?
For now is that:
public bool HidePaymentMethod(IList<ShoppingCartItem> cart)
{
if (_cashOnDeliveryPaymentSettings.UseMinValue)
{
decimal totalItens = 0;
foreach (var item in cart)
{
var product = item.Product;
decimal productPrice = product.Price;
totalItens += (productPrice * item.Quantity);
}
if(totalItens < _cashOnDeliveryPaymentSettings.MinValue)
{
return true;
}
}
//you can put any logic here
//for example, hide this payment method if all products in the cart are downloadable
//or hide this payment method if current customer is from certain country
return false;
}