How can I get the shoppingCart items from Payment Plugin

8 years ago
Hello

I am new to MVC3. But have made a lot of progress working with the framework.

I have created a new Payment plugin that is similar to the Authorize.Net Plugin. In my ProcessPayment Method I want to get a list of all the shopping cart items.

Do you have a code snippet you can share

Thank you

Lorent
8 years ago
var cart = processPaymentRequest.Customer.ShoppingCartItems
   .Where(x=>x.ShoppingCartType == ShoppingCartType.ShoppingCart)
   .ToList();
8 years ago
Thanks you!
4 years ago
doesn't work for nopcommerce 3.40

Trying to find an alter solution using workContext service but that doesnt seem to work either. Any suggestions?
4 years ago
var customer = _workContext.CurrentCustomer;

            var cart = customer.ShoppingCartItems
                .Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart)
                .Where(sci => sci.StoreId == _storeContext.CurrentStore.Id)
                .ToList();