Plugin Directory

Issue #51 closed
Drew Angell repo owner created an issue

I have seen in other plugins where they advertise their premium extensions in what almost looks like a shopping cart built into a page in their plugin. I would like to do this here so that we can get our premium extensions shown to the people using the free plugin.

Official response

Comments (46)

  1. jignesh kaila

    I have started worked on this ticket, Once I am done with this will let you know for the same.

  2. jignesh kaila

    Below is zip file path which you I need to put on your live server to get all the product detail.

    http://ipntesting.projectsmd.in/api.zip

    Step 1: Extract api.zip file and put it on your root path of https://www.angelleye.com/

    Step 2: Open /api/getinfo.php file and set WooCommerce API Keys 1)Consumer Key 2) Consumer Secret for more info see the video http://screencast.com/t/smpM0RbldNMe

    Step 3: Url should be https://www.angelleye.com/api/getinfo.php or let me know new one.

    I will used this information https://www.angelleye.com/api/getinfo.php and display premium extensions.

    Let you know if any query or suggestion for me.

  3. Drew Angell reporter

    Do I need to use a particular category or tag for the premium extensions so you can easily pull them out of the feed that WC returns?

  4. jignesh kaila

    Here https://www.angelleye.com/web-services/woocommerce/api/getinfo.php I need short and sweet product information but this display all the information with html tag. so it will break design on PayPal IPN premium extensions.

    I think I need to used short description like below:

    short_details

    Also you need to change one line on web-services/woocommerce/api/getinfo.php

    line No: 24

    $product_array[$key]['description'] = $addon->description;
    

    to

    $product_array[$key]['short_description'] = $addon->short_description;
    

    let me know your suggestion for the same.

  5. jignesh kaila

    Almost I am done, just need to change one thing:

    In the premium extensions section we need to display only premium extensions product not all the product, for that you need to create like "premium extensions" or any thing that you like and then assign to that specific product which you want to display on premium extensions section.

    below are code that you need to change on : https://www.angelleye.com/web-services/woocommerce/api/getinfo.php file.

    $addons = json_decode($client->products->get($id = null, array( 'filter[category]' => 'CATEGORIES NAME' ))->http->response->body);
    

    just replace CATEGORIES NAME to you created categories name.

    let me know if any query.

  6. jignesh kaila

    Currently WooCommerce rest api support product filter only "type", "category", "sku" and "category".

    There is no filter is available for post tag in the WooCommerce rest api.

    let me know your suggestion for the same.

  7. Drew Angell reporter

    So if we go with category do I need a separate category for every plugin that has premium extensions? You mentioned a single category caled "Premium Extensions" but then that would pull all extensions for all plugins wouldn't it?

    So would I need separate categories like "PayPal IPN for WordPress Premium Extensions" and "Offers for WooCommerce Premium Extensions"? And then if so, we would need to dynamically pull the details in the getinfo.php..??

  8. Drew Angell reporter

    I wonder if WooCommerce API has been updated by now to include what I was originally wanting..?? Can we pull products based on a tag now, by chance?

  9. Pp Dev

    I have attached latest api.zip file, Can you please remove https://www.angelleye.com/web-services/woocommerce/api/ folder and used above api.zip file.

    Also you need to change below values:

    define('YOUR_STORE_URL', 'https://www.angelleye.com/');
    define('CONSUMER_KEY', 'ck_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
    define('CONSUMER_SECRET', 'cs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
    define('PRODUCT_TAG_NAME', 'premium_extensions');
    
  10. Drew Angell reporter

    I have updated the /api folder on angelleye.com with the version from the zip above.

    I have also created a new set of keys and updated the values in the getinfo.php file.

  11. Drew Angell reporter

    This is working, but not perfectly.

    1. It's pulling in the products that I have tagged accordingly, so that's good. It is not pulling the featured image for the product, though, so this is what I end up with:

    paypal-ipn-extensions.png

    1. The tag I'm using is "premium_extension" which is working, but in the future we will have premium extensions for more than just our IPN product. For example, we will also have premium extensions for our Offers for WooCommerce plugin, and we don't want extensions for Offers showing up in the IPN plugin or vice-versa.

    I think we're going to need to update our getinfo.php service running on angelleye.com to allow for dynamic tag values to be passed to it as opposed to setting a static value of "premium_extension" for the tag. This way we use tags like "offers_premium_extension" and "ipn_premium_extension" to separate them.

    If you have a better solution that's fine, but we need to address this one way or another.

  12. Drew Angell reporter

    Along with the image, we should pull the short description so we can display that as well.

  13. Drew Angell reporter

    I've made the adjustments.

    I see that you're using $_GET['tag'] now, but I don't see how that's getting sent to the service..??

    When I load the Premium Extensions tab in the plugin now it pulls various products, but I'm not even sure how it's deciding what to pull at this point..??

    It shows the description now, but still no image.

    ipn-premium-extensions.png

  14. Drew Angell reporter

    I tried adjusting the $addons_json variable to include the URL parameter on the endpoint...

    $addons_json = wp_remote_get('https://www.angelleye.com/web-services/woocommerce/api/getinfo.php?tag=ipn_premium_extension');
    

    It's still returning the same random products, though. Not sure how/where we're supposed to pass the URL parameter to getinfo.php at this point..??

  15. Drew Angell reporter

    It's also not working now if I edit getinfo.php directly...

    $addons = $woocommerce->get('products', array('filter[tag]' => 'ipn_premium_extension'));
    

    I do have two products currently setup with that tag, so I'm confused.

  16. Pp Dev

    Yes, you are right. Atually we are storing data in the transient . it will refresh data after one hours to reduce server request.

  17. Log in to comment