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:

Views: 3,519
Totally Zenned
I wonder, does anyone know how to add a picture of the product to this page:

Totally Zenned
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 ??
Zen Follower
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
Totally Zenned
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?
Zen Follower
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
Totally Zenned
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:
Zen Follower
If you insert a table cell there, you will have to insert a column header serveral lines above... look for the TH tag...
Steve
Totally Zenned
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?
Totally Zenned
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:
Zen Follower
another little challenge sorted! You have some great ideas... keep it up.
Steve
Totally Zenned
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?
Zen Follower
FEC or COWOA???
may be others on the forum will have statistics to help you with your choice.
Steve
Totally Zenned
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.
Tell staff why this post should be reviewed.