I have a 2 links on the product page which both need the modal popup component attaching to them, I have 1 working fine but If I try to add the same script for the 2nd one they both stop working
This is what I have for the first link:
require(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function(
$,
modal
) {
var options = {
type: 'popup',
responsive: false,
innerScroll: true,
buttons: []
};
var popup = modal(options, $('#finance-info'));
$("#finance-popup").on('click',function(){
$("#finance-info").modal("openModal");
});
}
);
For the second link I have:
require(
[
'jquery',
'Magento_Ui/js/modal/modal'
],
function(
$,
modal
) {
var options = {
type: 'popup',
responsive: false,
innerScroll: true,
buttons: []
};
var popup = modal(options, $('#information-mpdal'));
$("#request-more").on('click',function(){
$("#information-mpdal").modal("openModal");
});
}
);
Both of these scripts are in a custom.js file. Is it possible to have 2 modal popups on the same page?