| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Validation onChange | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I have lots of exceptions and don't want my customers to have to press "add to Cart" to find out if their order is possible.
Is there any easy way to run the Exception Validation script every time a variant pull down is used. Best, James
__________________
Peter I X-Cart GOLD Plus 4.5.5 |
|||||||
#2
|
|||||||
|
|||||||
![]() James,
I just happen to be in that piece of code as I saw this message and see that the option exceptions are checked with each option change. Everytime an option is changed, it triggers via the following call: onchange="javascript: check_options();" check_options() is in the included in the skin1/modules/Product_Options/func.js and makes a call to check_exceptions() right at the bottom of the check_options function. This is bases on 4.1.8 Gold. I am looking to create a little code to use the exceptions to dynamically build only valid product options based upon the current selection... wish me luck. -Derrick Quote:
__________________
-Derrick |
|||||||
#3
|
|||||||
|
|||||||
![]() Derrick,
I saw that too, but it doesn't seem to do anything. I can select variants which are not allowed and only when I press add to cart does it seem to check to see if they are exceptions or not. If you have any tips on this I'd love to hear them....or if you get something working where only the valid options are displaying, that would be sweet. I have thought about paying X-cart for that functionality or try and build it myself, which would take me forever probably. The problem for us is that we have three pull downs...so the 2nd two have to be disabled until the first is selected and so on. This causes a page reload unless Ajax is used...so it's hairy... that's why I was going to settle for this temp solution of having the exception checked onChange instead of Add to Cart. Best, James
__________________
Peter I X-Cart GOLD Plus 4.5.5 |
|||||||
#4
|
|||||||
|
|||||||
![]() It may be that you are missing the error message since it is generated differently while checking inline versus checking at the time of submit. When you submit the form and there is an exception, it pops up a nice little javascript dialog box. If you pick an invalid combination inline, it just generates a poorly formatted text string right above the Quantity box. If you have modified the template, you may have removed the error string that it uses to report inline.
Go into view/source and search for "exception_msg" Hope this helps. The code I am writing will be quick and dirty to just remove any specific html option lines based upon the current selections. I'll post something when I get it done. In the mean time, you should be able to just report the error already being generated. If you still have a problem, send me a message with a link to take a look. -Derrick Quote:
__________________
-Derrick |
|||||||
#5
|
|||||||
|
|||||||
![]() That's what I was thinking too, but for me there are never pop ups, just the inline error messsage, which I get when I press ADD TO CART. So it's in my template, just not coming up when I change the pull down. If you have a minute and wouldn't mind a quick peak the site is here...
http://www.boozingtees.com/product.php?productid=16145 An exception is a Pink Hoodie. Thanks in advance!!! James
__________________
Peter I X-Cart GOLD Plus 4.5.5 |
|||||||
#6
|
|||||||
|
|||||||
![]() Very odd. I recreated almost the exact same scenario with multiple nested variants on my test site (4.1.
![]() The only thing that looks odd is that the index for the exceptions is consistently starting with "2" on your site. That _could_ be causing some issues with the loop, but I will have to take a look. I can take a deeper look, but would need access to the site. If you want me to take a look, I'd be happy to. You can PIM me with details if you want. -Derrick
__________________
-Derrick |
|||||||
#7
|
|||||||
|
|||||||
![]() Was there ever a solution for this? I want to be able to have customers select the first option and other options appear/disappear based on their first selection. Not all options will be linked as the selections will be universal, but as an example, if someone selects "Add Text" a text box will appear for their input. Also, if they choose a particular size, another option further down will change its drop down options to include different selections.
Is this possible via javascript or what is the best way to make this happen for a particular product, I don't want the page to have to re-load or them to have to wait until the pushing add-to-cart. Any and all help would be most apprecaited! Thanks! Mike |
|||||||
#8
|
|||||||
|
|||||||
![]() Yes and Yes.
There was a conflict on James' site from the addition of the prototype javascript libraries. Once that was corrected, the message issue was resolved. We went on to create a "dynamic option" module that would add/remove options based on the rules you define in the xcart admin section for that particular product. In James' example, if you put an exception rule in stating that you can't have a "hoodie" and a color "pink", then those two options would never be presented to the customer. The work was custom contracted work done for James by myself. It is all javascript code that manipulates the DOM based upon the selected options. I have reworked it and cleaned it up a little from this point, but it will give you the idea. I am not building this as a general module, but will do the work custom for a customers site if you are interested. -Derrick Quote:
__________________
-Derrick |
|||||||
#9
|
|||||||
|
|||||||
![]() Quote:
__________________
live: 4.3.2 w/below Mods On Sale MAP Mod Power Filter Mega Menu ezupsell youtube Dev: 4.4.1 |
|||||||
#10
|
|||||||
|
|||||||
![]() I'll send you a PM. I took the demo down when I moved hosting providers recently. I will put another demo up shortly. I have also made a few modifications to ensure proper operation with any variety of jquery, prototype, etc javascript libraries.
I do not sell this as a module or script simply for the reason that everyone seems to have some modification done to their site related to product or product options. It is much easier for me to just adjust as necessary if it is encountered. That is why I will need to take a quick look at the target site and then I'll contact you with a price for integration into your site. This code was written to leverage the existing X-Cart product option exceptions. When this code is installed, it dynamically adds/removes options based upon the exceptions already entered into the existing product option exception tables. The options are dynamically updated as various choices are made. This does work with variants and price modifiers. Customers have built some pretty elaborate models with tons of variants and lots of combinations. -Derrick Quote:
__________________
-Derrick |
|||||||
|
|||
X-Cart forums © 2001-2020
|