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 Programmers API available?

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › eStore Programmers API available?

Tagged: api, functions list

  • This topic has 4 replies, 3 voices, and was last updated 11 years, 5 months ago by wzp.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • August 31, 2012 at 5:39 pm #7289
    ishmaelangelo
    Member

    Where’s the API for programmers?

    This list is short and general, does me no good:

    http://www.tipsandtricks-hq.com/ecommerce/wp-content/uploads/wp-estore-shortcodes.pdf

    I need to know the list of class functions or API functions like WordPress provides (theID(),theCategory(),getPosts(),hasPosts(),etc)

    Where is the list of functions such as:

    eStore_has_items_in_cart()

    eStore_get_items_in_cart()

    eStore_get_products($category) //would return array of objects

    etc…

    Thanks

    August 31, 2012 at 10:17 pm #48861
    ishmaelangelo
    Member

    I found the extra short codes pdf: http://www.tipsandtricks-hq.com/ecommerce/wp-content/uploads/extra-eStore-shortcodes.pdf

    And I installed this addon. It provides more functionality however still not exactly what I am looking for.

    I may just end up writing some custom functions, if so I’ll post them here for others who want to query the products database and get PHP objects to work with.

    August 31, 2012 at 10:45 pm #48862
    ishmaelangelo
    Member

    Well, that wasn’t too hard, only took a little while using the functions in shortcode_include.php as templates.

    Here’s a couple of functions that you can place in your WordPress theme’s functions.php file:

    //returns a product object, you can then place values in your own HTML markup

    function eStore_get_product_by_ID($id)

    {

    if(empty($id))

    {

    return “You did not specify a product ID.”;

    }

    global $wpdb;

    $products_table_name = WP_ESTORE_PRODUCTS_TABLE_NAME;

    $wp_eStore_db = $wpdb->get_results(“SELECT * FROM $products_table_name where id=$id LIMIT 1”, OBJECT);

    if(!empty($wp_eStore_db))return $wp_eStore_db[0];

    else return false;

    }

    //returns an array of product objects, you can then output the product list in your own HTML markup using PHP loop

    function eStore_get_products_by_cat_ID($id,$limit=null)

    {

    if(empty($id))

    {

    return “You did not specify a category ID.”;

    }

    $limit = $limit == null?””:”LIMIT {$limit}”;

    global $wpdb;

    $cat_prod_rel_table_name = WP_ESTORE_CATEGORY_RELATIONS_TABLE_NAME;

    $products_table_name = WP_ESTORE_PRODUCTS_TABLE_NAME;

    $wp_eStore_db = $wpdb->get_results(“SELECT * FROM $cat_prod_rel_table_name INNER JOIN $products_table_name ON

    $cat_prod_rel_table_name.prod_id=$products_table_name.id where cat_id=$id ORDER BY name {$limit}”, OBJECT);

    if(!empty($wp_eStore_db))return $wp_eStore_db;

    else return false;

    }

    January 16, 2014 at 8:22 pm #48863
    ellie4905
    Member

    Hello – Not sure if this response will go back to OP or not…I am trying to do something a bit different than the shortcodes provide also, and I *think* this is what I need.

    However, I am not familiar with php, I am comfortable making changes as long as I have directions to follow though.

    Can you pls tell me

    A) does it matter where this goes in my functions file?

    B) How do I then call the code to perform on a page?

    I am wondering if this has now been added to eStore because I see the post is a year old…

    pls advise if possible…thank you :)

    January 16, 2014 at 9:51 pm #48864
    wzp
    Moderator

    What is it you are trying to do?

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 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