Jump to content

Need help with Addons !!!


ahrockz1

Recommended Posts

Hi!

I config a default host product:

*60G SSD

*1G BW

If my clients click on a product and they want to config its themself, what will i need to do ? They want to have more ,like: PLUS 10G SSD, 2G BW.

Can i config whmcs's addons so on website, when they chose a product, they could config or just click addon and the system could automatic create a product for them???

P/s: sr i am not good at english, if you can speak vietnamese, i will be very happy 😄

Link to comment
Share on other sites

Hello @ahrockz1

You will need to look at the 'Configurable Options' which can be found under Setup -> Products/Services -> Configurable Options.

This will allow you to set options that you can then allow your customers to change at time of order or for Upgrades/Downgrades.

https://docs.whmcs.com/Addons_and_Configurable_Options

You can then link this set of options to your product or products as needed

 

Edited by redit
Link to comment
Share on other sites

Oh my! Thank you, but it is only show like this:

0        1

2        3

How can you configue it into a straight line and in DROPDOWN, i can not choose "non or blank"

 

20 hours ago, redit said:

Hello @ahrockz1

You will need to look at the 'Configurable Options' which can be found under Setup -> Products/Services -> Configurable Options.

This will allow you to set options that you can then allow your customers to change at time of order or for Upgrades/Downgrades.

https://docs.whmcs.com/Addons_and_Configurable_Options

You can then link this set of options to your product or products as needed

 

 

Link to comment
Share on other sites

Hi @ahrockz1

My guess would be that you have the new option set as a 'Radio Button' if you go back into the configurable Options section and then edit the option that you created in the top right corner you will see a dropdown of the different element types simply change this to Dropdown and you should have what you need.

 

Link to comment
Share on other sites

On 16/08/2018 at 08:57, ahrockz1 said:

Oh my! Thank you, but it is only show like this:

0        1

2        3

How can you configure it into a straight line

you would likely need to edit the configureproduct.tpl template of your orderform and change col-sm-6 to col-sm-12

                                    {foreach $configurableoptions as $num => $configoption}
                                        {if $configoption.optiontype eq 1}
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <label for="inputConfigOption{$configoption.id}">{$configoption.optionname}</label>
                                                    <select name="configoption[{$configoption.id}]" id="inputConfigOption{$configoption.id}" class="form-control">
                                                        {foreach key=num2 item=options from=$configoption.options}
                                                            <option value="{$options.id}"{if $configoption.selectedvalue eq $options.id} selected="selected"{/if}>
                                                                {$options.name}
                                                            </option>
                                                        {/foreach}
                                                    </select>
                                                </div>
                                            </div>
                                        {elseif $configoption.optiontype eq 2}
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <label for="inputConfigOption{$configoption.id}">{$configoption.optionname}</label>
                                                    {foreach key=num2 item=options from=$configoption.options}
                                                        <br />
                                                        <label>
                                                            <input type="radio" name="configoption[{$configoption.id}]" value="{$options.id}"{if $configoption.selectedvalue eq $options.id} checked="checked"{/if} />
                                                            {if $options.name}
                                                                {$options.name}
                                                            {else}
                                                                {$LANG.enable}
                                                            {/if}
                                                        </label>
                                                    {/foreach}
                                                </div>
                                            </div>
                                        {elseif $configoption.optiontype eq 3}
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <label for="inputConfigOption{$configoption.id}">{$configoption.optionname}</label>
                                                    <br />
                                                    <label>
                                                        <input type="checkbox" name="configoption[{$configoption.id}]" id="inputConfigOption{$configoption.id}" value="1"{if $configoption.selectedqty} checked{/if} />
                                                        {if $configoption.options.0.name}
                                                            {$configoption.options.0.name}
                                                        {else}
                                                            {$LANG.enable}
                                                        {/if}
                                                    </label>
                                                </div>
                                            </div>

GQi6tqy.png

changes to...

CZ1tz94.png

Link to comment
Share on other sites

6 hours ago, ahrockz1 said:

There are a lot of files with the same name in "public_html/templates/orderforms".

there's only going to be one called configureproduct.tpl in your active orderform template. 😀

for the above code, i've assumed that you're using standard_cart.

7 hours ago, ahrockz1 said:

And is there any way to config it without changing the code?

no - because you're changing the layout, and that is controlled by the template... you couldn't really change it with a hook, unless the template was designed to be changed by it... and it isn't.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated