{extends file="coupon/type-fragments/base-remove-on-products.html"} {block name="discount-field"}
{/block} {block name="javascript-init"} // Hide selected products category selection if the // offered product is not yet selected. if ({$offered_category_value|default:0} == 0) { $('.input-coupon-category-id').hide(); } var $freeCatSelect = $('#free-product-category-id'); $freeCatSelect.change(function(ev) { var $category_id = $(this).val(); $('.input-coupon-category-id').hide(); $('#input-free-products-id').hide(); $('#free-products-id').html(''); if ($category_id != 0) { $('#input-free-products-id-loading').show(); $.ajax({ url: "{url path='/admin/coupon/type-fragments/ajax-products-list'}", type: 'POST', data: { category_id: $category_id }, success: function(options) { $('.input-coupon-category-id').show(); $('#free-products-id').html(options); $('#input-free-products-id').show(); }, complete: function() { $('#input-free-products-id-loading').hide(); } }); } }); {/block}