I've never had success using Craft 3 with Commerce 2 beta. I always get an error that ".find()" is not recognized, and ".all()" doesn't work either.

My latest attempt has given me this error:

Twig Runtime Error – Twig_Error_Runtime Calling unknown method: craft\commerce\services\Products::type()

The line in question is this one:

{% set silentItems = craft.commerce.products.type('silentAuctionItems').find() %}

If I delete

.type('silentAuctionItems').find()

the error doesn't come up, but I don't get any products displaying.

I've searched through the Commerce documentation, and I can't find anything about this problem.

Thanks for any help you can provide!

  • My mistake: I actually have Commerce 2 beta running on this installation. I installed Commerce through the Craft 3 plugin store. And it's still giving me the template errors. – Jonathan Weedin Aug 6 at 18:53
up vote 1 down vote accepted
craft.product.type(x).all()

Will do it, without commerce

I figured out the problem. It should be

{% set silentItems = craft.products.type('silentAuctionItems').all() %}

You don't put .commerce between craft and .products.

Thanks!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.