Place order for a product with Call for price

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
We cannot add a product to cart if CallForPrice is set to true. I would like to know how a customer/ Sales representative can place order for an item if CallForPrice is set to true.
7 years ago
Are you wanting all public visitors to see "Call for Price"...and only for admins to see the Add Item button?
Unfortunately, there is no way to do this by default, but I think you can code your \Views\Products\_ProductPrice.cshtml view to work like you want. You must use a conditional statement within the already existing conditional statement to determine if CallForPrice is enabled, and show the add item button when a customer "IsAdmin".

if (workContext.CurrentCustomer.IsAdmin())
7 years ago
Oops...I said this:

You must use a conditional statement within the already existing conditional statement to determine if CallForPrice is enabled, and show the add item button when a customer "IsAdmin".

I meant this:
You must use a conditional statement within the already existing conditional statement to determine if CallForPrice is enabled, and show the _AddToCart.cshtml partial view when a customer "IsAdmin".

if (workContext.CurrentCustomer.IsAdmin())
7 years ago
embryo wrote:
Are you wanting all public visitors to see "Call for Price"...and only for admins to see the Add Item button?

No. He`s asking how customer may add item to cart if option call for price is set to true.
It is just like it is written - customer must contact with store owner.
7 years ago
embryo wrote:
Are you wanting all public visitors to see "Call for Price"...and only for admins to see the Add Item button?
Unfortunately, there is no way to do this by default, but I think you can code your \Views\Products\_ProductPrice.cshtml view to work like you want. You must use a conditional statement within the already existing conditional statement to determine if CallForPrice is enabled, and show the add item button when a customer "IsAdmin".

if (workContext.CurrentCustomer.IsAdmin())


Thanks for your response and sorry for the delayed reply. I tried this option and seems there is a validation in ShoppingCartService.AddToCart which will prevent me from adding that product to cart. Is there any solution/ work around for this?
7 years ago
AlexGT wrote:
Are you wanting all public visitors to see "Call for Price"...and only for admins to see the Add Item button?
No.
He`s asking how customer may add item to cart if option call for price is set to true.
It is just like it is written - customer must contact with store owner.


Pretty sure he was referring to being able to order a product while "impersonating" a customer, or when logged in as an Administrator, while still only allowing other visitors to "Call for Price."

I was not aware of the potential validation issue. You will need someone with more expertise than me to solve the issue.
7 years ago
embryo wrote:


Pretty sure he was referring to being able to order a product while "impersonating" a customer, or when logged in as an Administrator, while still only allowing other visitors to "Call for Price."

I was not aware of the potential validation issue. You will need someone with more expertise than me to solve the issue.


You are right, I am referring to placing an order when logged in as administrator while still only allowing other visitors to "call for price".

This validation is preventing me from adding the product to cart even if I am an admin.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.