[checkout] add random photo to cart?

lucasmarin
lucasmarin's picture

Joined: 2010-07-14
Posts: 37
Posted: Sat, 2010-07-17 13:33

Hello guys. I, with a lot of help, was able to add a random photo (from imageBlock) on my main page. What i want to do now, if possible, is to add it straight away to the checkout module. Is it possible? Like the "product price info" link on the photo pages, that add the picture to checkout. I tried copying the code from those pages, but it makes no sense, because that link has the parameters of the picture in the photo page, not of the random image in the main page.
Any ideas?

http://www.lucasmarin.com

 
lucasmarin
lucasmarin's picture

Joined: 2010-07-14
Posts: 37
Posted: Sun, 2010-07-18 10:47

Well, i´ve been doing a lot of research, but i can´t find the right thing to do.
So far, i have this lines:

{g->block type="imageblock.ImageBlock" blocks="randomImage" itemId=587 maxSize="500" showDate=0 showOwner=0 showViews=0 showTitle=0 showHeading=0 useDefaults=0}

<a href="{g->url arg1="controller=checkout.AddToCart" arg2="itemId=XXXXXXXXX" arg3="return=1"}" rel="nofollow">{g->text text="COMPRAR"}</a>

But there is something wrong there, because i don´t know what to put in arg2. There has to be some way to pass the value of the random image, right?

Any ideas?
Thanks!

http://www.lucasmarin.com

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2010-07-18 15:33

So as I browse your site, I end up with some totally random image sitting in my checkout cart ... or if I decide to buy a couple of your images, when I get to checkout, you would have slipped in an extra totally random one for me to pay for.

Please kindly explain why you would want to do such a thing to your unwitting visitors.

--
dakanji.com

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2010-07-18 16:45

I think he wants people to be able to buy the (same) random image as they see on the screen, with one click - not a different random image. So the itemId in the checkout link has to match the id of the image shown on the same page. I don't know if the imageBlock makes the imageId available as a smarty variable, and if it does what that variable is.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sun, 2010-07-18 17:03

Ha! I see.

Had me scratching my head.

--
dakanji.com

 
lucasmarin
lucasmarin's picture

Joined: 2010-07-14
Posts: 37
Posted: Sun, 2010-07-18 22:07

Hey guys. Thanks for the replies. It is exactly what alecmyers said. Sorry if i didn´t explain it properly.
Does anyone know?
Any ideas where to look for clues? I´ve been trying a lot, and researched a lot, without success. So any help would be appreciated.
Thanks!

http://www.lucasmarin.com

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2010-07-18 22:23

look in the template for the random image block for the variable used for the random image id. You can also get a complete page of all Smarty variables by turning on debug mode.

 
lucasmarin
lucasmarin's picture

Joined: 2010-07-14
Posts: 37
Posted: Sun, 2010-07-18 22:31

Hey Alec. I´ve been trying all that, and i´m still not sure where to look. I´m a little lost. I´ll keep looking though.
If you can think of anything, please let me know.
Thanks again!

http://www.lucasmarin.com