Forums / Basic Configuration / Add Picture of the Product to Checkout Page?

Add Picture of the Product to Checkout Page?

Locked

Views: 3,519

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
6 Apr 2009, 1:04 PM
#1
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Add Picture of the Product to Checkout Page?

I wonder, does anyone know how to add a picture of the product to this page:

20 Apr 2009, 3:36 PM
#2
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

OK, back to this old chestnut.... Anyone ??

I can see that the tpl_checkout_split.php file is calling the title of the items in cart using this:

<?php echo $order->products[$i]['name']; ?>

What would I replace "name" with in order to call the CartImage ??

20 Apr 2009, 11:54 PM
#3
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

I believe you are using a checkout mod... so I do not have the files...

the following line may work...

<?php echo zen_get_products_image($order->products[$i]['id']); ?>

Steve

21 Apr 2009, 8:08 AM
#4
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

Hi Steve,

Thanks for responding. As usual, you've hit the nail on the head. I'm really getting there with this......... I used:

<?php echo zen_get_products_image($order->products[$i]['id'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT); ?>

Which places the small cart image but now I can't figure how to style it..... Where I placed the above code just puts the image right at the end of the product name text and the image aligns to the bottom of the row instead of centred on the row.

How would I make the cart image float right on the row so that it hops over next to the price? Then, how would I make it centre in the row instead of aligning to the bottom?

So, from this:

To this:

Here's the entire section of the file with your code at the very end:

				<?php // now loop thru all products to display quantity and price ?>
				<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
				        <tr class="<?php echo $order->products[$i]['rowClass']; ?>">
				          <td  class="cartQuantity"><?php echo $order->products[$i]['qty']; ?> x</td>
				          <td class="cartProductDisplay" align="center"><?php echo $order->products[$i]['name']; ?>
				          <?php  echo $stock_check[$i]; ?><?php echo zen_get_products_image($order->products[$i]['id'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT); ?>

Just not sure how to add positioning?

21 Apr 2009, 8:27 AM
#5
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

You could wrap the image in a span... then style that in the stylesheet.css

<?php echo '<span class="checkoutImage">' . zen_get_products_image($order->products[$i]['id'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) . '</span>'; ?>

You may have to change the width of the table cells...

Another solution would be to change the code and put the image in a table cell TD of its own. I would need to see more of the code to change that... Which mod are you using?

Steve

21 Apr 2009, 8:28 AM
#6
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

I was getting somewhere using this:

				<?php // now loop thru all products to display quantity and price ?>
				<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
				        <tr class="<?php echo $order->products[$i]['rowClass']; ?>">
				          <td  class="cartQuantity"><?php echo $order->products[$i]['qty']; ?> x</td>
				          <td class="cartProductDisplay" align="center"><?php echo $order->products[$i]['name']; ?><?php  echo $stock_check[$i]; ?>
						  <td class="cartProductDisplay" align="right"><?php echo zen_get_products_image($order->products[$i]['id'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT); ?>

.....but it also pushes the product size attributes over to the right... so I guess I'm on the right tracks but just not puting the code in the right place?

It wouldn't let me post the full file as it's a biggy, but you can download the full file here:

http://www.limelites.co.uk/temp/tpl_checkout_split.rar

21 Apr 2009, 8:41 AM
#7
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

If you insert a table cell there, you will have to insert a column header serveral lines above... look for the TH tag...

Steve

21 Apr 2009, 8:56 AM
#8
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

No, you're right, your way is far better:

<?php echo '<span class="checkoutImage">' . zen_get_products_image($order->products[$i]['id'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) . '</span>'; ?>

I've added the class to my stylesheet now:

.checkoutImage {
float:right;
}

Might just have to add a position: relative; to bring it to top of the row?

21 Apr 2009, 9:06 AM
#9
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

Strike my last entry, had the code in the wrong line, I got it working a treat like this:

				<?php // now loop thru all products to display quantity and price ?>
				<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
				        <tr class="<?php echo $order->products[$i]['rowClass']; ?>">
				          <td  class="cartQuantity"><?php echo $order->products[$i]['qty']; ?> x</td>
				          <td class="cartProductDisplay" align="center"><?php  echo $stock_check[$i]; ?><?php echo '<span class="checkoutImage">' . zen_get_products_image($order->products[$i]['id'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) . '</span>'; ?><?php echo $order->products[$i]['name']; ?>

Perfecto!!

Thank you Steve.. you're a star:thumbsup:

Now, onto my next little project to see if I can figure out how to integrate the FEC mod with the COWOA mod :cry:

21 Apr 2009, 9:19 AM
#10
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

another little challenge sorted! You have some great ideas... keep it up.

Steve

21 Apr 2009, 9:32 AM
#11
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

Thanks :-) I'll do that :-)

Just took a look at the COWOA install files and I think I'd be biting off more than I could chew trying to ingtegrate that with my FEC single page checkout....

Been getting a lot of bailed carts at the login page though, so just wondering if that's because people generally can't be bothered creating an account......

If I can't have both then what do you think's better... FEC single page checkout or COWOA checkout without an account?

22 Apr 2009, 8:34 AM
#12
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

FEC or COWOA???

may be others on the forum will have statistics to help you with your choice.

Steve

22 Apr 2009, 8:47 AM
#13
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Add Picture of the Product to Checkout Page?

Well, as it happens, I found a way to integrate the two mods after all. It took me hours but it's basically a case of merging all the files.

Since I also have Google Checkout in these files, it took a while to merge all the code but it can be done.

As for which of the two is the best for stopping bailed carts.... Now that I have both and I've had opportunity to assess for myself, I'd say probably FEC has more plus points.