Hướng dẫn thêm chức năng tính lãi suất trả góp
Bước 1: thêm file js này vào master-include hoặc để trong thẻ head:
<script src="//hstatic.net/673/1000079673/1000112924/jquery.format.price.js"></script>
Bước 2: Trong file product.liquid copy đoạn html sau vào dưới cùng của file:
http://hstatic.net/716/1000033716/10/2016/5-31/popup_laisuat.txt
Bước 3: Chèn đoạn js này vào file product.liquid và cũng để dưới cùng.
http://hstatic.net/716/1000033716/10/2016/5-31/js_laisuat.txt
Trong đoạn js này có 1 đoạn khai báo: lai_suat = .178 -> .178 -> chính là mức lãi suất.
Bước 4: Tại thẻ button dùng để click vào để hiển Popup tính lãi suất, thêm đoạn code sau để gọi hàm xử lý: onclick="hrv_calc('{{ product.price }}', '{{ product.title }}')"
Ví dụ:
<div class="btn" id="Popup_tragop" onclick="hrv_calc('{{ product.price }}', '{{ product.title }}')">
<span >Mua trả góp</span>
</div>