Coder Social home page Coder Social logo

kusflo / prestashopwebservice Goto Github PK

View Code? Open in Web Editor NEW
27.0 5.0 15.0 80 KB

PHP wrapper for PrestaShop Web Services 1.7.x and 1.6.x

License: MIT License

PHP 100.00%
php prestashop webservices api erp easy web services prestashop-webservices wrapper

prestashopwebservice's Introduction

Actions Status Latest Stable Version Total Downloads License

PrestashopWebService Easy

PHP wrapper for PrestaShop Webservices 1.7.x and 1.6.x

Description

This wrapper allows you to download data from the prestashop store in a simple way. The data is transformed to an associative array.

Installation

composer require kusflo/prestashop-webservice

Example Usage

function listOrdersAll()
{
    try {
        $o = new PShopWsOrders(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $orders = $o->getList();
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function listOrdersLastDays($days)
{
    try {
        $o = new PShopWsOrders(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $orders = $o->getListLastDays($days);
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function listOrdersToday()
{
    try {
        $o = new PShopWsOrders(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $orders = $o->getListToday();
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function getOrderById($id)
{
    try {
        $o = new PShopWsOrders(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $order = $o->getById($id);
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function listProducts()
{
    try {
        $p = new PShopWsProducts(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $products = $p->getList();
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function getProductById($id)
{
    try {
        $p = new PShopWsProducts(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $product = $p->getById($id);
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function listCategories()
{
    try {
        $p = new PShopWsCategories(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $categories = $p->getList();
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function getCategoryById($id)
{
    try {
        $p = new PShopWsCategories(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $category = $p->getById($id);
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function listManufacturers()
{
    try {
        $p = new PShopWsManufacturers(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $manufacturers = $p->getList();
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function getManufacturerById($id)
{
    try {
        $p = new PShopWsManufacturers(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $manufacturer = $p->getById($id);
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function listCustomers()
{
    try {
        $c = new PShopWsCustomers(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $customers = $c->getList();
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function getCustomerById($id)
{
    try {
        $c = new PShopWsCustomers(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $customer = $c->getById($id);
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}
function listApiPermissionsToXml()
{
    try {
        $c = new PShopWsCustomers(_PS_SHOP_PATH, _PS_WS_AUTH_KEY);
        $permissions = $c->getApiPermissions();
        echo '<pre>';
        var_dump($permissions);
    } catch (PShopWsException $e) {
        echo $e->getMessage();
    }
}

prestashopwebservice's People

Contributors

gpier88 avatar kusflo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

prestashopwebservice's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.