有没有办法在单个shopify调用中使用多个变体ID获取多个变体详细信息.实际上,我想获得使用shopify电话订购的所有产品变型的价格.
我知道使用id获取单个变体细节的方法
GET /admin/variants/#{variant_id}.json
/admin/variants/808950810.json
我有多个HTML文件.我想根据条件在模态框中显示此文件内容.我不想使用iframe和javascript或jquery.所以有可能从php方面只有?
例:
<div class="modal fade bd-example-modal-lg shopify-onload-popup" id="defaultPopup-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<?php
if ($variable == 1) {
?>
<!-- Loade file1.html -->
<?php
} else {
?>
<!-- Loade file2.html -->
<?php
}
?>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我使用的代码如下:
if (window.history && window.history.pushState) {
window.history.pushState('forward', null, './#forward');
$(window).on('popstate', function () {
window.location.href = "https://www.google.com/";
});
}
Run Code Online (Sandbox Code Playgroud)
我想使用“推送状态”在 URL 中添加 #forward,然后如果用户单击浏览器后退按钮,我想重定向到另一个链接。
工作:它在 chrome 中工作,但不能与“CANARY”搜索引擎一起工作。请帮我弄清楚这个问题。提前致谢。