quick ??? Shopping Cart Image

12 posts by 4 authors in: Forums > CMS Builder
Last Post: May 20, 2010   (RSS)

Re: [thenetgirl] quick ??? Shopping Cart Image

By Damon - May 19, 2010

Hi,

Try this for the getting the thumbnail URL:

<?php echo $upload['thumbUrlPath'] ?>
Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [thenetgirl] quick ??? Shopping Cart Image

By gkornbluth - May 19, 2010

Hi thenetgirl,

I know this may sound simplistic, but is it possible to use a foreach loop like this to display the thumbnail image somehow?

<?PHP foreach ($your_tableRecords as $record): ?>
<?php foreach ($record['uploads'] as $upload): ?>
<img src="<?php echo $upload['thumbUrlPath2'] ?>" width="<?php echo $upload['thumbWidth2'] ?>" height="<?php echo $upload['thumbHeight2'] ?>" alt="" />
<?php endforeach ?><?php endforeach ?>


If not, could you be a bit more specific or attach the code you're using outside of the one line you posted?

Thanks,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] quick ??? Shopping Cart Image

By thenetgirl - May 19, 2010

here is the complete form and the page link is
http://npcclothing.com/adultshirtDetail.php?First-Shirt-1

and this doesnt work when you click add to cart
<INPUT TYPE=HIDDEN NAME=img VALUE="<?php echo $upload['thumbUrlPath'] ?>"/>




<FORM METHOD=POST ACTION="http://ssl.securesites.com/cart.pl">
<INPUT TYPE=HIDDEN NAME=merchant VALUE="exedor2">
<br>


Quantity<font color="#821789">: </font>
<INPUT TYPE=TEXT NAME=quantity VALUE="1" SIZE=2 MAXLENGTH=2>
<INPUT TYPE=HIDDEN NAME=name VALUE="<?php echo $adult_shirtsRecord['product_id_sku'] ?>"/>
<INPUT TYPE=HIDDEN NAME=price VALUE="<?php echo $adult_shirtsRecord['price'] ?>"/>
<INPUT TYPE=HIDDEN NAME=sh VALUE="1">
<INPUT TYPE=HIDDEN NAME=img VALUE="<?php echo $upload['thumbUrlPath'] ?>"/>
<INPUT TYPE=HIDDEN NAME=img2 VALUE="<?php echo $upload['filename'] ?>"/>
<INPUT TYPE=HIDDEN NAME=return VALUE="http://www.npcclothing.com/index.php">
<INPUT TYPE=HIDDEN NAME=custom1 VALUE="<?php echo $adult_shirtsRecord['name'] ?>"/>
<p>Size:
<SELECT NAME=custom2 SIZE=1>
<OPTION>Small $20.00
<OPTION>Medium $20.00
<OPTION>Large $20.00
<OPTION>XLarge $25.00
<OPTION>2XLarge $25.00
<OPTION>3XLarge $25.00
</SELECT></p>
<p>&nbsp;</p>
<p>


<INPUT TYPE=submit NAME="add" VALUE="Add To Cart"></p>
</FORM>
Patricia

www.thenetgirl.com

Re: [thenetgirl] quick ??? Shopping Cart Image

By Jason - May 20, 2010

Hi,

On your form you have two hidden fields that use the name of the image, img and img2. img has the actual path (cmsAdmin/uploads/thumb/), where img2 just uses the name.

On your shopping cart page (cart.pl), which variable is being used to display the picture?

Let me know.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] quick ??? Shopping Cart Image

By thenetgirl - May 20, 2010

Both one is for the thumb the other for the enlarged photo
Patricia

www.thenetgirl.com

Re: [thenetgirl] quick ??? Shopping Cart Image

By Jason - May 20, 2010

Hi,

If you view the source, you'll see that the path in the <a> tag is correct, but the path in the <img> tag is this:
cmsAdmin/uploads//cmsAdmin/uploads/thumb

You'll need to change this so that the only path being outputted is the path from the hidden img variable.

Give that a try.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] quick ??? Shopping Cart Image

By thenetgirl - May 20, 2010

I dont understand the large picture shows correctly............. so what am i changing?
Patricia

www.thenetgirl.com

Re: [thenetgirl] quick ??? Shopping Cart Image

By Jason - May 20, 2010

Hi,

What's happening is probably something like this:
your <a> probably looks like this:
<a href="*IMG VARIABLE" >
Which does work correctly.

The <img> tag however, probably looks like this:
<img src="cmsAdmin/uploads/*IMG VARIABLE*" />
What it needs to look like is this:
<img src="*IMG VARIABLE*" />

This is the correct path to the picture. You can set the height and width to whatever you like.

Hope this helps. If you're still having trouble, attach a copy of you cart script and I'll take a look.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] quick ??? Shopping Cart Image

By thenetgirl - May 20, 2010

ok this is really funny I changed the path in my cart now the little image works but not the big one

<INPUT TYPE=HIDDEN NAME=img VALUE="<?php echo $upload['thumbUrlPath'] ?>"/>
<INPUT TYPE=HIDDEN NAME=img2 VALUE="<?php echo $upload['filename'] ?>"/>

I suppose i can live with that. Only having one image in the cart & i'd rather it be the little one any way
Patricia

www.thenetgirl.com