Say I have the ID of a product in wooCommerce; can I generate its URL somehow? (example /shop/fresh-apples)
Leave a Reply
You must be logged in to post a comment.
Say I have the ID of a product in wooCommerce; can I generate its URL somehow? (example /shop/fresh-apples)
You must be logged in to post a comment.
Products in WooCommerce are a custom post type, so this should work:
You can treat that
$product_id
as a postID (that’s what it is), so you can use it with other normal WP functions, like: