Getting slug of a product

  • 0

<?php

global $product;

$slug=$product->post->post_name;

echo $slug;

?>

<?php global $product; $slug=$product->post->post_name; echo $slug; ?>

<?php global $product; $slug=$product->post->post_name; echo $slug; ?>