0.1.0 • Published 2 years ago
@mcxbr/customers-also-viewed v0.1.0
PWA customers-also-viewed
Magento backend options:
Installation
- Create an Empty PWA Studio Project by Scaffolding
cd your_project/src
mkdir @mcxbr
- copy module folder to
@mcxbr
- run command from root directory
- for development:
yarn add link:src/@mcxbr/customers-also-viewed
for production:
yarn add file:src/@mcxbr/customers-also-viewed
- for development:
- Add call extend-intercept.js to local-intercept.js. Example:
const amCustomerAlsoViewedIntercept = require('@mcxbr/customers-also-viewed/targets/extend-intercept');
function localIntercept(targets) {
amCustomerAlsoViewedIntercept(targets);
}
module.exports = localIntercept;
- Run the Watch command:
yarn watch
.
Related Product
Usage
Here's an example of basic usage:
import React from 'react';
import AmRelatedProducts from '@mcxbr/customers-also-viewed';
const MyComponent = (props) => {
const { product } = props;
return (
<div>
<AmRelatedProducts
sourceId={product.id}
position={'product_content_bottom'}
/>
</div>
);
}
Props
Prop name | Description | Default value | Example values |
---|---|---|---|
sourceId | Product or Category ID | 3 | 1 |
position | Block Position | category_content_bottom | possible values: 'product_before_related', 'product_after_related', 'product_into_related', 'product_before_upsell','product_after_upsell', 'product_into_upsell', 'product_content_top', 'product_content_tab', 'product_before_tab', 'product_content_bottom', 'product_sidebar_top', 'product_sidebar_bottom', 'cart_before_crosssel', 'cart_after_crosssel', 'cart_into_crosssel', 'cart_content_top', 'cart_content_bottom', 'category_content_top', 'category_content_bottom', 'category_sidebar_top', 'category_sidebar_bottom','custom' |
Bundle Packs
Usage
Here's an example of basic usage:
import React from 'react';
import { AmBundlePacks } from '@mcxbr/customers-also-viewed';
const MyComponent = (props) => {
const { product } = props;
return (
<div>
<AmBundlePacks sourceId={product.id} />
</div>
);
}
Props
Prop name | Description | Default value | Example values |
---|---|---|---|
sourceId | Product or Category ID | 3 | 1 |
0.1.0
2 years ago