Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Price rules are not being applied to cart in shopify line item

Price rules are not being applied to cart in shopify line item

Codesto1
Shopify Partner
41 3 5

I currently have added a price rule to shopify via the post method.

const title = body.get("title");

const price_rule = new admin.rest.resources.PriceRule({session: session});
price_rule.title = title;
price_rule.value_type = "fixed_amount";
price_rule.value = "-10";
price_rule.customer_selection = "all";
price_rule.target_type ="line_item";
price_rule.target_selection = "entitled";
price_rule.allocation_method = "each";
price_rule.starts_at = "2018-03-22T00:00:00-00:00";
price_rule.entitled_product_ids = [
6952008155224
];

price_rule.prerequisite_quantity_range = {
"greater_than_or_equal_to": 2,
}

price_rule.allocation_limit = 3;

await price_rule.save({
update: true,
});
My expectation is that when I add the product 6952008155224 with greater or equal to quantity 2. That each item would deduct 10. Meaning if product is 30 it would -10 and give each one at 20. However I don't see anything in the cart or the checkout regarding the discount.

 

The post went in successful but it's not executing. Any idea if i'm missing something?

 

Replies 0 (0)