WooCommerce 10.2 Arrives September 16: A Simple Seller Guide
Exciting news for WooCommerce sellers! WooCommerce 10.2 is officially launching on September 16, 2025, introducing
When you go to purchase something from a store and they have no stock, it’s so disappointing. Knowing the product is not available and when it will be restocked makes things easier for the shopper. So here we have come up with a blog that will show you how to add stock status on the product page in Magento 2 PWA Studio. This will allow your customers to see stock availability messages on the product page.
Check out our Cenia Pro Theme for Magento 2 PWA, works fast and seamlessly.
Being the fourth blog in the series dedicated to Magento PWA Studio, you can check out our other publications related to PWA studio learnings-
By learning how to add stock status on the product page in Magento 2 PWA Studio you can assign statuses like in stock and out of stock for an inventory situation and products can be aligned either automatically or manually. This will help to keep your customers informed with precise information about stock availability.
First, you need to create a Venia project through scaffolding
https://magento.github.io/pwa-studio/pwa-buildpack/scaffolding/
yarn create @magento/pwa
Once you have your scaffolded Venia project Then go inside your project directory
Then we need to add our custom component for stock status in the Product Detail component
Click to check us out on GitHub
For this we need to add our code in local-intercept.js [YOUR_PROJECT_NAME/local-intercept.js]
function localIntercept(targets) { const { Targetables } = require('@magento/pwa-buildpack'); const targetables = Targetables.using(targets); // Create a targetable component linked to the productFullDetail.js file const ProductDetailsComponent = targetables.reactComponent( '@magento/venia-ui/lib/components/ProductFullDetail/productFullDetail.js' ); // Add an import statement to the productFullDetail.js file and const StockStatus = ProductDetailsComponent.addImport( "ProductStockStatus from '/src/components/ProductStockStatus'" ); // Insert the StockStatus component after the product name ProductDetailsComponent.insertAfterJSX( '<h1 className={classes.productName}>', `<${StockStatus} productSku={productDetails.sku} />` ); } module.exports = localIntercept;
We then need to add our component inside the src directory
Interesting reads: Why should you choose PWA Magento for eCommerce website?
index.js [YOUR_PROJECT_NAME/src/components/ProductStockStatus/index.js]
export { default } from './stockStatus.js';
stockStatus.js [YOUR_PROJECT_NAME/src/components/ProductStockStatus/stockStatus.js]
import React from 'react'; import useProductStockStatus from '../../peregrine/lib/talons/ProductStockStatus/useProductStockStatus.js'; const productStockstatus = props => { const {productSku} = props; const {stockStatus} = useProductStockStatus({ sku: productSku, }); return ( <> {stockStatus && <p>{stockStatus.replace(/_/g,' ')}</p>} </> ); }; export default productStockstatus;
Now add talon to get product stock status
Avail of our Cenia Pro theme user guide
useProductStockStatus.js [YOUR_PROJECT_NAME/src/peregrine/lib/talons/ProductStockStatus/useProductStockStatus.js
import { useMemo } from "react"; import { useQuery } from "@apollo/client"; import GET_PRODUCT_STOCK_STATUS from './productStockStatus.gql.js'; const useProductStockStatus = (props) => { const { sku } = props; const { error, loading, data } = useQuery(GET_PRODUCT_STOCK_STATUS, { fetchPolicy: "cache-and-network", nextFetchPolicy: "cache-first", variables: { sku: sku } }); const stockStatus = useMemo(() => { if (data && data.products.items[0]) { return data.products.items[0].stock_status; } return null; }, [data]); return { error, isLoading: loading, stockStatus }; }; export default useProductStockStatus;
productStockStatus.gql.js [YOUR_PROJECT_NAME/src/peregrine/lib/talons/ProductStockStatus/productStockStatus.gql.js]
import gql from "graphql-tag"; const GET_PRODUCT_STOCK_STATUS = gql` query getProductStockStatus($sku: String!) { products(filter: { sku: { eq: $sku } }) { items { stock_status } } } `; export default GET_PRODUCT_STOCK_STATUS;
After that run your project
yarn build
yarn start
This is what your end result should look like
This is the procedure that you can follow to add stock status on the product page in Magento 2 PWA Studio. We hope we were able to share it in a simple way and would encourage you to give it a try.
Check out our Magento 2 PWA Theme For ECommerce- an app-like experience at a fraction of the cost
You can expect similar articles as we want to share what we have learned, things that have made Cedcommerce what we are today.
Contact us for any related queries and we will be happy to help!
Exciting news for WooCommerce sellers! WooCommerce 10.2 is officially launching on September 16, 2025, introducing
Effective: September 30, 2025 (U.S. & Canada) Amazon is overhauling its inventory recovery programs. Starting
TikTok has rolled out a set of new support tools for TikTok Shop creators, aiming
Amazon has launched FBA Damaged Inventory Ownership, a program that lets sellers take direct control
Alibaba Group has unveiled a sweeping restructuring of its consumer-facing operations, merging Taobao, Tmall, Ele.me,
Walmart is ramping up its efforts to recruit merchants from the United Kingdom and continental
Amazon is doubling down on artificial intelligence in eCommerce with the launch of Lens Live,
For the first time since 2020, U.S. consumers are planning to cut back on holiday
Temu, the rapidly growing eCommerce platform, has announced the launch of its Local Seller Program
Etsy has announced important updates to its new Etsy Payments Policy, effective October 9, 2025,
Amazon has launched its first-ever “Second Chance Deal Days“ sales event in Europe, exclusively featuring
The Update Amazon has strategically resumed its Google Shopping ad campaigns across all international markets—
TikTok has updated its account policies, LIVE rules, monetization eligibility, and enforcement measures. The changes
Think Black Friday is when holiday shopping begins? Think again. Your future customers are already
eBay is rolling out eBay Live in the UK, offering sellers a new way to
eBay is giving its auto parts and accessories marketplace a tune-up, announcing the launch of
Walmart is set to revamp its Pro Seller Program at the end of September 2025,
Pinterest is diving headfirst into the burgeoning secondhand market with the launch of “Thrift Shop,”
Why Pinterest Is a Growth Channel for Etsy Sellers Discovery drives eCommerce growth. With 482
In a strategic move to enable smaller businesses with global ambitions, international logistics giant DHL