From a20fb650fec0a8c8ce99c676cbefe8663fe32d1d Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 15 Oct 2019 14:42:09 +0530 Subject: [PATCH] code cleanup --- erpnext/public/js/shopping_cart.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/shopping_cart.js b/erpnext/public/js/shopping_cart.js index 5705a373752..44a8cd0067b 100644 --- a/erpnext/public/js/shopping_cart.js +++ b/erpnext/public/js/shopping_cart.js @@ -26,8 +26,12 @@ frappe.ready(function() { .html(' ' + full_name); } // set coupon code and sales partner code - var referral_coupon_code=getParams(window.location.href)['cc']; - var referral_sales_partner=getParams(window.location.href)['sp']; + + var url_args = getParams(window.location.href); + + var referral_coupon_code = url_args['cc']; + var referral_sales_partner = url_args['sp']; + var d = new Date(); // expires within 30 minutes d.setTime(d.getTime() + (0.02 * 24 * 60 * 60 * 1000));