laravel-shopify
laravel-shopify copied to clipboard
How to use CRON to update products
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
Your eloquent query looks like it is missing the operator.
Try User::where('name', '=', $record->shopname)->first();