{"id":60926,"date":"2025-04-26T08:14:22","date_gmt":"2025-04-26T00:14:22","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60926\/"},"modified":"2025-04-26T08:14:22","modified_gmt":"2025-04-26T00:14:22","slug":"%e5%88%a4%e6%96%adzencart%e4%ba%a7%e5%93%81%e6%98%af%e5%90%a6%e5%85%8d%e8%b4%b9%e5%95%86%e5%93%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60926\/","title":{"rendered":"\u5224\u65adZenCart\u4ea7\u54c1\u662f\u5426\u514d\u8d39\u5546\u54c1"},"content":{"rendered":"<p> ZenCart\u7684zen_get_products_price_is_free \u51fd\u6570\u662f\u5224\u65ad\u4ea7\u54c1\u662f\u5426\u662f\u514d\u8d39\u7684\u5546\u54c1\uff0c\u8be5\u51fd\u6570\u7684\u5b9e\u73b0\u529f\u80fd\u5176\u5b9e\u5f88\u7b80\u5355\uff0c\u4e3b\u8981\u5c31\u662f\u83b7\u53d6\u4ea7\u54c1\u8868products \u7684product_is_free \u5b57\u6bb5\uff0c\u5982\u679c\u8be5\u5b57\u6bb5\u7684\u503c\u4e3a1\u8bf4\u660e\u8be5\u4ea7\u54c1\u662f\u5c5e\u4e8e\u514d\u8d39\u4ea7\u54c1\u3002\u8be5\u503c\u7684\u8bbe\u7f6e\u662f\u5728\u6dfb\u52a0\u4ea7\u54c1\u7684\u65f6\u5019\u6709\u8bbe\u7f6e\u3002\u9ed8\u8ba4\u8be5\u503c\u4e3a0\uff0c\u5373\u4e0d\u662f\u514d\u8d39\u5546\u54c1\u3002\u51fd\u6570\u7684\u53c2\u6570\u4e3a\u4ea7\u54c1\u7684ID\u503c\u3002<\/p>\n<p> \u51fd\u6570\u539f\u578b\u5982\u4e0b\uff0c\u51fd\u6570\u5b9a\u4e49\u4f4d\u4e8eincludesfunctionsfunctions_prices.php \u6587\u4ef6\u4e2d<\/p>\n<p> &nbsp;<\/p>\n<p> function zen_get_products_price_is_free($products_id) {<br \/> global $db;<br \/> $product_check = $db-&gt;Execute(\u201cselect product_is_free from \u201d . TABLE_PRODUCTS . \u201d where products_id = \u2018\u201d . (int)$products_id . \u201c\u2018\u201d . \u201d limit 1\u2033);<br \/> if ($product_check-&gt;fields[&#8216;product_is_free&#8217;] == \u20191\u2032) {<br \/> $the_free_price = true;<br \/> } else {<br \/> $the_free_price = false;<br \/> }<br \/> return $the_free_price;<br \/> }<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ZenCart\u7684zen_get_products_price_is_free \u51fd\u6570\u662f\u5224\u65ad\u4ea7\u54c1\u662f\u5426\u662f\u514d\u8d39\u7684\u5546\u54c1\uff0c\u8be5\u51fd\u6570\u7684\u5b9e\u73b0\u529f\u80fd\u5176\u5b9e\u5f88\u7b80\u5355\uff0c\u4e3b\u8981\u5c31\u662f\u83b7\u53d6\u4ea7\u54c1\u8868products \u7684product_is_free \u5b57\u6bb5\uff0c\u5982\u679c\u8be5\u5b57\u6bb5\u7684\u503c\u4e3a1\u8bf4\u660e\u8be5\u4ea7\u54c1\u662f\u5c5e\u4e8e\u514d\u8d39\u4ea7\u54c1\u3002\u8be5\u503c\u7684\u8bbe\u7f6e\u662f\u5728\u6dfb\u52a0\u4ea7\u54c1\u7684\u65f6\u5019\u6709\u8bbe\u7f6e\u3002\u9ed8\u8ba4\u8be5\u503c\u4e3a0\uff0c\u5373\u4e0d\u662f\u514d\u8d39\u5546\u54c1\u3002\u51fd\u6570\u7684\u53c2\u6570\u4e3a\u4ea7\u54c1\u7684ID\u503c\u3002 \u51fd\u6570\u539f\u578b\u5982\u4e0b\uff0c\u51fd\u6570\u5b9a\u4e49\u4f4d\u4e8eincludesfunctionsfunctions_prices.php \u6587\u4ef6\u4e2d &nbsp; function zen_get_products_price_is_free($products_id) { global $db; $product_check = $db-&gt;Execute(\u201cselect product_is_free from \u201d . TABLE_PRODUCTS . \u201d where products_id = \u2018\u201d . (int)$products_id . \u201c\u2018\u201d . \u201d limit 1\u2033); if ($product_check-&gt;fields[&#8216;product_is_free&#8217;] == \u20191\u2032) { $the_free_price = true; } else { $the_free_price = false; } return $the_free_price; }<\/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-60926","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60926","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=60926"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60926\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}