Wanted to share a variation of lat9's post regarding the shopping cart icons.. What follows is how I replaced the trash can and refresh icons in the shopping cart with Font Awesome glyphs.
Edit /includes/languages/english/YOUR_TEMPLATE/icon_names.php and editing the name of the ICON_UPDATE_ALT
Code:
<?php
/**
* @package languageDefines
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: icon_names.php 4224 2006-08-24 01:41:50Z drbyte $
*/
// define the icon images used in the project
define('ICON_IMAGE_ERROR', 'error.gif');
define('ICON_IMAGE_WARNING', 'warning.gif');
define('ICON_IMAGE_SUCCESS', 'success.gif');
define('ICON_IMAGE_TRASH', 'small_delete.gif');
define('ICON_IMAGE_UPDATE', 'button_update_cart.gif');
define('ICON_IMAGE_TINYCART', 'cart.gif');
//alt tags for buttons
define('ICON_ERROR_ALT', 'Error');
define('ICON_SUCCESS_ALT', 'Success');
define('ICON_WARNING_ALT', 'Warning');
define('ICON_TRASH_ALT', 'Delete this item from the cart by clicking this icon.');
define('ICON_UPDATE_ALT', '');
define('ICON_TINYCART_ALT', 'Add this product to your cart by clicking here.');
?>
Added the following to the stylesheet:
Code:
button.button_update_cart:hover {
background: none repeat scroll 0% 0% #CAC7C2;
border: 1px solid #CAC7C2;
}
button.button_update_cart {
background: none repeat scroll 0% 0% #0037B4;
border: 1px solid #0037B4;
padding:0;
display:block;
width:30px;
height:30px;
border-radius:15px;
font-size:15px;
line-height:30px;
cursor: pointer;
text-align:center;
text-decoration: none;
font-family: "FontAwesome";
}
Modify the color and font size to your liking.
Edit line 113 of includes/templates/YOUR_TEMPLTAE/templates/tpl_shopping_cart_default.php as follows
Code:
<a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, 'action=remove_product&product_id=' . $product['id']); ?>"><i class="fa fa-trash"></i></a>
Added the following to the stylesheet:
Code:
.cartRemoveItemDisplay .fa-trash {color:#0037B4;font-size:2rem;}
Modify the color and font size to your liking.
Originally Posted by
lat9
The Delete button is always shown as an icon. You can change the image used by copying /includes/languages/english/icon_names.php to /includes/languages/english/new1.5/icon_names.php and editing the name of the ICON_IMAGE_TRASH (make sure to copy the new icon to /includes/templates/new1.5/buttons/icons).
For the Update button, you'll copy/edit the same file to reduce the length of ICON_UPDATE_ALT; the default behavior is to use the button images of the alt-text is longer than 40 characters.
Code:
<?php
/**
* @package languageDefines
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: icon_names.php 4224 2006-08-24 01:41:50Z drbyte $
*/
// define the icon images used in the project
define('ICON_IMAGE_ERROR', 'error.gif');
define('ICON_IMAGE_WARNING', 'warning.gif');
define('ICON_IMAGE_SUCCESS', 'success.gif');
define('ICON_IMAGE_TRASH', 'small_delete.gif');
define('ICON_IMAGE_UPDATE', 'button_update_cart.gif');
define('ICON_IMAGE_TINYCART', 'cart.gif');
//alt tags for buttons
define('ICON_ERROR_ALT', 'Error');
define('ICON_SUCCESS_ALT', 'Success');
define('ICON_WARNING_ALT', 'Warning');
define('ICON_TRASH_ALT', 'Delete this item from the cart by clicking this icon.');
define('ICON_UPDATE_ALT', 'Update');
define('ICON_TINYCART_ALT', 'Add this product to your cart by clicking here.');
?>
Bookmarks