Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Unknown error WooCommerce API Integration

Discussion in 'General Discussion' started by alexpaul, Dec 21, 2018.

  1. alexpaul

    alexpaul Registered

    Joined:
    Jul 24, 2018
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United states
    cPanel Access Level:
    Website Owner
    I want to create a custom dashboard using API in WooCommerce. I am not much aware of PHP. I am doing it myself following the reference article WooCommerce API Integration
    cloudways.com/blog/custom-dashboard-using-woocommerce-php-rest-api/


    I am getting an unknown error in the index.php file.


    $query = ['date_min' => '2018-11-01', 'date_max' => '2018-11-30'];

    $sales = $woocommerce->get('reports/sales', $query);

    $sale = $sales[0]["total_sales"];

    }
     
    #1 alexpaul, Dec 21, 2018
    Last edited by a moderator: Dec 21, 2018
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,728
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hello @alexplaul


    What exactly is the error you're getting? I should point out that this may be best addressed with woo commerce directly: Contact Us - WooCommerce

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice