Jump to content

Help with SSL URL


ocastaned

Recommended Posts

Int the services tab customer's side section in WHMCS next to each active service there is a lock showing customer their site doesn't have a SSL certificate, as you can see on this screenshot below, but when customer clicks that icon is taken to this page below that I don't know where is coming from. I would like to be able to redirect my customer to a another customized URL I have. Thank you for your help.

 

2Swf9ul

 

This is where my customers are redirected when click the no secure lock in their accounts:

 

38r7Pad

 

 

Edited by ocastaned
Link to comment
Share on other sites

15 hours ago, ocastaned said:

I would like to be able to redirect my customer to a another customized URL I have.

the thread below is the solution I posted a year ago for v7.7 - the jQuery tweak certainly still works in v7.9.1, but i'm not sure about the template changes option.

15 hours ago, ocastaned said:

This is where my customers are redirected when click the no secure lock in their accounts

it's almost as if the feature was added to increase MarketConnect revenue for WHMCS. 🤑

Link to comment
Share on other sites

16 hours ago, ocastaned said:

Thank you, but I am afraid that method doesn't work any more for WHMCS 7.9.1.

the jQuery solution definitely still does - I doubled-checked that before posting the above yesterday. 🙂

for example, in the screenshot below, i've changed the SSL link to go to the BBC News site - not a good place to buy SSL certificates, but it proves the point that the red padlock links are changing on the services (and domains) pages!

xL5pZa6.gif

using this technique, that link can be changed to a local page, e.g a specific cart group, a sales page on your site or as above, an external site - it can even be disabled so that the whole row just links to its product/domain details page.

ideally, someone should convert it to a hook, but as a proof of concept, it definitely still works in v7.9.1 thanks.png

actually, in an ideal world, there would have been a field in general settings where you could have added a specific sales URL yourself - but sadly, over the last few years, the default position of WHMCS is for them to make decisions on the users behalf and not give their paying users choices.

Link to comment
Share on other sites

1 minute ago, ocastaned said:

Thank you, I think I found the file to edit at templates/six/js/scripts.min.js.

that's the one - though if you're unfamiliar with it, then it might be easier to edit scripts.js (in the same folder but not used by WHMCS), go to a site like jscompress.com and compress the updated code... and then paste the compressed code into scripts.min.js

worst case, I can send you the updated scripts.min.js to use and then you can just do a string replace on the BBC domain in any text editor, but have a go at doing it yourself first.

7 minutes ago, ocastaned said:

Now my problem is, where am I supposed to put the URL when I want my customer to be redirected. I just see this code below, but I am not sure where to put that URL.

precisely how depends on where you want to redirect the end user.

so if you have a product group in your cart for Comodo SSL Certs, and it has the product group = 5, then the code to link to that group would be...

    jQuery(document).on('click', '.ssl-state.ssl-inactive', function(e) {
        e.preventDefault();
        var gidvalue="5";
        window.location.href = "cart.php?gid=" + gidvalue;
    });

technically, you could drop the var line and add its value directly to the URL, but I assume I originally added it as a separate line to simplify it for those users to just enter a product group ID separately rather than editing the URL itself... so the following should work too..

    jQuery(document).on('click', '.ssl-state.ssl-inactive', function(e) {
        e.preventDefault();
        window.location.href = "cart.php?gid=5";
    });

... and if you wanted to link it to an external site, then that last line becomes..

        window.location.href = "https://www.bbc.co.uk/news";

frustratingly, i've almost got this working as a hook, but it's changing the URL on all states, and not just inactive... so go with modifying scripts.min.js 🙂

Link to comment
Share on other sites

23 hours ago, brian! said:

that's the one - though if you're unfamiliar with it, then it might be easier to edit scripts.js (in the same folder but not used by WHMCS), go to a site like jscompress.com and compress the updated code... and then paste the compressed code into scripts.min.js

worst case, I can send you the updated scripts.min.js to use and then you can just do a string replace on the BBC domain in any text editor, but have a go at doing it yourself first.

precisely how depends on where you want to redirect the end user.

so if you have a product group in your cart for Comodo SSL Certs, and it has the product group = 5, then the code to link to that group would be...


    jQuery(document).on('click', '.ssl-state.ssl-inactive', function(e) {
        e.preventDefault();
        var gidvalue="5";
        window.location.href = "cart.php?gid=" + gidvalue;
    });

technically, you could drop the var line and add its value directly to the URL, but I assume I originally added it as a separate line to simplify it for those users to just enter a product group ID separately rather than editing the URL itself... so the following should work too..


    jQuery(document).on('click', '.ssl-state.ssl-inactive', function(e) {
        e.preventDefault();
        window.location.href = "cart.php?gid=5";
    });

... and if you wanted to link it to an external site, then that last line becomes..


        window.location.href = "https://www.bbc.co.uk/news";

frustratingly, i've almost got this working as a hook, but it's changing the URL on all states, and not just inactive... so go with modifying scripts.min.js 🙂

I used both and for some reason it didn't work.

2HhvYUC

 

I am currently using group 5 for my certificates page in WHMCS where I want to redirect customers. So I think the value I put nin the code should be fine.

 

2SIno6v

Is there any way I can send you both files scripts.js and scripts.min.js and you help me with the edits. Just in case I can pay for that.

 

Link to comment
Share on other sites

11 minutes ago, ocastaned said:

I am currently using group 5 for my certificates page in WHMCS where I want to redirect customers.

that wasn't a random guess on my part - I took a quick look at your site before posting to find the correct SSL group! 🙂

14 minutes ago, ocastaned said:

Is there any way I can send you both files scripts.js and scripts.min.js and you help me with the edits.

i'd only need scripts.js - I could edit that and minify it... I should ask, which version of WHMCS are you using ?

Link to comment
Share on other sites

22 hours ago, ocastaned said:

I am using WHMCS Versión: 7.9.1. You can download the file here: http://cloud2.zoolz.com/s-hVCwX26f

rename your existing /templates/six/js/scripts.min.js file and then upload the attached file - you may need to do a hard refresh in the browser, e.g CTRL + F5 on Firefox, to ensure that it's using the updated file.

this is tested as working on the v7.9.1 dev - I don't have a product group #5, so it's redirecting to cart.php instead, but it's definitely not going to the SSL page.

if it doesn't work, let me know. 🙂

Link to comment
Share on other sites

  • 4 weeks later...
On 2/14/2020 at 11:44 AM, brian! said:

rename your existing /templates/six/js/scripts.min.js file and then upload the attached file - you may need to do a hard refresh in the browser, e.g CTRL + F5 on Firefox, to ensure that it's using the updated file.

this is tested as working on the v7.9.1 dev - I don't have a product group #5, so it's redirecting to cart.php instead, but it's definitely not going to the SSL page.

if it doesn't work, let me know. 🙂

I am sorry I was sick, and I come back online today. Apparently the file has been deleted.

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