Should be able to replace ‘PRODUCT-NAME’ with $post->post_title as long as that code is in a post loop.
It works. Thanks! You dont want to know how much time i spent trying to figure it out by myself!
This is a variation on that question, but definitely related… in the same cart plugin, how could you get the data from a custom field that contains the product name and price into the cart button template code? For example, the cart uses:
<?php echo print_wp_cart_button_for_product(‘PRODUCT-NAME’, PRODUCT-PRICE); ?>
and the info I want is stored in custom field keys “MMTname” and “MMTprice”…. I am already displaying this data (and more) from custom fields in the same page.
Help greatly appreciated!
Nevermind… going on what was suggested above, I put the custom field data into $vars like:
$prodname = c2c_get_custom('MMTname');
$prodprice = c2c_get_custom('MMTprice');
and then later, when calling the cart button, used them, like so:
<?php echo print_wp_cart_button_for_product($prodname, $prodprice); ?>
Thanks for pointing me in the right direction!