Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customers want 10% on all Products in stock #1080

Closed
OlegoO opened this issue Jul 25, 2017 · 6 comments
Closed

Customers want 10% on all Products in stock #1080

OlegoO opened this issue Jul 25, 2017 · 6 comments

Comments

@OlegoO
Copy link
Contributor

OlegoO commented Jul 25, 2017

Customers want 10% on all Products in stock

Expected behavior

Create a new promotion based on inventory 10% on all Products in stock (Inventory.Quantity > 0)

@OlegoO OlegoO added this to the Operations milestone Jul 25, 2017
@OlegoO
Copy link
Contributor Author

OlegoO commented Jul 26, 2017

[Marketing Module]

  • Add new attributes into Promotion Context (InStockQuantity)
  • Extend UI
    image
  • Update evaluator

[Storefront]

  • Set PromotionContext.InStockQuantity on storefront to check

  • Acceptance Criteria:
    Create a new promotion based on inventory 10% on all Products in stock (Inventory.Quantity > 0)
    Promotions should be applied only on product with Inventory.Quantity > 0 only

@megafreeman
Copy link
Contributor

Added new condition for promotions based on inventory count for all product
image
image
image
VirtoCommerce/vc-module-dynamic-expressions@300bdbe

@megafreeman
Copy link
Contributor

Promotion condition with InStockQuantity parameter was improved. Now we can create promotion with different discounts depend on quantity of inventory in stock.
Here we created 3 promotions with different percent of discount. Discount depends on quantity of products in stock.
image

In catalog we set different in stock count of inventory in some products
image
image
image

As the result we can see different discounts for products
image

For correct work of promotion with InStockQuantity condition don't forget to set Fulfullment center for store
image

This functionality uses modules with versions:

  • Core module ver. 2.24.5 or above
  • Marketing module ver. 2.16.5 or above
  • Dynamic expressions module ver. 2.12.3 or above

Commit link: VirtoCommerce/vc-storefront@cac565a

@artem-dudarev @OlegoO @asvishnyakov could you make code review for this commit please.

@megafreeman
Copy link
Contributor

In last commits the process of receiving inventory for cart items was refactored to get data from the one method with cache. The obtained data are used in at least two cases:

  1. To validate cart items with specified rules.
  2. To fill the context to resolve promotion rewards.

VirtoCommerce/vc-storefront@d22ecb5
VirtoCommerce/vc-storefront@7d73158

@megafreeman
Copy link
Contributor

@alex765022 was assigned for code review

@alex765022
Copy link

Reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants