WordPress.org

Ready to get started?Download WordPress

Forums

Seamless Donations
[resolved] table data? (6 posts)

  1. cybershot
    Member
    Posted 6 months ago #

    It looks like all the data for this plugin is stored in the options table. Is there a specific name I could look for that has all the information I need? For example, lets say that I want to make a custom query to get all the donations and add them up so that I can make a widget showing the total donations. Where is the best place to find that information? I was looking at these two fields

    dgx_donate_log
    dgx_donate_designated_funds

    One had the custom charities that I set up and the other one had the amount donated. I was wondering if there was a better place. One field that contained the needed data?

    https://wordpress.org/plugins/seamless-donations/

  2. allendav
    Member
    Plugin Author

    Posted 5 months ago #

    Hi cybershot!

    There are plugin options in the options table, but the best place to retrieve the donations data is from the dgx-donation custom post type - each donation is saved in a post of that type.

    Hope this helps!

    Cheers...

    ...Allen

  3. cybershot
    Member
    Posted 5 months ago #

    that would help. But where is that custom post type in the database? I am looking for it. I found the options and I was able to get some but it doesn't print out what I would like. I get this

    Last amount contributed was 2014-02-22 02:34:24 Amount: 5.00

    I was hoping to find information about the charity it was donated to and just the amount. I created a widget to get this information from the database

  4. cybershot
    Member
    Posted 5 months ago #

    I can't find that post type anywhere in the database

  5. allendav
    Member
    Plugin Author

    Posted 5 months ago #

    Hi cybershot!

    If your post table is wrd_posts, you should see donations using something like

    SELECT * FROMwrd_postsWHERE post_type = "dgx-donation" LIMIT 0 , 30

    and then details, e.g. like the amount, should be in your post meta table, e.g.

    SELECT * FROMwrd_postmeta` WHERE meta_key = "_dgx_donate_amount"

  6. cybershot
    Member
    Posted 5 months ago #

    I was able to get a value for my widget. This is for a sidebar widget I made to get the last amount donated. There might be a better way but this seems to work.

    $rValue = "";
            $query = ("SELECT * FROM wp_sav_postmeta WHERE meta_key = '_dgx_donate_amount';");
            $result = mysql_query($query);
            if ($row = mysql_fetch_array($result)){
                $rValue = $row[3];
    			echo "Last amount donated: $" . $rValue;
    		} else {
    			echo "No donations as of yet.";
    		}

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.