Get product variant for CheckoutPaymentMethod.ascx.cs

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
I need to add an if/then to checkout so that I am only allowing payment methods when taxexempt = true for a shopping cart item.

My problem is that I can't seem to get to the shopping cart item variants from CheckoutPaymentMethod.ascx.cs.

I have added this, but no matter what I try, I can't pass in the right variable for "ShoppingCartItem shoppingCartItem"

public bool GetProductVariantTaxExempt(ShoppingCartItem shoppingCartItem)
        {
            var productVariant = shoppingCartItem.ProductVariant;
            if (productVariant != null)
                return productVariant.IsTaxExempt;
            return productVariant.IsTaxExempt;
        }


Thank you for the help..

-Matt
13 лет назад
For those that are looking for this:

var cart = ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart);
            
            bool isTaxExempt = cart.Exists(item => item.IsTaxExempt);
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.