Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / modified "recent purchases" code

modified "recent purchases" code

Locked

Views: 1,050

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
3 Aug 2006, 7:55 PM
#1
denliv avatar

denliv

Zen Follower

Join Date:
Jul 2004
Posts:
103
Plugin Contributions:
0

modified "recent purchases" code

In my install of 1.3.0.2 I modified the code that creates the recent purchases sidebox - the stock version places the cart icon at the end of the product name. In multi-line product names that made things look pretty uneven. My modification removes the unordered list (which also didn't display right in FireFox, at least in the template I use - Future_zen) and places the cart icon in front of the product name, which also puts a bit of space between the items listed (without resorting to css padding).

See attached file for it in action (rp.jpg).

Dennis

3 Aug 2006, 8:01 PM
#2
denliv avatar

denliv

Zen Follower

Join Date:
Jul 2004
Posts:
103
Plugin Contributions:
0

Re: modified "recent purchases" code

I tried to attach the php file as well, but it didn't "take". Here is the entire file in text form - goes in includes/templates/YOUR-TEMPLATE/sideboxes/tpl_order_history.php

<?php /** * Side Box Template * * @package templateSystem * @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: tpl_order_history.php 3324 2006-03-31 06:02:07Z drbyte $ */ $content = ""; $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n"; $content .= '' . "\n" ; for ($i=1; $i<=sizeof($customer_orders); $i++) { $content .= '<a href="' . zen_href_link(basename($PHP_SELF), zen_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $customer_orders[$i]['id']) . '">' . zen_image($template->get_template_dir('cart.gif', DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . 'cart.gif', 'Add this item to cart') . '</a>  <a href="' . zen_href_link(zen_get_info_page($customer_orders[$i]['id']), 'products_id=' . $customer_orders[$i]['id']) . '">' . $customer_orders[$i]['name'] . '</a><br />' . "\n" ; } $content .= '' . "\n" ; $content .= '</div>'; ?>