Rank: Member
Joined: 11/16/2004(UTC) Posts: 38
|
Hi there, I need to offer a product that allows a customer to create a custom blend using three coffees. The three coffees need to total 16 ounces. As each of the coffees may have it's own unique price, the cost of the blend is based on the per ounce cost for each coffee selected. I've attached a mock-up design. Challenges that I can't seem to find a solution to without a possible code modification: 1) Keeping track of inventory for each of the coffees. 2) Business rule to make sure the three coffees total 16 ounces. 3) Using an existing product choice template to create the above product choices. I welcome any input from the experts on whether a custom blend is doable without a code modification. Thanks in advance. softworks attached the following image(s): CoffeeBlend.jpg (67kb) downloaded 72 time(s).You cannot view/download attachments. Try to login or register.
|
|
|
|
Rank: Member
Joined: 11/16/2004(UTC) Posts: 38
|
Have I posted my question in the wrong section?
Product Modifiers will let me define (3) drop-downs containing a list of ounces, one drop-down for each coffee. I'm willing to use the modifiers and handle inventory in SAP. I'm thinking I can use some JavaScript to handle the form validation to check for the total of 16 ounces but the trick is to only validate the page when dealing with a custom blend product.
I'm just looking for some ideas on how someone might tackle this challenge.
Thanks Tina
|
|
|
|
Rank: Member
Joined: 4/10/2006(UTC) Posts: 462
|
You basically have the one of the ways to do it right on the head.
To be sure the validation only occurs on your custom blend products, simply create 2 product templates, 1 with the validation and 1 without and set them to the appropriate products based on the need for the validation. Use the "OnClientClick" on the add to cart button to fire your client side validation. |
Netriplex Corporation<br /> |
|
|
|
Rank: Member
Joined: 11/16/2004(UTC) Posts: 38
|
I've been working with BV2004 and I'm not all that familiar with the new concepts available in BV5. I'll definitely look at the product templates.
Thanks for your help!
|
|
|
|
Rank: Member
Joined: 11/16/2004(UTC) Posts: 38
|
Originally Posted by: "caplink" You basically have the one of the ways to do it right on the head.
To be sure the validation only occurs on your custom blend products, simply create 2 product templates, 1 with the validation and 1 without and set them to the appropriate products based on the need for the validation. Use the "OnClientClick" on the add to cart button to fire your client side validation.
Ideally I'd like to add my validation to the code behind the page in VB. Add an IsValidInput in the AddToCartClicked Sub that validates that my modifiers total to the 16 ounces. I've been trying to find a way to get at the modifier controls on the page but haven't had any success. Protected Function ValidateInput() As Boolean For Each item As Control In VariantsDisplay.Controls If TypeOf item Is Content.ProductModifierTemplate Then MessageBox.ShowInformation(item.ID) End if Next I suppose the alternative is to add a function to the VariantsDisplay control that does the validation for me and returns a boolean. I could then call this function from the template. I think the client side validation with javascript is gonna be difficult to do since ASP.NETs naming conventions are way too long. Any input you have would be appreciated.
|
|
|
|
Rank: Member
Joined: 4/10/2006(UTC) Posts: 462
|
If you choose the client-side route, your best bet would be to create an external script file so that the script itself is cached by the browser. The using the "ClientId" property to pass into the script the ids of the controls that need to be validated as input parameters to the validation function.
If you are looking for a server side validation your problem is stemming from the fact that the "typeof" control that is displayed in the variants display is actually the "View.ascx" page that is associated with the product input which comes out to a type like "ASP.BVModules_ProductInputs_Text_Input_ProductInputView_ascx". In order to use that "type" you would need to add a reference to the view file in the code. The alternative would be casting to the base type and using try/catch to catch which ones succeed and fail. Once you have the object most product input controls have a "GetValue" function to get the input from the control. |
Netriplex Corporation<br /> |
|
|
|
Rank: Member
Joined: 11/16/2004(UTC) Posts: 38
|
Even with adding the reference to [2]BVModules_ProductModifiers_DropDownList_View I still can't see how I can get at the modifiers on the server side.[/2]
I'd be interested in using your services to write some custom code.
Let me know if your interested.
Thanks
|
|
|
|
Rank: Member
Joined: 4/10/2006(UTC) Posts: 462
|
Please contact me via e-mail to discuss this. You can use the contact form here http://bvctaxdemo.caplinktech.net/ContactUs.aspx (helps keep my e-mail from getting spammed). |
Netriplex Corporation<br /> |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.