Jump to content
phobosdthorga

Configurable Options - Selling in pre-set blocks of quantities

Recommended Posts

Hello! When making use of configurable options for an attached product that you are selling, is it possible to say, sell in blocks of '1024' as you adjust the quantity slider back and forth when you're the client? This is all I wanted to know, thank you!

chrome_2018-11-08_03-07-18.png

Share this post


Link to post
Share on other sites

Hi,

22 hours ago, phobosdthorga said:

When making use of configurable options for an attached product that you are selling, is it possible to say, sell in blocks of '1024' as you adjust the quantity slider back and forth when you're the client?

you would need to edit the configureproduct.tpl template... I previously wrote how to do this in the tutorial thread below from 4 years ago...

basically, you need to do two things...

  1. get the ID value for the configurable option.
  2. alter the template to define how large the steps are on the slider - default is 1, but you can use any integer value.

if we had a configurable option slider, with an ID of '32' (which you can find out in numerous way including checking the page source)...

bbQZVp8.png

and wanted to allow the slider to move in increments of 1024 instead of just 1, then in v7.6.1 using standard_cart, you would edit configureproduct.tpl and change...

                                                            jQuery("#inputConfigOption{$configoption.id}").ionRangeSlider({
                                                                min: {$configoption.qtyminimum},
                                                                max: {$configoption.qtymaximum},
                                                                grid: true,
                                                                grid_snap: setLargerMarkers ? false : true,
                                                                onChange: function() {
                                                                    if (sliderTimeoutId) {
                                                                        clearTimeout(sliderTimeoutId);
                                                                    }

                                                                    sliderTimeoutId = setTimeout(function() {
                                                                        sliderTimeoutId = null;
                                                                        recalctotals();
                                                                    }, 250);
                                                                }
                                                            });

to...

                                                            jQuery("#inputConfigOption{$configoption.id}").ionRangeSlider({
                                                                min: {$configoption.qtyminimum},
                                                                max: {$configoption.qtymaximum},
                                                                grid: true,
                                                                {if $configoption.id eq 32}
                                                                	step: "1024",
                                                                {/if}
                                                                grid_snap: setLargerMarkers ? false : true,
                                                                onChange: function() {
                                                                    if (sliderTimeoutId) {
                                                                        clearTimeout(sliderTimeoutId);
                                                                    }

                                                                    sliderTimeoutId = setTimeout(function() {
                                                                        sliderTimeoutId = null;
                                                                        recalctotals();
                                                                    }, 250);
                                                                }
                                                            });

0d66cMA.png

you can easily expand that code to have different configurable option sliders incrementing at different steps (e.g one at 1024, another at 512 etc).

Share this post


Link to post
Share on other sites

Wow, thank you so much for the wonderful post, brian! I honestly did not expect to receive such detail in reply to what I asked, but thank you! I will definitely follow up with what you have outlayed, or at least, give it to one of the individuals whom are more comfortable with web-coding at GekkoFyre Networks.

Share this post


Link to post
Share on other sites

Okay, so what you explained worked brilliantly on my end, but the pricing did not adjust accordingly. How do I have it so the pricing is also adjusted in 1024 MB blocks also, if you know? Thank you!

Share this post


Link to post
Share on other sites
22 hours ago, phobosdthorga said:

Okay, so what you explained worked brilliantly on my end, but the pricing did not adjust accordingly. How do I have it so the pricing is also adjusted in 1024 MB blocks also, if you know? Thank you!

it should do it automatically - take a look at the video below showing it working on a v7.6.1 dev - the only code change that i've made to the template is what I have posted above and it's adjusting the price accordingly.

https://www.screencast.com/t/FENlc5oK

if it's not working for you, and you're using the default themes (e.g Six and Standard_cart in v7.6.1), then I might need to see your WHMCS site to see what's going on... but out of the box, this should work automatically... I think only if you're using custom theme/orderform, might you run into an issue... but even that should be fixable as i'm not making the template do anything that it isn't designed to.

Share this post


Link to post
Share on other sites
14 hours ago, brian! said:

it should do it automatically - take a look at the video below showing it working on a v7.6.1 dev - the only code change that i've made to the template is what I have posted above and it's adjusting the price accordingly.

https://www.screencast.com/t/FENlc5oK

if it's not working for you, and you're using the default themes (e.g Six and Standard_cart in v7.6.1), then I might need to see your WHMCS site to see what's going on... but out of the box, this should work automatically... I think only if you're using custom theme/orderform, might you run into an issue... but even that should be fixable as i'm not making the template do anything that it isn't designed to.

I think I might've confused you in what was meant by the original reply. The pricing does adjust accordingly, yes, but say I want the RAM to be USD$4.95 per 1024 MB block. Currently, the only way to have it at the moment as I see it is for that to be USD$4.95 per every single megabyte. Does that help explain what we mean a little better? ^ ^;;

We're using a somewhat moderately modified 'Orbit' theme as the base from Zomex, which is constantly been worked on and improved as we see fit (I hope we're not breaking any advertising guidelines by posting links to them). Our site is GekkoFyre Networks, which is reopening hopefully within the next few days to a week or so, and accepting new clientele once again in that time.

I sincerely don't mean to offend you, brian!, but can anyone here vouch for you for in the event that we need to give you SFTP access to our main web-facing space?

Share this post


Link to post
Share on other sites
2 hours ago, phobosdthorga said:

I think I might've confused you in what was meant by the original reply. The pricing does adjust accordingly, yes, but say I want the RAM to be USD$4.95 per 1024 MB block. Currently, the only way to have it at the moment as I see it is for that to be USD$4.95 per every single megabyte. Does that help explain what we mean a little better? ^ ^;;

oh I see - you can't do that out of the box, quantities must be priced per unit... I suppose if you altered the database table structure and allowed for more decimal places, you could price them at $0.005 per MB (or whatever it would be), but that's not even worth considering.

the two easier solutions would be, if using a quantity slider, to sell them in blocks of 1GB rather than 1024MB - that's allows you to price per GB (e.g $4.95)... but if you're going to do this, you'll need to remove that additional code you added in configureproduct.tpl that moved the slider in steps of 1024 units, they now only need to move in single steps (as normal).

alternatively, you would use a dropdown and sell them in blocks of either GBs or 1024MB and price accordingly for each option.

YUrXMCZ.png

3 hours ago, phobosdthorga said:

I sincerely don't mean to offend you, brian!, but can anyone here vouch for you for in the event that we need to give you SFTP access to our main web-facing space?

if anyone vouches for me, who vouches for them? 😛

now that I know what you're talking about, I won't need access - I didn't before, I would have just needed to see what you were seeing (in the cart) to understand the issue (if the slider wasn't working as intended).

 

Share this post


Link to post
Share on other sites

Oh awesome! As you can see in the screenshot, what you propose should be an easy fix given the way how the module was built, we're inferring. I suppose the only way to really find out is to make the changes, create a test account, and create a test order 🙂

We just wish to do it this way because updating the price is so much easier than having to do it to a whole bunch of drop-down boxes, and the client gets/experiences a bit more configurability this way.

3 hours ago, brian! said:

if anyone vouches for me, who vouches for them? 😛

 now that I know what you're talking about, I won't need access - I didn't before, I would have just needed to see what you were seeing (in the cart) to understand the issue (if the slider wasn't working as intended).

That is a good point and I know the commercial world just loves to use blame as a militarized weapon, but I simply would have felt a bit more comfortable knowing there would have been a few individuals standing right with you (especially if they had high post counts!). That's all I meant by it 🙂

Do you yourself use WHMCS in any manner? I'd be interested in seeing what you have done with it, personally.

chrome_2018-11-13_00-59-16.png

Share this post


Link to post
Share on other sites
On 12/11/2018 at 14:12, phobosdthorga said:

Oh awesome! As you can see in the screenshot, what you propose should be an easy fix given the way how the module was built, we're inferring. I suppose the only way to really find out is to make the changes, create a test account, and create a test order

you shouldn't even need to do that - just add the configurable option to an existing product and test it in the cart - so making a test order should be unnecessary... except for peace of mind about the process!

On 12/11/2018 at 14:12, phobosdthorga said:

We just wish to do it this way because updating the price is so much easier than having to do it to a whole bunch of drop-down boxes, and the client gets/experiences a bit more configurability this way.

for simplicity of price updating, i'd have gone with the slider and that way you'd only have to update one price.

with more advanced coding, you could change the labels on the slider to suit your needs...

Fj5T9gJ.png

https://www.screencast.com/t/jNuvO49MrMkm

in the above screenshot, the configurable option slider is still set in GBs (Min: 0; Max: 5) and priced at £4.95 per GB... and as you can see from the video, the sliding will work and adjust the price accordingly.

of course, then you have the potential added complication that the order summary will still output in GBs - you could change that in the ordersummary.tpl template to show MB if you had to...

v3YNEIG.png

... but then you'd probably have to alter the viewcart templates similarly, along with possibly the invoice and email templates too.... hence why I originally said it was easier to just sell them in GBs!

On 12/11/2018 at 14:12, phobosdthorga said:

That is a good point and I know the commercial world just loves to use blame as a militarized weapon, but I simply would have felt a bit more comfortable knowing there would have been a few individuals standing right with you (especially if they had high post counts!). That's all I meant by it

that's ok - no offence was taken... though bear in mind that I didn't say I needed access, I just wanted to see the public site... over the years, i've found it quicker to actually see the public site myself rather than ask a series of questions and wait for the replies.

On 12/11/2018 at 14:12, phobosdthorga said:

Do you yourself use WHMCS in any manner?

it would take a sadist of extreme perversion to answer questions on WHMCS when they don't actually use it themselves! 🙂

i've got 2 live production WHMCS installations (probably reducing to one next year) and I think currently 9 different dev installations of various versions from v5.3 to v7.6.1... no doubt increasing to 10 after the forthcoming v7.7 beta is released. 🙄

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines