Sidney Posted November 18, 2017 Share Posted November 18, 2017 I need to make a few small tweaks to the new order and upgrade options pages. Basically I need to hide certain configurable options based on the selection of a previous configurable option. Example: Client orders new service with 4 configurable options: Dropdown of three different options -->Small -->Medium -->Large 3 different quantity based configurable options 1 - 5 units 1 - 29 units 1 - 70 units Based on the selection of the first option, 2 of the 3 quantity options should be hidden. This is so that I can limit the quantity that can be ordered when a certain "base" package is selected. I also need to hide those same configurable options from the order summary. There is an unavoidable complication. If any amount is selected in one of the configurable options, and the user for some reason changes the base option, the quantities need to be set back to zero. This is to prevent extra units being added to the cart that the user cannot "see" I need something similar if the user upgrades the options at a later stage. The complication there is that previously ordered quantities of configurable options need to be copied across to the new configurable option depending on the base option that is selected. This is to avoid the user accidentally upgrading the base but then setting his number of units to less than what they started with. I have looked around for add-ons and cart themes but nothing like this exists. If this can't be achieved with some simple hacking of the relevant tpl files, I'll have to engage with a dev company like modules garden. Can the community make any recommendations in that regard? Thanks for any assistance. Link to comment Share on other sites More sharing options...
brian! Posted November 19, 2017 Share Posted November 19, 2017 19 hours ago, Sidney said: I need to make a few small tweaks to the new order and upgrade options pages. Basically I need to hide certain configurable options based on the selection of a previous configurable option. if I had a pound/dollar/euro/rand for this being asked... 19 hours ago, Sidney said: Based on the selection of the first option, 2 of the 3 quantity options should be hidden. This is so that I can limit the quantity that can be ordered when a certain "base" package is selected. is the quantity a slider, and are the 3 configurable options priced the same? if yes to both, i'd be tempted to make those 3 config options just 1, edit the template and use some Smarty/jQuery code and set the limit of the slider to a value depending on the first config option (5,29,70 etc)... if those 3 options are priced differently, then ignore this suggestion! 20 hours ago, Sidney said: I also need to hide those same configurable options from the order summary. There is an unavoidable complication. If any amount is selected in one of the configurable options, and the user for some reason changes the base option, the quantities need to be set back to zero. This is to prevent extra units being added to the cart that the user cannot "see" that shouldn't be difficult if there are 3 options - you know two of them will be zero (as they'd be hidden previously)... if there is only one second config option, then the problem solves itself. 20 hours ago, Sidney said: I need something similar if the user upgrades the options at a later stage. The complication there is that previously ordered quantities of configurable options need to be copied across to the new configurable option depending on the base option that is selected. This is to avoid the user accidentally upgrading the base but then setting his number of units to less than what they started with. again, Smarty/jQuery is going to be your friend here. 20 hours ago, Sidney said: I have looked around for add-ons and cart themes but nothing like this exists i'm not aware of any addons either - a lot of users having been waiting years for WHMCS to add the feature - I doubt that it's imminent. whilst linking config options isn't technically difficult, it would take a lot of explaining... and/or planning. 20 hours ago, Sidney said: If this can't be achieved with some simple hacking of the relevant tpl files, I'll have to engage with a dev company like modules garden. to do this properly in the templates, you'd need to know your config option IDs - also, i'm assuming this is standard_cart and not a custom orderform template...? so while I could tell you generically how to do it, you'd be better off getting a developer in to work on a specific solution for your issue. 20 hours ago, Sidney said: Can the community make any recommendations in that regard? your best bet is to either post in Service Offers & Requests and ask for quotes for the project, or contact a developer directly by PM. Link to comment Share on other sites More sharing options...
Sidney Posted November 20, 2017 Author Share Posted November 20, 2017 Thanks for the reply Brian, this was more or less on the same track as I was thinking. I do like the idea of having a single quantity config option since the price is the same regardless of the base option you've selected. That does simplify the problem. Although I'm thinking perhaps setting the quantity should change the dropdown option to the relevant package. That way I can even hide the first option entirely. Just one option for the client to select and the rest is done behind the scenes. I will still present this on the order summary though. My main reason for wanting to engage with a developer is that then it could be made into an add-on that could benefit a lot of people. As you say, people have been asking for this for a while. For now though I'll try working on the solution myself. Link to comment Share on other sites More sharing options...
brian! Posted November 20, 2017 Share Posted November 20, 2017 Hi Sidney, 6 hours ago, Sidney said: I do like the idea of having a single quantity config option since the price is the same regardless of the base option you've selected. That does simplify the problem. Although I'm thinking perhaps setting the quantity should change the dropdown option to the relevant package. That way I can even hide the first option entirely. Just one option for the client to select and the rest is done behind the scenes. then isn't it an artificial problem? e.g if you have one configurable option that basically just controls a qty range on a 2nd option, and that 2nd option pricing is the same regardless of the first option, why not just give them the 2nd option only, give it a range of 1-70 and let them choose whatever qty they want... this "Small/Medium/Large" dropdown is irrelevant and not using it would also remove the need for any template hacks. 7 hours ago, Sidney said: I will still present this on the order summary though. well if you know the config quantity value in order summary (and you will), then you can add S/M/L to the output if you want to. 7 hours ago, Sidney said: My main reason for wanting to engage with a developer is that then it could be made into an add-on that could benefit a lot of people. yet if you try to imagine the complexity (permutations, combinations, conditions) needed to link potentially hundreds of configurable options with each other (and I know many users that have that many!), it's mind-blowing... there may be a very good reason why WHMCS haven't done it themselves, or any 3rd-party developer hasn't released such an addon... i'm not saying it's impossible, but it might be a bigger undertaking than you're imagining. Link to comment Share on other sites More sharing options...
Recommended Posts