在我的 WooCommerce 网站中,我有一些价格相同的产品80 美元。
\n我想按产品数量添加折扣。
逻辑是这样的:
\n\nif (Products Quantity is 2){\n // the original product price change from 80$ to 75$ each.\n}\n\nif(Products Quantity is 3 or more){\n //the original product price change from 80$ to 70$ each. \n}\n
Run Code Online (Sandbox Code Playgroud)\n\n例如,
\n\n\n\n\n如果顾客选择了 2 个产品,则原价为
\n(80$ x 2)
=>160$
。\n
折扣后价格为:(75$ x 2)
=>150$
。
和\xe2\x80\xa6
\n\n\n如果访客选择了 3 个产品,则原价将为
(80$ x 3)
=>240$
。\n
但扣除费用后,将为:(70$ x 3) …