Advertisement
Guest User

Untitled

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