Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search


  • Content Count

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. This code will change the link on the button to a location and title of your choosing. You can set up a page, add a form to collect email, name, etc. then add a link to the download in the thank you message of the form. To use the code below, change dii and replacewith to meet your needs. To find dii, view the source code of the product page that you want to offer for free. Find the data-item-id tag for the add to cart button. e.g. change var dii = '524b3f23e4b030f838022bbc'; to var dii = 'my-data-item-id'; where my-data-item-id is the id you copied from the source code. Copy and paste the code to Config / Code Injection - Footer <script type="text/javascript"> function ReplaceContentInContainer(dii,content) { var matchClass = "sqs-add-to-cart-button"; var elems = document.getElementsByTagName('*'); for (i in elems) { if((" "+elems[i].className+" ").indexOf(" "+matchClass+" ") > -1) { //console.log(elems[i].getAttribute('data-item-id')) var di = elems[i].getAttribute('data-item-id'); if(di = dii) { elems[i].setAttribute('data-form',''); elems[i].innerHTML = content; } } } } window.onload = function () { var dii = '524b3f23e4b030f838022bbc'; var replacewith = '<div class="sqs-add-to-cart-button-inner"> <a style="color: #fff" href="http://www.google.com">Free Download</a></div>'; ReplaceContentInContainer(dii,replacewith); } </script>
  • Create New...