Codexshaper / laravel-woocommerce

WooCommerce Rest API for Laravel
MIT License
198 stars 57 forks source link

i keep getting cURL Error: #44

Closed badreddine5 closed 4 years ago

badreddine5 commented 4 years ago

i followed the instructions from your docs and i tried to test it:

part of my code: use Codexshaper\WooCommerce\Facades\Product;

class InventoryController extends Controller { // public function list(){ $products = Product::all();

    return view('inventory')->with('products', $products);
} 

}

and when i run my code i get : cURL Error:

Codexshaper\WooCommerce\WooCommerceApi::all C:\Users*****\vendor\codexshaper\laravel-woocommerce\src\Traits\WooCommerceTrait.php:23

maab16 commented 4 years ago

Hello @badreddine5

Thanks for the creating an issue. I checked with latest version with Laravel 8. Everything works fine for me. I think something wrong with woo-commerce or WordPress or Credentials.

  1. Use the latest version of the Laravel woocommerce package. Current version 2.8
  2. Update your woo-commerce plugin
  3. Update your WordPress if possible
  4. Check carefully is there any other Authentication plugin is installed in WP
  5. Finally check you carefully that use the correct site_url, consumer_key and consumer_secret in the .env file in your Laravel application

Here is the example

WOOCOMMERCE_STORE_URL=http://localhost/laravel-woocommerce
WOOCOMMERCE_CONSUMER_KEY=ck_935b89c270496c6fa42d0f7fe0468918e6107956
WOOCOMMERCE_CONSUMER_SECRET=cs_cc1a9bf4eb99bdc4d02adf6d0158b46357bc8f94

laravel-woocommerce-all-products

badreddine5 commented 4 years ago

i fixed it by using "php artisan config:cache" whenever i made a change into env file