简体   繁体   中英

How to get product id from the products in Shopify

Inside controller I am making a call to Shopify API inorder to get the products that is :

@products = ShopifyAPI::Product.find(:all, params: { limit: 10 })]

Here I got all the product list. Now I want to print the product id of a product .How to achieve this? Thank you.

@products.each { |p| p p.id }

您需要做的就是打印出每个产品ID。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM