Jump to content

Hook on add to cart link


adw

Recommended Posts

I will be linking to my WHMCS site from a couple of other websites and want to pass a site=name parameter in the URL to set a cookie so that I can show the correct logo in the header:

add_hook('ClientAreaPage', 1, function () {
    // check $_GET['site'] and set cookie
});

However, this code does not work with the "Add to Cart" link such as: http://domain.com/cart.php?a=add&pid=1&site=name

This link redirects to the confproduct page and only then does the hook get fired, but then my site parameter is gone.

Is there a hook that will fire on the ?a=add link, before it gets redirected?

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