Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Call product through a custom field › Reply To: Call product through a custom field
November 11, 2009 at 7:52 am
#15912
Participant
Yep, something like this should definitely work.. do a test like the following:
<?php
if (get_post_meta($post->ID, 'productOne', true))
{
//first check to make sure you are getting the product id of the product
$product_id = get_post_meta($post->ID, 'productOne', true);
echo $product_id;
//then pass the product id to the function
echo get_button_code_for_product($product_id); ?>
}
?>
This way you will be able to see which part isn’t working
Another related post:
https://support.tipsandtricks-hq.com/forums/topic/custom-fields-within-php-shortcodes