laravel-shopify icon indicating copy to clipboard operation
laravel-shopify copied to clipboard

How to use CRON to update products

Open srimanutd opened this issue 2 years ago • 0 comments

I Just loaded the shop from the DB. Then initialize the shop API as given on #609

$shop = User::where('name', $record->shopname)->first(); $result=$shop->api()->rest('PUT','/admin/api/2022-04/products/'.$record->shopifyproductid.'.json', ['product'=>['status'=>$record->unprod_status]]);

But I get the following error: Column not found: 1054 Unknown column '6' in 'field list' (SQL: select 6 from users where shopify_namespace is null and users.deleted_at is null limit 1) {"exception":"[object] (Illuminate\Database\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column '6' in 'field list' (SQL: select 6 from users where shopify_namespace is null and users.deleted_at is null limit 1)

Do I need to add any other thing for accessing the Shop API using Cron

srimanutd avatar May 25 '22 12:05 srimanutd

Your eloquent query looks like it is missing the operator.

Try User::where('name', '=', $record->shopname)->first();

Kyon147 avatar Aug 26 '22 08:08 Kyon147