Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › eStore – Using a custom post type with metadata and Add to Cart › Reply To: eStore – Using a custom post type with metadata and Add to Cart
June 13, 2013 at 11:45 pm
#56094
Keymaster
Hi, Adding a purchase button for your product in the template file won’t be hard. Here is an example snippet of code that can retrieve the product ID value of a post from the custom field and then creates an “add to cart” button for that product:
<?php
$product_id = get_post_meta($post->ID, 'product_id', true);
get_button_code_for_product($product_id);
?>
Do you have a system in place for doing all these custom post type stuff though?