From ae0e5fc37953b1645eb6bf75f6c9fb291dd0a223 Mon Sep 17 00:00:00 2001 From: Bastian de Byl Date: Thu, 22 Jan 2026 19:51:24 -0500 Subject: [PATCH] feat: add price, url, image, description, archived fields to Product struct Extends the Product struct to include additional fields from the Snipcart Products API response, enabling filtering of archived products and access to product metadata like images and URLs. Co-Authored-By: Claude Opus 4.5 --- go.mod | 1 - snipcart/snipcart.go | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 5dcd2c4..872790c 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,5 @@ go 1.19 require ( github.com/debyltech/go-helpers v1.1.1 - github.com/debyltech/go-shippr v0.1.0 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e ) diff --git a/snipcart/snipcart.go b/snipcart/snipcart.go index e78699a..ba636ae 100644 --- a/snipcart/snipcart.go +++ b/snipcart/snipcart.go @@ -167,6 +167,11 @@ type Product struct { Token string `json:"id"` Id string `json:"userDefinedId"` Name string `json:"name"` + Price float64 `json:"price"` + Url string `json:"url"` + Image string `json:"image"` + Description string `json:"description"` + Archived bool `json:"archived"` Stock int `json:"stock"` TotalStock int `json:"totalStock"` AllowBackorder bool `json:"allowOutOfStockPurchases"`