I have a custom button on my WooCommerce product pages that redirects to another website where the products can actually be bought (not WooCommerce). I would like for the link to add the title of the product at the end of the url, after the backslash. It would be something like: shopsite.com/name-of-product where the shopsite.com part is always the same, and through PHP or something else, the name-of-product just copies the product’s title and adds it to the end.
Right now, I have this:
function my_extra_button_on_product_page() {
global $product;
echo ‘<a id=”submit” class=”submit” href=”https://www.shop.bessia.com.ar/<?= get_title ?>”>Comprar en Mercado Shops</a>’;
}
Thanks!
[ad_2]