Jump to content

Cookie Variables OnClick?


ukvapeclub
 Share

Recommended Posts

Hi guys,

 

I've added this code into blockcart.tpl to add a button that prompts the customer to add an extra item to their order whenever a product is added to the cart.

<div>
 <a class="btn btn-default button button-medium" href="https://www.ukvape.club/31-coils" title="Add coils" rel="nofollow">
  <span>Add a pack of coils to my order</span>
 </a>
</div>

The result looks like this: post-873736-0-58327600-1433759016_thumb.jpg

 

Now I want some way to track which customers click the button, so I'm thinking of adding a variable in the cookie, something like

$cookie->upsellClick = 1;

That could be called in the "new order" email template.

 

What I want to know is, how can I set this cookie variable when the button is clicked? I'm assuming there's going to be some javascript involved, and being a total stranger to js I wouldn't know where to start.

 

If someone could point me in the right direction it would be a great help :)

 

Thanks in advance,

Stu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More