Ecommerce Shopify WordPress Discussion

Use dynamic urls from post page to form page in gutenberg editor

I'm trying to use query parameters to prefill a jetpack contact form on a separate page. It's a woocommerce single product template page with a link like this: <a href="/inquiry-page?g1811-original=[post_title]">Inquire</a> I want to dynamically populate the post title (or post id, whatever works) in the url so when I get to the inquiry page it pre-fills the title in the field in the inquiry form: <input type="text" name="g1811-original" value="" placeholder="" required="" aria-required="true"> Right now the pre-fill works but the field just says "[post-title]". I'm trying to do this with shortcodes or similar in the Gutenberg editor without resorting to javascript/PHP if possible. Is there a way to use the visual editor or code editor to do this? EDIT: I've tried using woocommerce shortcodes but they didn't work either
I realized [post_title] didn't exist, so I created a custom shortcode. For some reason, other woocommerce shortcodes weren't working on the page, so I used these instructions. I added this through WPCode plugin but here's another more complete answer. /** * @snippet Echo Current Product/Post Name (Shortcode) * @usage Use [post_title] on the current post * @compatible WooCommerce 8 */ add_shortcode( 'post_title','get_the_title' ); After that inserting /art-inquiry?g1811-original=[post_title] in the Gutenberg link editor printed the title of the product into the url /art-inquiry?g1811-original=The%20Post%20Title which pre-filled the jetpack form.

February 4, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.