How to dynamically generate product URL based on page name?

Hi All,

I want to have a page that shows some info about a product and then have a “Book Now” button at the bottom which links to the product. I’ve created a template for the page as shown below.

I want to update the button below so that the URL is dynamically generated based on the page name, so for example, the page is called “https://dev.prodivecentralcoast.com.au/pages/course-open-water” then the generated link would be "https://dev.prodivecentralcoast.com.au/products/course-open-water"

I’m using the Eurus theme if this is relevant. I’m just beginning with shopify so am a touch overwhelmed at the moment. I played with creating a dynamic source which seems to get close to what I’m after however it only accepts a full static url which in the case right now is pointing to a dev site. Hence the need to make it all dynamic based on the page url.

Cheers,

Paul

@pspeirs , Yes this is possible. if you want to keep the dynamic URL using metafield.

You have to first create the metafield for the page.

need to add the URL from the admin page and select it dynamically here using custom field key value.

let us know if you have any doubts.

Hi, Thanks for the response although it isn’t much help to me. I understand that there is a metafield I need to create on the page template however it’s the huge chunk in the middle that currently isn’t clear.

I should probably make clear as well, I’m not interested in paying someone to solve the issue, I’d like to learn how to do these small changes myself.

Okay, you can ask if you have doubt with this flow. will try to explain you in better way