Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

eStore – Using a custom post type with metadata and Add to Cart

by

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

Tagged: Custom post types, get product by name

  • This topic has 1 reply, 2 voices, and was last updated 12 years ago by admin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • June 13, 2013 at 7:00 am #9202
    Seahorse
    Member

    Hello,

    I would like to use custom posts to store my product info – I have a lot of data to store, including background colour, foreground colour, name, code, and so on, and I need to be able to sort/filter based on these attributes. What I would like to do is put some code in my template file that can automatically add an ‘add to cart’ based on data in my post, without having to create a product.

    -or-

    alternatively, automatically create a product based on a post.

    I’m making a system for downloading images, each post will have a thumbnail and a few different options of images in zip packs for download, eg, png, vector, etc, depending on the variation selected. I would like to be able to use WordPress post functionality to handle all the data for these, and use WP eStore to handle the costing, transaction and download aspect. Does anyone have any advice?

    Thank you!

    June 13, 2013 at 11:45 pm #56094
    admin
    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?

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ