Internal Structure
Class ProductsQuery
ProductsQuery
import {ProductsQuery} from '@scandipwa/shopify-products/src/api/Products.query.js'
Description: A general product and product-list query declaration. Read more: Query controller, TypedQuery
Namespace: ShopifyProducts/Api/Products/Query/ProductsQuery
Method _getProductFields
_getProductFields
Description: A function which returns an array of product fields. Read more: Extending Query controllers
Method getProductByHandleField
getProductByHandleField
Description: General product field getter (by handle) [returns node]
Method getProductsField
getProductsField
Description: General product list field getter [returns edges]
Function processProduct
processProduct
import {processProduct} from '@scandipwa/shopify-products/src/api/Products.processor.js'
Description: The single product processor. Returns void, instead it modifies the passed argument.
Namespace: ShopifyProducts/Api/Products/Processor/processProduct
🔮 Common extension point: Great place to add some "calculated" field into product
{
'ShopifyProducts/Api/Products/Processor/processProduct': {
'function': ([product], callback) => {
callback(product);
product.myField = product.id + product.handle;
}
}
}
Function processProductByHandleResponse
processProductByHandleResponse
import {processProductByHandleResponse} from '@scandipwa/shopify-products/src/api/Products.processor.js'
Description: The single product query response processor
Namespace: ShopifyProducts/Api/Products/Processor/processProductByHandleResponse
Function processProductsResponse
processProductsResponse
import {processProductsResponse} from '@scandipwa/shopify-products/src/api/Products.processor.js'
Description: The product-list query response processor (from edges and nodes creates an array of products)
Namespace: ShopifyProducts/Api/Products/Processor/processProductsResponse
Variable PAGINATED_PRODUCTS
PAGINATED_PRODUCTS
import {PAGINATED_PRODUCTS} from '@scandipwa/shopify-products/src/api/Products.query.js'
Description: A type of ProductsQuery
associated with getProductsField
function.
Usage examples:
// Returns getter of paginated product query
import getProductQueryByType, { PAGINATED_PRODUCTS } from '@scandipwa/shopify-products/src/api/Products.query.js';
const queryGetter = getProductQueryByType(PAGINATED_PRODUCTS);
Variable SINGLE_PRODUCT
SINGLE_PRODUCT
import {SINGLE_PRODUCT} from '@scandipwa/shopify-products/src/api/Products.query.js'
Description: A type of ProductsQuery
associated with getProductByHandleField
function.
Usage examples:
// Returns getter of single product query
import getProductQueryByType, { SINGLE_PRODUCT } from '@scandipwa/shopify-products/src/api/Products.query.js';
const queryGetter = getProductQueryByType(SINGLE_PRODUCT);
Class ProductCardComponent
ProductCardComponent
import {ProductCardComponent} from '@scandipwa/shopify-products/src/component/ProductCard/ProductCard.component.js'
Description: The product card (preview) component
Namespace: ShopifyProducts/Component/ProductCard/Component/ProductCardComponent
Member sortedRenderMap
sortedRenderMap
Description: A list of render methods used by product card. Read more: SortedRenderMap
Class ProductCardContainer
ProductCardContainer
import {ProductCardContainer} from '@scandipwa/shopify-products/src/component/ProductCard/ProductCard.container.js'
Description: The product card (preview) container, used to provide a product context to all children components
Namespace: ShopifyProducts/Component/ProductCard/Container/ProductCardContainer
Function ProductFallbackPage
ProductFallbackPage
import {ProductFallbackPage} from '@scandipwa/shopify-products/src/component/ProductFallbackPage/index.js'
Description: A component used as fallback while the product page is loading
Namespace: ShopifyProducts/Component/ProductFallbackPage/Index/ProductFallbackPage
Class ProductHeroComponent
ProductHeroComponent
import {ProductHeroComponent} from '@scandipwa/shopify-products/src/component/ProductHero/ProductHero.component.js'
Description: The product hero (summary) component (usually on the top of Product page)
Namespace: ShopifyProducts/Component/ProductHero/Component/ProductHeroComponent
Class ProductMediaComponent
ProductMediaComponent
import {ProductMediaComponent} from '@scandipwa/shopify-products/src/component/ProductMedia/ProductMedia.component.js'
Description: Product media (gallery) component
Namespace: ShopifyProducts/Component/ProductMedia/Component/ProductMediaComponent
Class ProductPageComponent
ProductPageComponent
import {ProductPageComponent} from '@scandipwa/shopify-products/src/component/ProductPage/ProductPage.component.js'
Description: Product page component
Namespace: ShopifyProducts/Component/ProductPage/Component/ProductPageComponent
Member sortedRenderMap
sortedRenderMap
Description: The list of sections to be displayed on the product page. Read more: SortedRenderMap
Function ProductsFallbackPage
ProductsFallbackPage
import {ProductsFallbackPage} from '@scandipwa/shopify-products/src/component/ProductsFallbackPage/index.js'
Description: A component used as fallback while the product-list page is loading
Namespace: ShopifyProducts/Component/ProductsFallbackPage/Index/ProductsFallbackPage
Class ProductsPageComponent
ProductsPageComponent
import {ProductsPageComponent} from '@scandipwa/shopify-products/src/component/ProductsPage/ProductsPage.component.js'
Description: Product listing page component
Namespace: ShopifyProducts/Component/ProductsPage/Component/ProductsPageComponent
Class ProductsProvider
ProductsProvider
import {ProductsProvider} from '@scandipwa/shopify-products/src/context/Products.provider.js'
Description: The product context
Namespace: ShopifyProducts/Context/Products/Provider/ProductsProvider
Method getContextValue
getContextValue
Description: A product context value
🔮 Common extension point: Inject additional fields and methods into context
{
'ShopifyProducts/Context/Products/Provider/ProductsProvider': {
'member-function': {
'getContextValue': (args, callback) => ({
...callback(...args),
myMethod: (v) => { this.myProperty = v; },
myProperty: 'myOriginalValue'
})
}
}
}
Last updated
Was this helpful?