In Woocommerce, how to use a legacy API version within another plugin code ?
Currently, the newest API version of Woocommerce is loaded, thus when using WC_API_Server, it uses the latest one, and not a legacy one (version 3 needed) :
calling the class LMB_API_Server extends WC_API_Server
I cannot change the Woocommerce plugin, nor its version - ideally, all I should be able to do is within the third party plugin that I develop.
In the woocommerce folder :
includes\
api\
*manyPHPfileofcurrentVersion*
...
legacy\
v1\
v2\
v3\
*oldPHPfilesOfAPInneded*
Note : Woocommerce is a plugin for wordpress - and the API is inside this plugin. (even if the latest API uses wordpress' API itself)
Update : Unlike usual, here we need to use the API from the wordpress instance perspective - we would like to extend some of woocomerce methods located in the API. We therefore do not want to consume the API, but to provide an extended one.