Skip to content

Issue with DateTime on Import #105

@jackabox

Description

@jackabox

Description

Hey, I'm getting a bit of an issue when importing products. They were previously working, but as I'm running the import now they seem to be failing on the datetime stamp. An output of the dump from the console is included below.

Syncing Shopify products…

Exception 'yii\db\Exception' with message 'SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2024-04-08T23:09:43Z' for column 'createdAt' at row 1
The SQL being executed was: INSERT INTO `shopify_productdata` (`shopifyId`, `title`, `bodyHtml`, `createdAt`, `handle`, `images`, `options`, `productType`, `publishedAt`, `publishedScope`, `shopifyStatus`, `tags`, `templateSuffix`, `updatedAt`, `variants`, `vendor`, `metaFields`, `dateCreated`, `dateUpdated`, `uid`) VALUES ('7996473704598', 'Triple Love Oversized Sweatshirt', 'Triple Dotty oversized sweatshirt in a relaxed cosy fit in pink.', '2024-04-08T23:09:43Z', 'triple-love-oversized-sweatshirt', '[{\"id\":35849999876246,\"alt\":null,\"position\":1,\"product_id\":7996473704598,\"created_at\":\"2024-04-08T23:09:43Z\",\"updated_at\":\"2024-04-08T23:09:46Z\",\"admin_graphql_api_id\":\"gid:\\/\\/shopify\\/ProductImage\\/35849999876246\",\"width\":897,\"height\":1024,\"src\":\"https:\\/\\/cdn.shopify.com\\/s\\/files\\/1\\/0639\\/8695\\/8486\\/files\\/abba2b356d66d1ad6e0d5c6f3627d062.jpg?v=1712617786\",\"variant_ids\":[]}]', '[{\"id\":10157142376598,\"product_id\":7996473704598,\"name\":\"Size\",\"position\":1,\"values\":[\"S\\/M (8-10)\",\"L\\/XL (12-14)\"]}]', 'Jumpers', '2024-04-08T23:09:43Z', 'web', 'active', '', '', '2024-04-09T01:08:00Z', '[{\"id\":43369595535510,\"product_id\":7996473704598,\"title\":\"S\\/M (8-10)\",\"price\":\"32.00\",\"sku\":\"\",\"position\":1,\"inventory_policy\":\"deny\",\"compare_at_price\":null,\"fulfillment_service\":\"manual\",\"inventory_management\":\"shopify\",\"option1\":\"S\\/M (8-10)\",\"option2\":null,\"option3\":null,\"created_at\":\"2024-04-08T23:09:45Z\",\"updated_at\":\"2024-04-08T23:11:26Z\",\"taxable\":true,\"barcode\":\"\",\"grams\":0,\"weight\":0,\"weight_unit\":\"lb\",\"inventory_item_id\":45467270971542,\"inventory_quantity\":0,\"old_inventory_quantity\":0,\"requires_shipping\":true,\"admin_graphql_api_id\":\"gid:\\/\\/shopify\\/ProductVariant\\/43369595535510\",\"image_id\":null},{\"id\":43369595568278,\"product_id\":7996473704598,\"title\":\"L\\/XL (12-14)\",\"price\":\"32.00\",\"sku\":\"\",\"position\":2,\"inventory_policy\":\"deny\",\"compare_at_price\":null,\"fulfillment_service\":\"manual\",\"inventory_management\":\"shopify\",\"option1\":\"L\\/XL (12-14)\",\"option2\":null,\"option3\":null,\"created_at\":\"2024-04-08T23:09:45Z\",\"updated_at\":\"2024-04-08T23:11:26Z\",\"taxable\":true,\"barcode\":\"\",\"grams\":0,\"weight\":0,\"weight_unit\":\"lb\",\"inventory_item_id\":45467271004310,\"inventory_quantity\":10,\"old_inventory_quantity\":10,\"requires_shipping\":true,\"admin_graphql_api_id\":\"gid:\\/\\/shopify\\/ProductVariant\\/43369595568278\",\"image_id\":null}]', 'Dotty', '[]', '2024-04-09 15:03:49', '2024-04-09 15:03:49', '6b3a8d2a-6379-47d3-9ea4-0ba35f09a31e')'

Steps to reproduce

  1. Set up craft cms + shopify plugin
  2. Run php craft shopify/sync/products in console.

Additional info

  • Craft version: 5.0.2
  • PHP version: 8.3.3
  • Database driver & version: MySQL 8.3.0
  • Plugins & versions: Shopify 5.0.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions