|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/lecturebazaar.com/resources/js/admin/ |
Upload File : |
(function () {
"use strict";
$('body').on('change', '.js-discount-type', function (e) {
const fixedAmountInputs = $('.js-fixed-amount-inputs');
const percentageInputs = $('.js-percentage-inputs');
if ($(this).val() === 'percentage') {
percentageInputs.removeClass('d-none');
fixedAmountInputs.addClass('d-none');
} else {
percentageInputs.addClass('d-none');
fixedAmountInputs.removeClass('d-none');
}
});
$('body').on('change', '.js-discount-source', function (e) {
const value = $(this).val();
const courseInput = $('.js-courses-input');
const categoriesInput = $('.js-categories-input');
const productsInput = $('.js-products-input');
const bundlesInput = $('.js-bundles-input');
courseInput.addClass('d-none');
categoriesInput.addClass('d-none');
productsInput.addClass('d-none');
bundlesInput.addClass('d-none');
if (value === 'course') {
courseInput.removeClass('d-none');
} else if (value === 'category') {
categoriesInput.removeClass('d-none');
} else if (value === 'product') {
productsInput.removeClass('d-none');
} else if (value === 'bundle') {
bundlesInput.removeClass('d-none');
}
});
})(jQuery);