Skip to content

castlebr/pwa-module-product-type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PWA Studio Product Type Extension

Preview

Create new product types in your pwa-studio using extensibility targetables api.

Compatibility: pwa-studio v11, v12

1. Installation

yarn add @castletech/pwa-module-product-type

2. Active module in your local-intercept

const {
  wrapProductTypeModule,
} = require("@castletech/pwa-module-product-type/targets");
wrapProductTypeModule({
  targets
});

3. Create new pwa-studio module

Create a new pwa-studio scaffolding module and connect the targetable productType api of the pwa-module-product-type module.

Exemple:

targets.of('@castletech/pwa-module-product-type').productType.tap(types =>
  types.add({
    condition: "product.__typename === 'BundleProduct'",
    componentName: 'ProductBundle',
    componentPath: '@castletech/pwa-module-product-bundle/lib/components/ProductBundle'
  })
);
prop description
condition It can be a product attr, such as __typename
componentName Name of the component to be imported
componentPath Path of the component to be imported

4. Run project

yarn watch

About

Create new product types for your storefront with pwa-studio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published