How to get order value using cookies in clickfunnels

Get total order value using jquery in order complete page in clickfunnels

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery.cookie@1.4.1/jquery.cookie.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){
var  myOrderTotal = 0;
 $('.elOrderProductOptinPrice').each(function(i, el) {
       x = $(el).text().replace("$", "");
      var myStr = x.replace(/,/g, "");
    myAmount = parseFloat(myStr);
   myOrderTotal = myOrderTotal + myAmount ;
$.cookie("my_order_value",myOrderTotal);
  });

</script>

Leave a Reply

Your email address will not be published. Required fields are marked *