Twice Commerce account needed.
Once plugin is activated, Twice Commerce shop block can be added via Gutenberg blocks. Plugin can be used also via shortcode, see below.
Block has few settings when it's selected:
- shop id (mandatory)
- location
- category
- product
- height
- disable auto scroll
- disable height animation
- locations view
- padding options
- custom class can be added to Gutenberg editor
As said, only shop id/name is mandatory. You can customise the output by defining more settings, such as location, category and/or product.
Following shortcode can be used: [twice_commerce_shop]
Shortcode can take different attributes:
shop==> Your Twice Commerce shop id/namelocation==> Your Twice Commerce location id/namecategory==> category id you want to showproduct==> specific product you want to showpadding==> vertical padding of the shop block. Can be one of the following:no-padding,small-padding,medium-padding,large-paddingheight==> height of the shop, example100%or700pxor100vhdisableautoscroll==> set to true, if you want to disable auto scrolldisableheightanimation==> set to true, if you want to disable height animationlocationsview=> set to true, if you want to list all store optionsclass==> if you want to wrap the element to custom class
Example: [twice_commerce_shop shop="myshop" location="mylocation"] ==> would show Twice Commerce iframe from the selected location.
This plugin is made using @wordpress/create-block. Use following commands to make dev work and build.
npm start ==> to start dev work and watch for changes
npm run build => build js/css for production