私はフロントエンド注文履歴の詳細ビューページで作業しています。リンクをクリックすると、動的ポップアップを表示する必要があります。モーダルポップアップをajaxで表示する必要があります。magento2 myaccountオーダービューページでモーダルajaxポップアップを追加するには?
誰かが解決策を持っている場合は、共有してください。
私はフロントエンド注文履歴の詳細ビューページで作業しています。リンクをクリックすると、動的ポップアップを表示する必要があります。モーダルポップアップをajaxで表示する必要があります。magento2 myaccountオーダービューページでモーダルajaxポップアップを追加するには?
誰かが解決策を持っている場合は、共有してください。
あなたはこれらのURLをチェックすることができます。
は、それがビューに私の自己 を解決しました/.../順/ item.phtmlはコードの下に追加
<div class="modal fade" id="myinfo-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<div class="my-container">your text here
</div>
</div>
</div>
<script>
require(['jQueryNoConflict'], function(jQuery){
jQuery(document).ready(function() {
jQuery(document).on('show.bs.modal','#myinfo-modal', function (e) {
jQuery.ajax({
url: '<your url here>',
type: 'POST',
data: {id: 3},
success: function(response){
jQuery('.my-container').html(response.success);
},
error: function(){
jQuery('.my-container').html("<your error msg here>");
}
});
});
}); });
ご注文/アイテム/レンダラで
は/コードの下に、このことができます
<a href="#" data-toggle="modal" data-target="#my-modal" data-id="2">View Modal Popup</a>
希望を追加default.phtml!