diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 59188ce1b83..bf1243a6ff3 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -5679,6 +5679,8 @@ and [inventory](ctp:api:type:ProductProjectionInventoryEntries). If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the [availability of the Product](/projects/stores#products-available-in-store) in the specified Store. +If a [ProductTailoring](ctp:api:type:ProductTailoring) exists for the Product with the given `id` and the given Store, this endpoint returns the ProductProjection with tailored data. + When used with an API Client that has the `view_published_products:{projectKey}` scope, this endpoint only returns published (current) Product Projections. @@ -5719,6 +5721,8 @@ and [inventory](ctp:api:type:ProductProjectionInventoryEntries). If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the [availability of the Product](/projects/stores#products-available-in-store) in the specified Store. +If a [ProductTailoring](ctp:api:type:ProductTailoring) exists for the Product with the given `key` and the given Store, this endpoint returns the ProductProjection with tailored data. + When used with an API Client that has the `view_published_products:{projectKey}` scope, this endpoint only returns published (current) Product Projections. diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php index c3540961317..9c30bf58cc2 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet.php @@ -30,14 +30,14 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * @template-implements ProjectionSelecting + * @template-implements ProjectionSelectingTailoring * @template-implements PriceSelecting * @template-implements LocaleProjecting * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet extends ApiRequest implements ProjectionSelecting, PriceSelecting, LocaleProjecting, Expandable, Errorable, Deprecatable200 +class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsByIDGet extends ApiRequest implements ProjectionSelectingTailoring, PriceSelecting, LocaleProjecting, Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php index e64454139f1..7a8276cd2f3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet.php @@ -30,14 +30,14 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * @template-implements ProjectionSelecting + * @template-implements ProjectionSelectingTailoring * @template-implements PriceSelecting * @template-implements LocaleProjecting * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet extends ApiRequest implements ProjectionSelecting, PriceSelecting, LocaleProjecting, Expandable, Errorable, Deprecatable200 +class ByProjectKeyInStoreKeyByStoreKeyProductProjectionsKeyByKeyGet extends ApiRequest implements ProjectionSelectingTailoring, PriceSelecting, LocaleProjecting, Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php index 7df86063f1c..33da406269c 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsByIDGet.php @@ -33,12 +33,12 @@ * @template-implements ProjectionSelecting * @template-implements PriceSelecting * @template-implements LocaleProjecting - * @template-implements StoreProjecting + * @template-implements StoreProjectingTailoring * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyProductProjectionsByIDGet extends ApiRequest implements ProjectionSelecting, PriceSelecting, LocaleProjecting, StoreProjecting, Expandable, Errorable, Deprecatable200 +class ByProjectKeyProductProjectionsByIDGet extends ApiRequest implements ProjectionSelecting, PriceSelecting, LocaleProjecting, StoreProjectingTailoring, Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php index 487e7a52fe1..b5a9017ae9e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsGet.php @@ -33,7 +33,7 @@ * @template-implements ProjectionSelecting * @template-implements PriceSelecting * @template-implements LocaleProjecting - * @template-implements StoreProjecting + * @template-implements StoreProjectingTailoring * @template-implements Expandable * @template-implements Sortable * @template-implements Paging @@ -41,7 +41,7 @@ * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyProductProjectionsGet extends ApiRequest implements ProjectionSelecting, PriceSelecting, LocaleProjecting, StoreProjecting, Expandable, Sortable, Paging, Query, Errorable, Deprecatable200 +class ByProjectKeyProductProjectionsGet extends ApiRequest implements ProjectionSelecting, PriceSelecting, LocaleProjecting, StoreProjectingTailoring, Expandable, Sortable, Paging, Query, Errorable, Deprecatable200 { /** * @param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php index 911ba3f43d4..f6816be66ee 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsKeyByKeyGet.php @@ -33,12 +33,12 @@ * @template-implements ProjectionSelecting * @template-implements PriceSelecting * @template-implements LocaleProjecting - * @template-implements StoreProjecting + * @template-implements StoreProjectingTailoring * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyProductProjectionsKeyByKeyGet extends ApiRequest implements ProjectionSelecting, PriceSelecting, LocaleProjecting, StoreProjecting, Expandable, Errorable, Deprecatable200 +class ByProjectKeyProductProjectionsKeyByKeyGet extends ApiRequest implements ProjectionSelecting, PriceSelecting, LocaleProjecting, StoreProjectingTailoring, Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php index 65e92fa4261..63131a48607 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php @@ -35,12 +35,12 @@ * @template-implements ProjectionSelecting * @template-implements PriceSelecting * @template-implements LocaleProjecting - * @template-implements StoreProjecting + * @template-implements StoreProjectingTailoring * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyProductProjectionsSearchGet extends ApiRequest implements Sortable, Paging, ProjectionSelecting, PriceSelecting, LocaleProjecting, StoreProjecting, Expandable, Errorable, Deprecatable200 +class ByProjectKeyProductProjectionsSearchGet extends ApiRequest implements Sortable, Paging, ProjectionSelecting, PriceSelecting, LocaleProjecting, StoreProjectingTailoring, Expandable, Errorable, Deprecatable200 { /** * @param ?object|array|string $body diff --git a/lib/commercetools-api/src/Client/Resource/ProjectionSelectingTailoring.php b/lib/commercetools-api/src/Client/Resource/ProjectionSelectingTailoring.php new file mode 100644 index 00000000000..454da72bf7a --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ProjectionSelectingTailoring.php @@ -0,0 +1,24 @@ + + */ +interface ProjectionSelectingTailoring extends ApiRequestInterface +{ + /** + * @return ApiRequestInterface + * @psalm-return T + */ + public function withStaged(bool $staged); +} diff --git a/lib/commercetools-api/src/Client/Resource/StoreProjectingTailoring.php b/lib/commercetools-api/src/Client/Resource/StoreProjectingTailoring.php new file mode 100644 index 00000000000..9787c895f01 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/StoreProjectingTailoring.php @@ -0,0 +1,24 @@ + + */ +interface StoreProjectingTailoring extends ApiRequestInterface +{ + /** + * @return ApiRequestInterface + * @psalm-return T + */ + public function withStoreProjection(string $storeProjection); +} diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParams.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParams.php index 66e625ecaa7..022d3583673 100644 --- a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParams.php +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParams.php @@ -81,10 +81,11 @@ public function getLocaleProjection(); /** *

key of an existing Store. - * If the Store has defined some languages, countries, distribution or supply Channels, + * If the Store has defined languages, countries, distributionChannels, or supplyChannels, * they are used for projections based on locale, price, * and inventory. - * If the Store has defined Product Selections or Product Tailoring, they have no effect on the results of this query.

+ * For Projects with active Product Selections, the API does not take the availability of the Product in the specified Store into account. + * Product Tailoring modifies the product information returned in API responses, but evaluating query expressions is restricted to the original product information.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsBuilder.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsBuilder.php index 386793a560c..2f7bed9feb1 100644 --- a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsBuilder.php @@ -148,10 +148,11 @@ public function getLocaleProjection() /** *

key of an existing Store. - * If the Store has defined some languages, countries, distribution or supply Channels, + * If the Store has defined languages, countries, distributionChannels, or supplyChannels, * they are used for projections based on locale, price, * and inventory. - * If the Store has defined Product Selections or Product Tailoring, they have no effect on the results of this query.

+ * For Projects with active Product Selections, the API does not take the availability of the Product in the specified Store into account. + * Product Tailoring modifies the product information returned in API responses, but evaluating query expressions is restricted to the original product information.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsModel.php b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsModel.php index ab68b3a0c4d..10932cc640f 100644 --- a/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsModel.php +++ b/lib/commercetools-api/src/Models/ProductSearch/ProductSearchProjectionParamsModel.php @@ -234,10 +234,11 @@ public function getLocaleProjection() /** *

key of an existing Store. - * If the Store has defined some languages, countries, distribution or supply Channels, + * If the Store has defined languages, countries, distributionChannels, or supplyChannels, * they are used for projections based on locale, price, * and inventory. - * If the Store has defined Product Selections or Product Tailoring, they have no effect on the results of this query.

+ * For Projects with active Product Selections, the API does not take the availability of the Product in the specified Store into account. + * Product Tailoring modifies the product information returned in API responses, but evaluating query expressions is restricted to the original product information.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoring.php b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoring.php index b589a8454c9..32013dc4b97 100644 --- a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoring.php +++ b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoring.php @@ -104,7 +104,9 @@ public function getStore(); public function getProduct(); /** - *

true if the ProductTailoring is published.

+ *

If true, the tailored information contained in the current ProductTailoringData is provided when retrieving the ProductProjection in Store. + * For information not part of the ProductTailoringData, the original information contained in the ProductData is provided. + * If false, only the original information contained in the ProductData is provided.

* * @return null|bool diff --git a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringBuilder.php b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringBuilder.php index b6270497d58..765617880f8 100644 --- a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringBuilder.php +++ b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringBuilder.php @@ -216,7 +216,9 @@ public function getProduct() } /** - *

true if the ProductTailoring is published.

+ *

If true, the tailored information contained in the current ProductTailoringData is provided when retrieving the ProductProjection in Store. + * For information not part of the ProductTailoringData, the original information contained in the ProductData is provided. + * If false, only the original information contained in the ProductData is provided.

* * @return null|bool diff --git a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraft.php b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraft.php index da83fa9e25a..a80d637bd1f 100644 --- a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraft.php +++ b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraft.php @@ -102,7 +102,8 @@ public function getMetaKeywords(); public function getSlug(); /** - *

If true, the ProductTailoring is published immediately.

+ *

Set to true to publish the ProductTailoring immediately. + * Otherwise, the tailored product information is just staged.

* * @return null|bool diff --git a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraftBuilder.php b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraftBuilder.php index ef50924e851..738e68f3f26 100644 --- a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraftBuilder.php @@ -193,7 +193,8 @@ public function getSlug() } /** - *

If true, the ProductTailoring is published immediately.

+ *

Set to true to publish the ProductTailoring immediately. + * Otherwise, the tailored product information is just staged.

* * @return null|bool diff --git a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraftModel.php b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraftModel.php index 45ec54357e6..ca6f5a0f856 100644 --- a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringDraftModel.php @@ -311,7 +311,8 @@ public function getSlug() } /** - *

If true, the ProductTailoring is published immediately.

+ *

Set to true to publish the ProductTailoring immediately. + * Otherwise, the tailored product information is just staged.

* * * @return null|bool diff --git a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringModel.php b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringModel.php index 8351b31cc40..c90f7063867 100644 --- a/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringModel.php +++ b/lib/commercetools-api/src/Models/ProductTailoring/ProductTailoringModel.php @@ -344,7 +344,9 @@ public function getProduct() } /** - *

true if the ProductTailoring is published.

+ *

If true, the tailored information contained in the current ProductTailoringData is provided when retrieving the ProductProjection in Store. + * For information not part of the ProductTailoringData, the original information contained in the ProductData is provided. + * If false, only the original information contained in the ProductData is provided.

* * * @return null|bool diff --git a/references.txt b/references.txt index 8eea0bef1d6..5421bba9616 100644 --- a/references.txt +++ b/references.txt @@ -374,3 +374,4 @@ be04b8a13c612b3eed8290dd00b81c2ebe16e5ed e2594613d04733e91fe77848b55c73f255fac743 d6a0c240644648d19c9880bc8eb48f961165dfec 020bd279b2cc54072bf692d0654c883d73ade338 +a4fe92e28e967d91ddaad6750b6434a65949b840