{"id":59806,"date":"2025-04-24T09:43:55","date_gmt":"2025-04-24T01:43:55","guid":{"rendered":"https:\/\/fwq.ai\/blog\/59806\/"},"modified":"2025-04-24T09:43:55","modified_gmt":"2025-04-24T01:43:55","slug":"ecshop%e5%95%86%e5%93%81%e8%af%a6%e6%83%85%e9%a1%b5%e6%b7%bb%e5%8a%a0%e7%ab%8b%e5%8d%b3%e8%b4%ad%e4%b9%b0%e6%8c%89%e9%92%ae-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/59806\/","title":{"rendered":"ecshop\u5546\u54c1\u8be6\u60c5\u9875\u6dfb\u52a0\u7acb\u5373\u8d2d\u4e70\u6309\u94ae"},"content":{"rendered":"<p>ecshop\u5546\u54c1\u8be6\u60c5\u9875\u6dfb\u52a0\u7acb\u5373\u8d2d\u4e70\u6309\u94ae,\u6253\u5f00js\u6587\u4ef6\u52a0\u4e0b\u7684common.js\u6587\u4ef6\u641c\u7d22function addToCart(goodsId, parentId)\u5c06\u8fd9\u4e2a\u51fd\u6570\u590d\u5236\u4e00\u4efd\u653e\u5230\u5176\u4e0a\u65b9 <\/p>\n<p> \u5c06\u51fd\u6570\u540d\u6539\u4e3aaddToCart1<\/p>\n<p> \u5c06Ajax.call(&#8216;flow.php?step=add_to_cart&#8217;, &#8216;goods=&#8217; + goods.toJSONString(), addToCartResponse, &#8216;POST&#8217;, &#8216;JSON&#8217;);<\/p>\n<p> \u6539\u4e3aAjax.call(&#8216;flow.php?step=add_to_cart&#8217;, &#8216;goods=&#8217; + goods.toJSONString(), addToCartResponse1, &#8216;POST&#8217;, &#8216;JSON&#8217;);<\/p>\n<p> \u7ee7\u7eed\u641c\u7d22<\/p>\n<p> function addToCartResponse(result)\u5c06\u8fd9\u4e2a\u51fd\u6570\u590d\u5236\u4e00\u4efd\u653e\u5230\u5176\u4e0a\u65b9<\/p>\n<p> \u5c06\u51fd\u6570\u540d\u6539\u4e3aaddToCartResponse1<\/p>\n<p> \u5c06<\/p>\n<p> &nbsp;switch(result.confirm_type)<\/p>\n<p> &nbsp; &nbsp; &nbsp; {<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; case &#8216;1&#8217; :<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (confirm(result.message)) location.href = cart_url;<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; case &#8216;2&#8217; :<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!confirm(result.message)) location.href = cart_url;<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; case &#8216;3&#8217; :<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location.href = cart_url;<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; default :<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<\/p>\n<p> &nbsp; &nbsp; &nbsp; }<\/p>\n<p> \u6539\u4e3a\uff1alocation.href = cart_url;<\/p>\n<p> \u6253\u5f00\u6587\u4ef6goods.dwt\u641c\u7d22&nbsp;&lt;a href=&#8221;javascript:addToCart({$goods.goods_id})&#8221;&gt;\uff08\u6709\u4e9b\u6a21\u677f\u505a\u8fc7\u4fee\u6539\uff0c\u5176\u5b9e\u5c31\u662f\u67e5\u627e\u52a0\u5165\u8d2d\u7269\u8f66\u90a3\u4e2a\u6309\u94ae\u7684\u4f4d\u7f6e\uff09\u5728\u5176\u4e0b\u65b9\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801<\/p>\n<p> &lt;a href=&#8221;javascript:addToCart1({$goods.goods_id})&#8221;&gt;&lt;img src=&#8221;images\/bnt_cat1.gif&#8221; \/&gt;&lt;\/a&gt;<\/p>\n<p> \u6700\u540e\u81ea\u884c\u4e0a\u4f20\u4e00\u5f20\u56fe\u7247\u5230\u5bf9\u5e94\u6a21\u677f\u6587\u4ef6\u91cc\u7684images\u6587\u4ef6\u5939\u4e0b\uff0c\u5177\u4f53\u6837\u5f0f\u6839\u636e\u81ea\u5df1\u7684\u6a21\u677f\u8fdb\u884c\u8c03\u6574<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ecshop\u5546\u54c1\u8be6\u60c5\u9875\u6dfb\u52a0\u7acb\u5373\u8d2d\u4e70\u6309\u94ae,\u6253\u5f00js\u6587\u4ef6\u52a0\u4e0b\u7684common.js\u6587\u4ef6\u641c\u7d22function addToCart(goodsId, parentId)\u5c06\u8fd9\u4e2a\u51fd\u6570\u590d\u5236\u4e00\u4efd\u653e\u5230\u5176\u4e0a\u65b9 \u5c06\u51fd\u6570\u540d\u6539\u4e3aaddToCart1 \u5c06Ajax.call(&#8216;flow.php?step=add_to_cart&#8217;, &#8216;goods=&#8217; + goods.toJSONString(), addToCartResponse, &#8216;POST&#8217;, &#8216;JSON&#8217;); \u6539\u4e3aAjax.call(&#8216;flow.php?step=add_to_cart&#8217;, &#8216;goods=&#8217; + goods.toJSONString(), addToCartResponse1, &#8216;POST&#8217;, &#8216;JSON&#8217;); \u7ee7\u7eed\u641c\u7d22 function addToCartResponse(result)\u5c06\u8fd9\u4e2a\u51fd\u6570\u590d\u5236\u4e00\u4efd\u653e\u5230\u5176\u4e0a\u65b9 \u5c06\u51fd\u6570\u540d\u6539\u4e3aaddToCartResponse1 \u5c06 &nbsp;switch(result.confirm_type) &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; case &#8216;1&#8217; : &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (confirm(result.message)) location.href = cart_url; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break; &nbsp; &nbsp; &nbsp; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-59806","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59806","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=59806"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59806\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=59806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=59806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=59806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}