Php 脚本标记未在shopify的frontstore上显示任何内容

Php 脚本标记未在shopify的frontstore上显示任何内容,php,shopify,Php,Shopify,我已经使用shopify Api创建了一个脚本标记 $src = "http://localhost/shopifyplugin/shopify.js"; $script = $sc->call('POST', '/admin/script_tags.json', array( "script_tag"=> array( "event"=>"onload", "src"=>"$src"

我已经使用shopify Api创建了一个脚本标记

    $src = "http://localhost/shopifyplugin/shopify.js";
    $script = $sc->call('POST', '/admin/script_tags.json', array(
            "script_tag"=> array(
                "event"=>"onload", "src"=>"$src"
             )));
js文件代码:

console.log("Coming here...");
alert("coming here...");
jQuery("form[action='/cart/add']").each(function() {
  console.log("I'm in product page");
});
但是,在商店里它没有显示任何东西。我需要包括jquery吗?如果需要,那么我需要包括在哪个文件中,我正在index.php文件中创建脚本标记。

试试看。你很可能会得到更好的支持


另外,对于javascript帮助:)

Yes如果使用jQuery,则需要包含jQuery。在调用它的任何函数之前,您可以在任何地方包含它。我已经创建了脚本标记,但它没有显示在商店的任何首页。@SyedAli您能解释一下如何添加脚本标记吗?我收到了这个错误警告:Closure::call()希望参数1是对象,字符串给定,或者您能参考一些教程,从中我可以得到帮助,我在这一点上有点结巴。Thankscript标记已经创建,在我的js文件中,我只是在控制台上显示了一些东西,但在商店首页上什么也没有显示。