Liquid、JavaScript、主题、销售渠道。
1. 手动在后台管理页面添加完一个automatic的discount,用price rule的api获取不到这个discount的信息
await instance.rest.PriceRule.find({ session: this.getSession(), id: priceRuleId })2. 如何创建一个price rule,设置这个discount是automatic的呢
const instance = this.getInstance(); const priceRule = new instance.rest.PriceRule({ session: this.getSession() }); if (data.id) { priceRule.id = data.id; } else { priceRule.value_type = "percentage"; priceRule.value = "-100.0"; priceRule.customer_selection = "all"; priceRule.target_type = "line_item"; priceRule.target_selection = "entitled"; priceRule.allocation_method = "each"; priceRule.starts_at = "2023-07-21T00:00:00-00:00"; } priceRule.title = data.title; priceRule.prerequisite_product_ids = [data.buyProductId]; priceRule.entitled_product_ids = [data.getProductId]; priceRule.prerequisite_to_entitlement_quantity_ratio = { "prerequisite_quantity": data.buyNumber, "entitled_quantity": data.getNumber, }; await priceRule.save({ update: true, });
了解如何借助 Shopify Academy 的学习路径和验证技能徽章在全球市场拓展 Shopify 业务拓展全球业务。此学习路径经过精心策划,提供免费课程,目的是帮助您探...
By Shopify Feb 7, 2025利用 Shopify Academy 的学习路径 B2B on Shopify:启动和自定义扩大业务范围,开展批发销售业务。以下三组免费课程专门帮助您在 Shopify 商店...
By Shopify Jan 31, 2025在当今竞争激烈的电商市场中,视觉效果是吸引和留住客户的关键因素之一。高质量的图片不仅能提升店铺的专业形象,还能显著提高转化率和用户体验。研究表明,优质的产品图片可以增...
By Vikki Sep 15, 2024