1

Hi it may be a naive question because I am working with woocommerce rest api for the first time I am good with wordpress though.

I have a client's site which multilingual (2 languages) using WPML folder base i.e "base url for english" & "/ar for other language" and everything is perfect on the browser also I am using multilingual woocommerce for this purpose now clients need an app and for that i am using woocommerce rest api and i am using this lib WooCommerce REST API PHP Client Library which is working perfectly for the base folder but if I pass an lang variable in $_GET it always shows following error:


    {
      "errors": [
        {
          "code": "woocommerce_api_authentication_error",
          "message": "Invalid Signature - provided signature does not match"
        }
      ]
    }

I am passing variables like


    http:// example.com/?mode=api&action=categories&lang=ar

and in library I am setting lang variable like this


    if(isset($_REQUEST['lang'])){
        $lang=$_REQUEST['lang'];
    }
     $client = new WC_API_Client('http://example.com/'.$lang, 'ck________________', 'cs_______________', $options);

Its working perfectly on the localhost but on server (client have unmanaged vps which I install vesta cp on it) its only working if there is no $lang variable defined no its just showing me one language's product.

I tried all the method find on the different forums but still didn't get it work can please some one help me to understand what I am doing wrong. Also i really need this without HTTPS.

Is there any way around or could suggest me better way to do it basically i want to make rest api for mobile app so what ever the best way i would really appreciate it.

0 Answers0