Reporting Bugs in Documentation

Highlighted
Shopify Partner
30 0 3

The documentation here says there is support for orders_count

https://help.shopify.com/api/tutorials/shopify-scripts#customer

It is clearly exampled that the Customer method follows this structure:

customer = Input.cart.customer

So orders_count should be as follows:

customer = Input.cart.customer
puts customer.orders_count

However the puts returns Error and the code is invalid.

Now either there is a undocumentated limitation to using orders_count and it needs to be officially stated on that documentation page. And/or there is a problem with the Script Editor Console output and that needs to be officially stated.

Either way, the poor status of Shopify documentation still needs addressing, as so much time is wasted by developers using resources that are otherwise unknowingly-inaccurate to be used as examples.

0 Likes
Highlighted
Shopify Partner
30 0 3

My findings show the error handling is different in the Script Editor Console than it is elsewhere in Theme Editor. If something doesn't exist (in this case a customer doesn't exist), Script Editor console returns error but Theme Editor carries on silently. I guess we just have to get used to the fact the two tools are inconsistant in how they handle errors etc.

0 Likes