Urgent - Modify the shopping cart item Price but do not modify the Product price after add to Cart

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hi All Brothers and Sisters,


Pretty Urgent,


could you tell me which link that contain this information or

just suggest me where to change this code ?


Thank you so much...
10 years ago
Search the code for CustomerEntersPrice
10 years ago
Hi, New York VIP,

thanks for your reply.. it works 50%...

              addToCartWarnings = _shoppingCartService.AddToCart(_workContext.CurrentCustomer,
                product, cartType, _storeContext.CurrentStore.Id,
                string.Empty, 99, quantity, true);

After setting CustomerPrice to 99, and added into shopping cart,

I want to reset the Product back to

    product.CustomerEntersPrice = false;
     _productService.UpdateProduct(product);

But the cart item also changes back to the product.Price instead of CustomerPrice, could you please help me ?

THanks
10 years ago
Cart price is dynamically calculated (due to discounts, etc.).  So you need to leave CustomerEntersPrice to true.   Disable the functionality so that the customer can't enter price on the product page ...

\Presentation\Nop.Web\Controllers\CatalogController.cs

            //customer entered price
            model.AddToCart.CustomerEntersPrice = product.CustomerEntersPrice;
10 years ago
Hi New York VIP...

Many Many thanks for your help !!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.