Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Replacing text with images in the shoppingcart


SjoerdNL

Recommended Posts

At the moment I'm trying to replace the text in the shoppingcart with some images.

 

The code beneath is changed by me, using the code from an earlier version of the shoppingcart enhancement. But at the moment it's only displaying text, using the array it is written for. What is the correct syntax needed to replace the text(variables) with images. The names I used from the images are checkout.png and viewcart.png, the directory is /images/.

 

Beside this coding issue I've got another question. Is it true that there will be no security related issues when you use images in your shoppingcart, if the images themself are in the /images/ directory (keeping the SSL connection in mind).

 

  $info_box_contents = array();
 $info_box_contents[] = array('text' => $cart_contents_string);

 if ($cart->count_contents() > 0) {
$info_box_contents[] = array('text' => tep_draw_separator());
$info_box_contents[] = array('align' => 'right',
							 'text' => $currencies->format($cart->show_total()));
 }

// shoppingcart enhancement
 if ($cart->count_contents() > 0) {
if (preg_match("/checkout/", $PHP_SELF)) {
$info_box_contents[] = array('align' => 'left','text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><u>View Basket</u></a>');
} else {
$info_box_contents[] = array('align' => 'left','text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><u>View Basket</u></a><br><<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('checkout.png', IMAGE_CHECKOUT) . '</a>');
}
}
// shoppingcart enhancement

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...