Skip to content

Commit

Permalink
Update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
herzog31 committed Mar 5, 2024
1 parent 671c4b4 commit a52c814
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions blocks/product-details/product-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class ProductDetailPage extends Component {
if (!loading && product) {
setJsonLdProduct(product);
// TODO: productId not exposed by catalog service as number
// TODO: Add eventInfo
window.adobeDataLayer.push({ productContext: { productId: 0, ...product } }, { event: 'product-page-view' });
}
}
Expand Down
1 change: 1 addition & 0 deletions blocks/product-list-page-custom/ProductList.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class ProductCard extends Component {
}

onProductClick(product) {
// TODO: Add eventInfo
window.adobeDataLayer.push({ event: 'search-product-click', eventInfo: { searchUnitId: 'searchUnitId', sku: product.sku } });
}

Expand Down
3 changes: 3 additions & 0 deletions blocks/product-list-page-custom/product-list-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,14 @@ class ProductListPage extends Component {
} else {
searchResultsContext.units[index] = searchResultUnit;
}
// TODO: Add eventInfo
dl.push({ searchResultsContext }, { event: 'search-response-received', eventInfo: { searchUnitId } });
if (this.props.type === 'search') {
// TODO: Add eventInfo
dl.push({ event: 'search-results-view', eventInfo: { searchUnitId } });
} else {
dl.push(
// TODO: Add eventInfo
{ event: 'category-results-view', eventInfo: { searchUnitId } },
{
categoryContext: {
Expand Down
1 change: 0 additions & 1 deletion blocks/product-recommendations/product-recommendations.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ main .section>div.product-recommendations-wrapper {

.product-recommendations .product-grid-item {
margin: 0;
width: 65vw;
scroll-snap-align: start;
}

Expand Down
2 changes: 2 additions & 0 deletions scripts/commerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ export async function getProduct(sku) {
// You can get this list via attributeMetadata query
export const ALLOWED_FILTER_PARAMETERS = ['page', 'pageSize', 'sort', 'sortDirection', 'q', 'price', 'size', 'color_family'];

// TODO: Move to custom block, since not needed anymore
export async function loadCategory(state) {
try {
// TODO: Be careful if query exceeds GET size limits, then switch to POST
Expand Down Expand Up @@ -394,6 +395,7 @@ export async function loadCategory(state) {
} else {
searchInputContext.units[index] = unit;
}
// TODO: Add eventInfo
dl.push({ searchInputContext }, { event: 'search-request-sent', eventInfo: { searchUnitId } });
});

Expand Down
1 change: 1 addition & 0 deletions scripts/minicart/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export async function addToCart(sku, options, quantity, source) {

// TODO: Find exact item by comparing options UIDs
const mseChangedItems = cart.items.filter((item) => item.product.sku === sku).map(mapCartItem);
// TODO: Add eventInfo
window.adobeDataLayer.push(
{ shoppingCartContext: mseCart },
{ changedProductsContext: { items: mseChangedItems } },
Expand Down

0 comments on commit a52c814

Please sign in to comment.