codeswholesale / codeswholesale-sdk-php

A PHP wrapper for CodesWholesale's API
Apache License 2.0
36 stars 21 forks source link

Retrieve specific product #33

Closed Sammyy96 closed 6 years ago

Sammyy96 commented 6 years ago

Hi, I think it would be good if you made a function in Client.php for retrieving specific products as your current documentation says you can get specific products instead of all products. A suggestion, something like this_

 public function getProduct($producctID, array $options = [])
    {
        return $this->dataStore->getResource(
            CodesWholesale::API_VERSION_V2 . '/products/'.$productID,
            CodesWholesale::PRODUCT,
            $options
            );
    }

I also would like to say that your current documentation for v2 is not very detailed and fails to point out some things, so those who would like to make their own environment for connecting to your platform instead of using your sdk will have a very hard time doing so.

codeswholesale commented 6 years ago

Hey there,

You can simply get Product by using below function:

$product = \CodesWholesale\Resource\Product::get($productId);

For more check examples directory, single-product.php.