Hello! My name is David and I’ve been working on a website that creates custom products.
I’ve been able to create a product using the createProduct() method, but can’t seem to call the product ID to add it to cart.
The errors I got is in the screenshot below.
I’ve been trying to set the id within the createProduct() declaration, but it doesn’t seem to link when I try to add it.
Is there a way to set a product’s ID within createProduct()?
If not, is there a way to get the product ID using the name of the product?
Any help would be greatly appreciated!