Thanks for this tutorial @Teodor!
I am getting an error unfortunately on the db query part:
Undefined binding(s) detected when compiling SELECT. Undefined column(s): [products.id] query: select “id”, “product_name” as “title”, “product_sales_price” as “amount” from “products” where “products”.“id” in (?, ?, ?)
Here’s my query:
The ‘id’ used in flatten is correct, that’s the variable name of the data store’s product id field.
By the way, I got all these values stored in the data store too:
title
(mandatory) - The name of the product
amount
(mandatory) - The price of the product
currency
(optional) - The currency. If not provided it defaults tousd
quantity
(optional) - The quantity that should be added to the cart. If not provided, it defaults to1
Can’t I just add those variables to the $_POST_LineItems array and send these values to the SC API directly instead of querying the products db table?
Thanks for your help in advance!