cartjs icon indicating copy to clipboard operation
cartjs copied to clipboard

Add some improved documentation around cart page possibilities

Open gavinballard opened this issue 9 years ago • 8 comments

For example, using rv-href to link to products and the productImageSize filter.

gavinballard avatar May 28 '15 13:05 gavinballard

Hi :),

I've tried to use the productImageSize filter, but it always return me the biggest image:

<img rv-src="item.image | productImageSize small">

What am I doing wrong?

bakura10 avatar Jun 27 '15 20:06 bakura10

This is why it needs more documentation :).

The productImageSize filter relies on Shopify's Shopify.Image.getSizedImageUrl method being available, although I believe that should be available on any page with option_selectors.js included. But anyway, first step would be to double check that method's available by entering that in your console.

Another thing that might be causing a problem here is that reading the upgrade notes for Rivets.js from 0.6.0 (the bundled version prior to v0.3.0 of Cart.js) to 0.8.0, they note that arguments to formatters should now be wrapped in quotes if they're meant to be strings, as in the case of the small argument here. So I'd try changing your example to:

<img rv-src="item.image | productImageSize 'small'">

and seeing if that helps.

gavinballard avatar Jun 28 '15 10:06 gavinballard

Bingo ! Adding the quotes worked! Thanks a lot !

Envoyé de mon iPhone

Le 28 juin 2015 à 12:11, Gavin Ballard [email protected] a écrit :

This is why it needs more documentation :).

The productImageSize filter relies on Shopify's Shopify.Image.getSizedImageUrl method being available, although I believe that should be available on any page with option_selectors.js included. But anyway, first step would be to double check that method's available by entering that in your console.

Another thing that might be causing a problem here is that reading the upgrade notes for Rivets.js from 0.6.0 (the bundled version prior to v0.3.0 of Cart.js) to 0.8.0, they note that arguments to formatters should now be wrapped in quotes if they're meant to be strings, as in the case of the small argument here. So I'd try changing your example to:

and seeing if that helps.

— Reply to this email directly or view it on GitHub.

bakura10 avatar Jun 28 '15 11:06 bakura10

@gavinballard Would you like me to factor this issue into work on #55?

michaelrshannon avatar Nov 24 '15 12:11 michaelrshannon

@michaelrshannon That would be awesome, thank you!

I'd also like to bring product images into the advanced cart example on the Cart.js homepage.

gavinballard avatar Nov 24 '15 12:11 gavinballard

Np - I can do that at the same time.

michaelrshannon avatar Nov 24 '15 12:11 michaelrshannon

I love the plugin but I'm stuck on getting images to appear, tried the method above. Is new documentation still going to happen? Particularly around Rivets.

dungle-scrubs avatar Oct 25 '17 02:10 dungle-scrubs

@michaelrshannon? ;)

gavinballard avatar Oct 25 '17 05:10 gavinballard