I'm a frontender, so i'm not so used to work with php. But I need to solve something. I'm adding a shortcode within the single-product template, and inside this shortcode, I need to echo the slug from the product.
I've tried multiple things, but I cant get it to work.
<?php
global $post;
$post_slug = $post->post_name;
echo $post_slug;
echo do_shortcode('[sc name=" I NEED TO ECHO THE POST SLUG HERE "]');
?>
Maybe some of you, could help me out :)
Best regards, Michael