Skip to content

Discount migrations #2768

New issue

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

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

Already on GitHub? # to your account

Merged
merged 3 commits into from
Jun 9, 2025
Merged

Discount migrations #2768

merged 3 commits into from
Jun 9, 2025

Conversation

mnocon
Copy link
Contributor

@mnocon mnocon commented Jun 4, 2025

This PR describes the migrations available for Discounts.

Future improvement:

  • once I have a list of available conditions, I will link to them from the migrations page to make the usage of them in migrations easier.

Copy link

github-actions bot commented Jun 4, 2025

Preview of modified files

Preview of modified Markdown:

@mnocon mnocon marked this pull request as ready for review June 4, 2025 13:27
Copy link

github-actions bot commented Jun 4, 2025

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/data_migration/examples/discounts/discount_create.yaml


code_samples/data_migration/examples/discounts/discount_create.yaml

docs/content_management/data_migration/importing_data.md@514:``` yaml
docs/content_management/data_migration/importing_data.md@515:[[= include_file('code_samples/data_migration/examples/discounts/discount_create.yaml') =]]
docs/content_management/data_migration/importing_data.md@516:```

001⫶- type: discount
002⫶ mode: create
003⫶ identifier: summer_sale_2025
004⫶ translations:
005⫶ -
006⫶ language_code: eng-GB
007⫶ name: "Summer Sale 2025"
008⫶ description: "-10% on laptops"
009⫶ label: "HOT DEAL: Summer Sale!"
010⫶ label_description: "Get 10% off on selected items!"
011⫶ discount_type: cart
012⫶ priority: 8
013⫶ enabled: true
014⫶ user: admin
015⫶ startDate: '2024-01-01T00:01:00+00:00'
016⫶ endDate: null
017⫶ createdAt: null
018⫶ updatedAt: null
019⫶ rule:
020⫶ type: percentage
021⫶ expressionValues:
022⫶ discount_percentage: 10
023⫶ conditions:
024⫶ -
025⫶ identifier: is_in_currency
026⫶ expressionValues:
027⫶ currency_code: EUR
028⫶ -
029⫶ identifier: is_product_in_array
030⫶ expressionValues:
031⫶ product_codes:
032⫶ - product_code_book_0
033⫶ - product_code_book_1
034⫶ -
035⫶ identifier: is_product_in_quantity_in_cart
036⫶ expressionValues:
037⫶ quantity: 2


code_samples/data_migration/examples/discounts/discount_update.yaml


code_samples/data_migration/examples/discounts/discount_update.yaml

docs/content_management/data_migration/importing_data.md@521:``` yaml
docs/content_management/data_migration/importing_data.md@522:[[= include_file('code_samples/data_migration/examples/discounts/discount_update.yaml') =]]
docs/content_management/data_migration/importing_data.md@523:```

001⫶- type: discount
002⫶ mode: update
003⫶ match:
004⫶ field: identifier
005⫶ value: summer_sale_2025
006⫶ identifier: summer_sale_2025_updated
007⫶ translations:
008⫶ eng-GB:
009⫶ language_code: eng-GB
010⫶ name: Updated name
011⫶ description: Updated description
012⫶ label: Updated promotion label
013⫶ label_description: Updated promotion description
014⫶ priority: 5
015⫶ active: true
016⫶ user: admin
017⫶ startDate: '2024-01-01T00:00:00+00:00'
018⫶ endDate: null
019⫶ createdAt: null
020⫶ updatedAt: null
021⫶ rule:
022⫶ type: percentage
023⫶ expressionValues:
024⫶ discount_percentage: '10'
025⫶ conditions:
026⫶ -
027⫶ identifier: is_product_in_quantity_in_cart
028⫶ expressionValues:
029⫶ quantity: 2

Download colorized diff

@mnocon mnocon requested review from Steveb-p and konradoboza June 5, 2025 10:06
@mnocon mnocon requested review from a team and removed request for Steveb-p June 5, 2025 10:46
@ezrobot ezrobot requested review from adriendupuis, dabrt and julitafalcondusza and removed request for a team June 5, 2025 10:46
@mnocon mnocon changed the base branch from discounts-introduction to discounts June 9, 2025 15:00
@mnocon mnocon merged commit e5b1b11 into discounts Jun 9, 2025
10 checks passed
@mnocon mnocon deleted the discount-migrations branch June 9, 2025 15:00
mnocon added a commit that referenced this pull request Jun 9, 2025
* [Discounts] Added migration doc

* Added files

* Update docs/content_management/data_migration/importing_data.md
mnocon added a commit that referenced this pull request Jun 11, 2025
* [Discounts] Added migration doc

* Added files

* Update docs/content_management/data_migration/importing_data.md
mnocon added a commit that referenced this pull request Jun 11, 2025
* [PHP API] Discounts (#2763)

* [PHP API REF] Added Discount packages

* Generated PHP API for Discounts

* Discount product guide

* Fixed links and navigation

* Removed nav

* Fixed links

* Fixed typo

* Fixed badges

* Removed whitespace

* Fixes before review

* After review fixes

* Currency remark

* Discount migrations (#2768)

* [Discounts] Added migration doc

* Added files

* Update docs/content_management/data_migration/importing_data.md

* Applied suggestions from code review (#2767)

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Search overview (#2773)

* [Discounts] Search overview

* Fixes before review

* Reworded Type sort clause

* Update docs/search/discounts_search_reference/discounts_sort_clauses.md

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Event reference (#2776)

* [Discounts] Added event reference

* Fixed links

* Fixes before review

* Removed column

* [Discounts] Mentioned discounts in # and customer groups (#2775)

* Mentioned discounts in # and customer groups

* Before review fixes

* Added mention to the PIM guide

* [Discounts] Discount policies (#2771)

* Permissions

* Build fixes

* Fixed links

* Fixed last links

* Removed link

* Apply suggestions from code review

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* Discounts update (#2774)

* Added update instructions

* Fixed link

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>
mnocon added a commit that referenced this pull request Jun 11, 2025
* [PHP API] Discounts (#2763)

* [PHP API REF] Added Discount packages

* Generated PHP API for Discounts

* Discount product guide

* Fixed links and navigation

* Removed nav

* Fixed links

* Fixed typo

* Fixed badges

* Removed whitespace

* Fixes before review

* After review fixes

* Currency remark

* Discount migrations (#2768)

* [Discounts] Added migration doc

* Added files

* Update docs/content_management/data_migration/importing_data.md

* Applied suggestions from code review (#2767)

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Search overview (#2773)

* [Discounts] Search overview

* Fixes before review

* Reworded Type sort clause

* Update docs/search/discounts_search_reference/discounts_sort_clauses.md

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Event reference (#2776)

* [Discounts] Added event reference

* Fixed links

* Fixes before review

* Removed column

* [Discounts] Mentioned discounts in # and customer groups (#2775)

* Mentioned discounts in # and customer groups

* Before review fixes

* Added mention to the PIM guide

* [Discounts] Discount policies (#2771)

* Permissions

* Build fixes

* Fixed links

* Fixed last links

* Removed link

* Apply suggestions from code review

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* Discounts update (#2774)

* Added update instructions

* Fixed link

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>
mnocon added a commit that referenced this pull request Jun 13, 2025
* [PHP API] Discounts (#2763)

* [PHP API REF] Added Discount packages

* Generated PHP API for Discounts

* Discount product guide

* Fixed links and navigation

* Removed nav

* Fixed links

* Fixed typo

* Fixed badges

* Removed whitespace

* Fixes before review

* After review fixes

* Currency remark

* Discount migrations (#2768)

* [Discounts] Added migration doc

* Added files

* Update docs/content_management/data_migration/importing_data.md

* Applied suggestions from code review (#2767)

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Search overview (#2773)

* [Discounts] Search overview

* Fixes before review

* Reworded Type sort clause

* Update docs/search/discounts_search_reference/discounts_sort_clauses.md

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Event reference (#2776)

* [Discounts] Added event reference

* Fixed links

* Fixes before review

* Removed column

* [Discounts] Mentioned discounts in # and customer groups (#2775)

* Mentioned discounts in # and customer groups

* Before review fixes

* Added mention to the PIM guide

* [Discounts] Discount policies (#2771)

* Permissions

* Build fixes

* Fixed links

* Fixed last links

* Removed link

* Apply suggestions from code review

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* Discounts update (#2774)

* Added update instructions

* Fixed link

* [Discounts] Described Twig Components

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>
mnocon added a commit that referenced this pull request Jun 13, 2025
* [PHP API] Discounts (#2763)

* [PHP API REF] Added Discount packages

* Generated PHP API for Discounts

* Discount product guide

* Fixed links and navigation

* Removed nav

* Fixed links

* Fixed typo

* Fixed badges

* Removed whitespace

* Fixes before review

* After review fixes

* Currency remark

* Discount migrations (#2768)

* [Discounts] Added migration doc

* Added files

* Update docs/content_management/data_migration/importing_data.md

* Applied suggestions from code review (#2767)

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Search overview (#2773)

* [Discounts] Search overview

* Fixes before review

* Reworded Type sort clause

* Update docs/search/discounts_search_reference/discounts_sort_clauses.md

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Event reference (#2776)

* [Discounts] Added event reference

* Fixed links

* Fixes before review

* Removed column

* [Discounts] Mentioned discounts in # and customer groups (#2775)

* Mentioned discounts in # and customer groups

* Before review fixes

* Added mention to the PIM guide

* [Discounts] Discount policies (#2771)

* Permissions

* Build fixes

* Fixed links

* Fixed last links

* Removed link

* Apply suggestions from code review

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* Discounts update (#2774)

* Added update instructions

* Fixed link

* [Discounts] Added Twig reference

* Self review

* Apply suggestions from code review

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>
mnocon added a commit that referenced this pull request Jun 13, 2025
* [PHP API] Discounts (#2763)

* [PHP API REF] Added Discount packages

* Generated PHP API for Discounts

* Discount product guide

* Fixed links and navigation

* Removed nav

* Fixed links

* Fixed typo

* Fixed badges

* Removed whitespace

* Fixes before review

* After review fixes

* Currency remark

* Discount migrations (#2768)

* [Discounts] Added migration doc

* Added files

* Update docs/content_management/data_migration/importing_data.md

* Applied suggestions from code review (#2767)

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Search overview (#2773)

* [Discounts] Search overview

* Fixes before review

* Reworded Type sort clause

* Update docs/search/discounts_search_reference/discounts_sort_clauses.md

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Event reference (#2776)

* [Discounts] Added event reference

* Fixed links

* Fixes before review

* Removed column

* [Discounts] Mentioned discounts in # and customer groups (#2775)

* Mentioned discounts in # and customer groups

* Before review fixes

* Added mention to the PIM guide

* [Discounts] Discount policies (#2771)

* Permissions

* Build fixes

* Fixed links

* Fixed last links

* Removed link

* Apply suggestions from code review

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* Discounts update (#2774)

* Added update instructions

* Fixed link

* [Discounts] Added Twig reference

* Self review

* [Discounts] Release notes

* Added mention about the update

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>
mnocon added a commit that referenced this pull request Jun 13, 2025
* [PHP API] Discounts (#2763)

* [PHP API REF] Added Discount packages

* Generated PHP API for Discounts

* Discount product guide

* Fixed links and navigation

* Removed nav

* Fixed links

* Fixed typo

* Fixed badges

* Removed whitespace

* Fixes before review

* After review fixes

* Currency remark

* Discount migrations (#2768)

* [Discounts] Added migration doc

* Added files

* Update docs/content_management/data_migration/importing_data.md

* Applied suggestions from code review (#2767)

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Search overview (#2773)

* [Discounts] Search overview

* Fixes before review

* Reworded Type sort clause

* Update docs/search/discounts_search_reference/discounts_sort_clauses.md

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Event reference (#2776)

* [Discounts] Added event reference

* Fixed links

* Fixes before review

* Removed column

* [Discounts] Mentioned discounts in # and customer groups (#2775)

* Mentioned discounts in # and customer groups

* Before review fixes

* Added mention to the PIM guide

* [Discounts] Discount policies (#2771)

* Permissions

* Build fixes

* Fixed links

* Fixed last links

* Removed link

* Apply suggestions from code review

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* Discounts update (#2774)

* Added update instructions

* Fixed link

* [Discounts] Described Twig Components

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>
mnocon added a commit that referenced this pull request Jun 13, 2025
* [PHP API] Discounts (#2763)

* [PHP API REF] Added Discount packages

* Generated PHP API for Discounts

* Discount product guide

* Fixed links and navigation

* Removed nav

* Fixed links

* Fixed typo

* Fixed badges

* Removed whitespace

* Fixes before review

* After review fixes

* Currency remark

* Discount migrations (#2768)

* [Discounts] Added migration doc

* Added files

* Update docs/content_management/data_migration/importing_data.md

* Applied suggestions from code review (#2767)

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Search overview (#2773)

* [Discounts] Search overview

* Fixes before review

* Reworded Type sort clause

* Update docs/search/discounts_search_reference/discounts_sort_clauses.md

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Event reference (#2776)

* [Discounts] Added event reference

* Fixed links

* Fixes before review

* Removed column

* [Discounts] Mentioned discounts in # and customer groups (#2775)

* Mentioned discounts in # and customer groups

* Before review fixes

* Added mention to the PIM guide

* [Discounts] Discount policies (#2771)

* Permissions

* Build fixes

* Fixed links

* Fixed last links

* Removed link

* Apply suggestions from code review

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* Discounts update (#2774)

* Added update instructions

* Fixed link

* [Discounts] Added Twig reference

* Self review

* Apply suggestions from code review

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>
mnocon added a commit that referenced this pull request Jun 13, 2025
* [PHP API] Discounts (#2763)

* [PHP API REF] Added Discount packages

* Generated PHP API for Discounts

* Discount product guide

* Fixed links and navigation

* Removed nav

* Fixed links

* Fixed typo

* Fixed badges

* Removed whitespace

* Fixes before review

* After review fixes

* Currency remark

* Discount migrations (#2768)

* [Discounts] Added migration doc

* Added files

* Update docs/content_management/data_migration/importing_data.md

* Applied suggestions from code review (#2767)

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Search overview (#2773)

* [Discounts] Search overview

* Fixes before review

* Reworded Type sort clause

* Update docs/search/discounts_search_reference/discounts_sort_clauses.md

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* [Discounts] Event reference (#2776)

* [Discounts] Added event reference

* Fixed links

* Fixes before review

* Removed column

* [Discounts] Mentioned discounts in # and customer groups (#2775)

* Mentioned discounts in # and customer groups

* Before review fixes

* Added mention to the PIM guide

* [Discounts] Discount policies (#2771)

* Permissions

* Build fixes

* Fixed links

* Fixed last links

* Removed link

* Apply suggestions from code review

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>

* Discounts update (#2774)

* Added update instructions

* Fixed link

* [Discounts] Added Twig reference

* Self review

* [Discounts] Release notes

* Added mention about the update

---------

Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants