Customer Entered Price--Need help!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
Hey,

When a customer enters a price in the NumericTextBox control of either ProductBox1.ascx.cs or ProductVariantinGrid.ascx.cs, that is less than the minimumCustomerEnteredPrice setting, the Add to Cart button is disabled from adding the product to the shopping cart and an error message is displayed. How is this accomplished? There are no if statements to trap the error so how, or maybe where is the code that accomplishes this located?
13 лет назад
Look at \Templates\Products\OneVariant.ascx and \Modules\ProductVariantsInGrid.ascx controls. There's a control with 'txtCustomerEnteredPrice' ID. And required 'MinimumValue' and 'MaximumValue' properties of this control are set into .cs file
13 лет назад
I do see the controls in both ProductVariantsInGrid.ascx and OneVariant.ascx as well as the underlying code in both cs files.  When a customer enters a price that is below the minimum required value, the AddToCart button will not add the item to the cart and an error message is displayed.  I see the txtCustomerEnteredPrice.ValidationGroup function but what I can't find is how the data in the field gets validated against the minimum and maximum required values. Where in the code is this validation taking place.

I need to be able to access this validation so that I can modify it for my use but I can't find it's location in the source code.

Help.
13 лет назад
Look at \Modules\DecimalTextBox.ascx control
13 лет назад
I forgot to mention that I'm using version 1.6. I don't see a DecimalTextBox.ascx in my list in the Modules folder. Is this module only in later versions of nopCommerce?
13 лет назад
randycbrown wrote:
I forgot to mention that I'm using version 1.6.

In this case look at \Modules\NumericTextBox.ascx control
13 лет назад
I felt at first that your response was terse and obvious because I already knew about the NumericTextBox control. However, when I really looked at the NumericTextBox.ascx file, I realized that it was pure .NET programming and I didn't know enough about .NET Validation controls.

I really dug in and began researching  .NET validation and learned so much more about what I needed to know than I could have ever learned if you had simply told me how to do what I was trying to do. Through this research, I found the answers that I was looking for and was able to make the changes that I needed to make the program do what I wanted to and gained a vast amount of usable knowledge in the process.

Thank you for not only your help, but how you helped me.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.