Jump to content

Modify product billing cycle on cart checkout


wirenine

Recommended Posts

8 hours ago, wirenine said:

Is it possible to add code on the cart checkout page with ajax to modify the product billing cycle? I want to do this so I can skip the unnecessary step of cart.php?a=confproduct just to select the billing cycle. Thanks!

if you know what the cycle is you want to pass, then it might be easier to do it earlier - so if we take your "Personal" hosting plan....

cart.php?a=add&pid=82

let's say we want to add it with an annual billing cycle (I know you already do this on your site)...

cart.php?a=add&pid=82&billingcycle=annually

let's say you want to go one stage further and add it with an quarterly cycle, but select the Amsterdam data center...

cart.php?a=add&pid=82&configoption[12]=23&billingcycle=quarterly

note the config options are listed before the billing cycle - weirdly, I don't think it works the other way around...

so now, we have automatically chosen the billing cycle, assigned the data center location... but the user still has to press Continue to carry on... this is when you can add skipconfig into the URL..

cart.php?a=add&pid=82&configoption[12]=23&billingcycle=quarterly&skipconfig=1

using this, they will skip the configuration stage and go straight from choosing a domain to checking out. 🎉

but note that using skipconfig in the URL only works if there are no more configuration changes needed... e.g if you had a product that had 2 separate configurable options, but you only passed a value for only one in the URL (along with skipconfig), then the user would still be directed to the configuration page to complete the second option selection.

for practical purposes, you could use these URL in your links on the main site if you wanted to assign a specific cycle, configurable option selections to the order... you could even modify the products template in the cart to assign default cycles/options to multiple products - but let's not go down that road unless we have to. 🙂

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