Displaying woocommerce product urls from one site to another.

Some time ago I had a script made up to display my affiliates reference anywhere on my site using this shortcode “[blog_path_ref].

I now have an external woocommerce store that is tracking to my affiliates on our system. But I need to display a list of all products url’s from our external store to our main affiliate site backend, with the affiliate ref at the end (using the shortcode above).

Is there a way to display all our products from one site to another just as url’s with the shortcode as the ending to each url? (Note: I have already added the necessary script to make the shrotcode work on our site)

I have multiple sites but I figure I should at least try to get one working first or if you have a solution that can display from multiple sites, that would be great too.

Any help is appreciated!

  • Rupok
    • Support Ninja

    Hi Paul,

    That’s a nice question. I searched for you and found that WooCommerce supports REST API. So using that API, you can fetch list of products from another site and then programmatically add your affiliate link at the end of each URL. You will get details regarding WooCommerce REST API here: https://docs.woocommerce.com/document/woocommerce-rest-api/

    And to get the list of all products, you can check this documentation: http://woocommerce.github.io/woocommerce-rest-api-docs/?php#list-all-products

    I still searched for some examples but I’m afraid, I could not find any resource showing complete tutorial on this. So I think, it will take some time of you to play with this API and fetch data.

    BTW, you can always hire a developer from our Jobs Section. Please keep in mind, developers found in our Jobs Section are not associated with us in any way. So communicate with them well before you make any payments to them.

    Or if you want, I can move your thread to our Members’ Forum. There you can discuss this with our thousands of other members and I believe, they will be able to give you real-life examples, ideas and suggestions regarding how this can be done. Please confirm if you want me to move you thread to there.

    Have a nice day. Cheers!

    Rupok

  • Paul
    • The Crimson Coder

    Rupok

    Thank you so much for your help and reply. I think it is best if I try and work it out myself before going to the Members’ Forum. I have never done anything with API (Knowingly), so I am very novice and would like the experience.

    If I can’t find a solution, I will consider the Jobs Section idea.

    Thank you again. Very helpful!

    -Paul

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.