• moryoav

    (@moryoav)


    Hi. I’m creating a technology blog website, with some particular focuses.
    I have an affiliate account in Aliexpress and I was able to create a plugin that through their API grabs products relevant for my website.
    I now have an array of objects, each with a name, a URL and a price. I can get more information if needed as well. I want to now be able to “feed” this information to some kind of product gallery slideshow so the users of the website will see a nice slideshow of products. I could write the HTML/CSS/JS for such a slideshow myself but that seems like a waste of time. Surely there exists some off the shelf solution that can give me a shortcut here. Ideally, it would be great if my plugin were to store the data it grabs in some global variable (is there such a thing?) and I had a shortcode that simply displayed the daily products. I will run my plugin in cron once a day to refresh the list of products.

    Any ideas to help me move to the next step here?

    Anything will be appreciated… Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • lailagmelo

    (@lailagmelo)

    Are you using WooCommerce to register the products retrieved by the API?

    Thread Starter moryoav

    (@moryoav)

    no, I’m just holding a global variable with information on all the products and I want to create nice layouts with this information. I preferred something lighter than woocommerce, especially since I’m not selling those products, I’m just linking from them to aliexpress

    threadi

    (@threadi)

    I would recommend that you do not store the data in a global array but create it as custom post type data records after the import. This gives you the chance to use the magic of WordPress options, e.g. your own archive and single templates for your custom post type.

    See: https://developer.www.ads-software.com/plugins/post-types/registering-custom-post-types/

    If you want to display a gallery of products, you should first think about the layout. Only when you know how it should look (not necessarily pixel-perfect, but basically) can you consider how you want to enable it to be displayed in your plugin. This also depends on the PageBuilder and editor used. For the Block Editor you would have to write a block, for Elementor a widget. Of course, you can also provide a shortcode that outputs the data based on the archive template of the custom post type.

    Thread Starter moryoav

    (@moryoav)

    thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.