Skip to content

USF-3785: ACO PDP support#264

Closed
rossbrandon wants to merge 3 commits intoplpfrom
usf-3785-aco-pdp-support
Closed

USF-3785: ACO PDP support#264
rossbrandon wants to merge 3 commits intoplpfrom
usf-3785-aco-pdp-support

Conversation

@rossbrandon
Copy link
Collaborator

@rossbrandon rossbrandon commented Mar 6, 2026

Summary

Add PDP pre-rendering support for Commerce Optimizer (ACO) sites.

Ticket USF-3785

Changes

  • Detect site type via config['adobe-commerce-optimizer'] or config.headers.cs has headers with the AC- prefix.
  • Add categories field to ProductsQuery
  • Add categories field to product.json state file for use with future PLP pre-rendering.
  • Separate ACCS vs ACO product fetch logic into fetch-all-products/accs.js and fetch-all-products/aco.js files.

@rossbrandon rossbrandon requested a review from sirugh March 6, 2026 20:41
@sirugh sirugh changed the title Usf 3785 aco pdp support USF-3785: ACO PDP support Mar 9, 2026
@rossbrandon rossbrandon force-pushed the usf-3785-aco-pdp-support branch from 9b93edd to b3655ca Compare March 9, 2026 17:46
@rossbrandon rossbrandon requested a review from keoko March 9, 2026 20:56
const { requestSaaS } = require("../utils");
const { ProductsQuery } = require("../queries");

// Limiting at 10,000 products per category
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not applicable for the ACO implementation.

Suggested change
// Limiting at 10,000 products per category

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is applicable to ACO as well. It's a Catalog Service limitation on pagination (500 products per page, max 20 pages). I am reworking this logic to account for category paths related to the configured category families so we can get around this, though.

I think I'll just close this PR and open a new one with the reworked functionality.

let maxPage = productsResp.data.productSearch.page_info.total_pages;

if (maxPage > MAX_PAGES_FETCHED) {
console.warn(`Catalog has more than 10000 products.`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to make the error message more generic. Otherwise, any change on the pageSize or the MAX_PAGES_FETCHED would the error message be misleading.

Suggested change
console.warn(`Catalog has more than 10000 products.`);
console.warn(`Catalog has more products than the maximum supported. Only the first ${MAX_PAGES_FETCHED} pages will be fetched.`);

@rossbrandon
Copy link
Collaborator Author

Closed in favor of #265

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants