Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var __isp_options = {
  2.     isp_serp_callback: function() {
  3.         $jquery_isp('.isp_grid_product').each(function () {
  4.             var p_c, p = 0.00;
  5.             var id =  $jquery_isp(this).attr('product_id');
  6.             if ($jquery_isp(this).find("span.isp_product_price.isp_compare_at_price_exist").length > 0){
  7.                 p_c =  parseFloat($jquery_isp(this).find("span.isp_product_price.isp_compare_at_price_exist").text().replace("$",""));
  8.                 p = parseFloat($jquery_isp(this).find(".isp_compare_at_price").text().replace("$",""));
  9.             }
  10.             if (ISP_PRODUCTS[id] && $jquery_isp(this).find(".product_discount_p").length == 0 && p_c > 0)
  11.             {
  12.                 var discount = 100- Math.round((p_c / p)*100);
  13.                 $jquery_isp(this).find("span.isp_product_price.isp_compare_at_price_exist.money").after(
  14.                     '<span class="product_discount_p">('+ discount +'% OFF!)</span>');
  15.             }
  16.         });
  17.     },
  18.     isp_serp_quickview_callback: function() {
  19.         $jquery_isp('.isp_grid_product').each(function () {
  20.             var p_c,p = 0.00;
  21.             var id = $jquery_isp(".isp_quick_view_title").attr("product_id");
  22.             if ($jquery_isp(this).find("span.isp_product_price.isp_compare_at_price_exist").length > 0){
  23.                 p_c =  parseFloat($jquery_isp(this).find("span.isp_product_price.isp_compare_at_price_exist").text().replace("$",""))
  24.                 p = parseFloat($jquery_isp(this).find(".isp_compare_at_price").text().replace("$",""));
  25.             }
  26.             if (ISP_PRODUCTS[id] && $jquery_isp(this).find(".product_discount_p").length == 0 && p_c > 0 ) {
  27.                 var discount =100- Math.round((p_c / p)*100);
  28.                 $jquery_isp(this).find("span.isp_product_price.isp_compare_at_price_exist.money").after(
  29.                     '<span class="product_discount_p">*'+ discount +'% OFF!*</span>');
  30.             }
  31.         });
  32.     }
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement