Jump to content

Direct product link with billingcycle shows billing cycles again


innovator

Recommended Posts

FROM: http://docs.whmcs.com/Linking_to_WHMCS

To link to the order process with a given product and annual billing cycle preselected, you can use a link like this:

 

http://demo.whmcs.com/cart.php?a=add&pid=1&billingcycle=annually

 

I am trying the above out, where after clicking the link with the pre-selected billing cycle of 'annually', the domain options show up, after completing the domain selection page and continuing, the product configuration billing cycle options are shown again.

 

There are no product configuration options or custom fields attached to the product.

 

The desired effect is that after completing domain options the next page would be the checkout page, why is this behavior not happening ?

 

Thank you.

Link to comment
Share on other sites

brian,

 

thanks for the quick reply. I should have included that in my post, the problem with "&skipconfig=1" is that it will completely skip the config page.

 

So if there are configuration options or custom fields, all that will be ignored and go straight to the checkout.

 

The idea is if there are no "configuration options or custom fields" and we specify something like "billingcycle=annually" in the original link, there is no reason to show the product config page, because it also seems like a 302 redirect after the domain config page.

 

But if there are "configuration options or custom fields" the page should be shown, and ofcourse the cycle info can be removed from the template so that only the config options show.

 

 

ie use,

/cart.php?a=add&pid=1&billingcycle=annually -> dont show config page if no "configuration options or custom fields"

/cart.php?a=add&pid=1&billingcycle=annually -> show config page if there are "configuration options or custom fields"

 

"&skipconfig=1" -- just skips over the page entirely in both the about instances and goes to the checkout, which is not desired.

 

So why is this happening and how can it be done the way it should work ?

 

Thanks

Link to comment
Share on other sites

ok, it seems this has to be customized in a way for it to work, i think i got it down anyway,

 

basically a check to see if a product has conf options, if not add skip to the url, then either use the current conf page or create a custom page to redirect to.

 

thanks again brian for the reply.

Link to comment
Share on other sites

basically a check to see if a product has conf options, if not add skip to the url, then either use the current conf page or create a custom page to redirect to.

yeah, that seems the way to go... something roughly along the lines of..

 

{if $product.hasconfigoptions}

do this

{else}

do something else (e.g add skip)

{/if}

i'm not sure how you could check for the existance of custom fields at that stage though.

 

but if you get the code working, it might be useful to post here for others to use.

Link to comment
Share on other sites

brian,

 

yes this is what I am toying with, on the initial order page adding a hidden input with skipconfig true if $product.hasconfigoptions, that works as expected,

 

now the only problem is that creates a new issue, well atleast im not seeing the fix yet, basically when you select a domain and continue, i expect the domain options to show up on the next page, but with skipconfig set it now goes straight to the checkout page,

 

any ideas how when adding a domain i can get it to show the domain options page next ?

Link to comment
Share on other sites

it might be useful to see the code you have so far, but is the problem you're seeing now caused by someone just wanting a domain by itself - as opposed to hosting with a domain?

 

if so, how about a second if statement (or incorporate it into the first) along the lines of

 

{if $domain eq "register"} then don't skip config.. (maybe check for "transfer" too).

 

btw - which order form template are you using?

Link to comment
Share on other sites

The problem is when getting a domain with hosting, if they are getting just a domain there wouldnt be an issue coz skipconfig would not be true.

 

So on the initial order page i got

 

{if !$product.pricing.hasconfigoptions}

<input type="hidden" name="skipconfig" value="true" />

{/if}

With the url being something like http://demo.whmcs.com/cart.php?a=add&pid=1&billingcycle=annually

 

Then when you go to "Step 1 Choose Domain" and say register a new domain, it will skip right thru to /cart.php?a=view, coz of skipconfig=true,

 

where it should infact go to cart.php?a=confdomains

 

But unfrotunatly when registering the domain it seems you have to do a cart.php?a=add&pid=1 so if there was something you can tag along to that querystring which would add the domain and also go to the domain config page, that would work great.

Link to comment
Share on other sites

are you using verticalsteps?

 

I had a quick play with the whmcs demo and noticed some issues, but it's been a long day and I need a break!

 

one thought from left field - instead of editing the templates, would be it be an option to duplicate the product(s), give the duplicated products only annual payment price and hide the group?

 

i'm not sure how you intend to link to them, whether in a page or by sending links to customers, but the billing cycle shouldn't show.

Link to comment
Share on other sites

  • 5 months later...
are you using verticalsteps?

 

I had a quick play with the whmcs demo and noticed some issues, but it's been a long day and I need a break!

 

one thought from left field - instead of editing the templates, would be it be an option to duplicate the product(s), give the duplicated products only annual payment price and hide the group?

 

i'm not sure how you intend to link to them, whether in a page or by sending links to customers, but the billing cycle shouldn't show.

 

I didn't saw this thread before.

 

What is if only want to skip the product config but NOT domains config during order process? Any solution for this maybe?

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