slince / shopify-api-php

:rocket: Shopify API Client for PHP
MIT License
128 stars 47 forks source link

Error when deleting product #62

Closed JvdL2711 closed 4 years ago

JvdL2711 commented 4 years ago

When trying to remove a product from my connected Shopify Store:

`public static function deleteShopifyProduct($productId) { $client = self::initializeClient();

    $externalProductId = ProductUser::where([
        'product_id' => $productId,
    ])->pluck('external_product_id')->first();

    $client->getProductManager()->remove($externalProductId);
}`

I receive the following error:

Call to undefined method Illuminate\Http\RedirectResponse::getProductManager()

I checked the value of$externalProductId and it matches my product ID on Shopify.

All other methods (add, edit, get, etc.) work just fine work every manager, but I can't seem to make this work. I initialize the client like I always do.

Do I miss anything here?

JvdL2711 commented 4 years ago

I already figured it out! I used a different return statement for errors in the client, which wasn't allowed there.

My bad!