12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Mar 31, 2022

“Call for Pricing” for Products with Empty Prices in WP Grid Builder Cards

Sridhar Katakam

WP Grid Builder's "Active Price" product field displays prices in this format for products that do not have a price set: $0.00.

This members-only tutorial provides the steps to create a custom WP Grid Builder block in which we check for the price and if empty, displays a custom "Call for Pricing" text.

Step 1

Let's do some initial setup.

Go to Gridbuilder > Dashboard and import Carnelian card. This is the card used on the WPGB's WooCommerce demo.

Let's duplicate this as say, Carnelian-2 and use this copy.

Go to All Grids and create a new grid named say, Products Grid.

At Content Query, set Products as the post type.

At Grid Layout change the columns to a sensible values like this:

At Card Styles, set the card style to Carnelian-2.

Step 2

Show the Products Grid on the main Shop page.

If you are using Oxygen, create a Template that applies to product post type's archive, edit it and add a WPGB Oxygen add-on's Grid component. Select Products Grid.

Viewing the /shop page now on the front end should display the products grid.

Step 3

Time to register our custom block.

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: WP Grid Builder Block - Call for Pricing

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $599 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right