Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WooCommerce load products from thrid party API

I am just starting with woocommerce. As per documentation we need to import products to our database which have to be listed in our website. Basically app which we are developing act as a application where the role of database is very minimal. Vendor app will provide API For login, logout, product listing and everything. All I need to do is to integrate those API in my woocommerce app. What is the best way to do it? Is there any woocommerce hook available to achieve this? Is there any way to fetch the products from API rather from database??

like image 962
ShaMoh Avatar asked Jul 03 '17 10:07

ShaMoh


1 Answers

Yes there is lots of ways to achieve your goal. The best and with minial efforts and high performance. You can fetch API's response in memory instead of database and then store it to Redis cache.

Redis cache exipre in a specified time interval then again call will be made to API and cache will update. You can schedule frequency of caching based on your latency.

Thanks

like image 80
Kapil Yadav Avatar answered Sep 21 '22 14:09

Kapil Yadav