{% extends 'oscar/dashboard/vouchers/voucher_form.html' %}
{% load currency_filters %}
{% load i18n %}
{% block onbodyload %}
{{ block.super }}
// Retrieve and populate the offers field using pagination along with select2's remote data sets feature.
$("#id_offers").select2({
ajax: {
url: '/store/dashboard/offers/offers/',
data: (params) => {
return {
q: params.term,
page: params.page || 1,
offer_type: "Voucher",
items_per_page: 10,
};
},
dataType: "json",
cache: true,
},
minimumInputLength: 0,
});
{% endblock %}
{% block extrascripts %}
{{ block.super }}
{% endblock %}