Jump to content
npn2531

OSC to CSS v2

Recommended Posts

If you have to change anything to get this to validate to higher standards, post the change, I like to see it if can't be incorporated.

 

Tables in manufacturers_info.php : I have left tables in where the shop presents data. A list of manufacturers with varying widths of names that wrap around in a short column in a chart with several columns, is one thing a table handles better than floating divs. The shopping cart is another example. You will see the CSS for styling these tables in the styles.css

 

Currencies: Good catch. The currencies box I have posted is lacking the form.

 

To fix it do two things:

 

In styles.css

change:

#header .infobox_heading{
margin:-10px 0px 0px 0px;
}

 

to this:

#header .infobox_heading{
margin:0px 0px 0px 0px;
font-weight: normal;
}

 

and in includes/boxes/currencies.php just paste the following over everything in the box beneath the comments. This is the entire and correct code for the currencies box:

 

 if (isset($currencies) && is_object($currencies)) {
?>
<!-- currencies -->

<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_CURRENCIES);

   new cssinfoBoxHeading($info_box_contents, false, false);

   reset($currencies->currencies);
   $currencies_array = array();
   while (list($key, $value) = each($currencies->currencies)) {
     $currencies_array[] = array('id' => $key, 'text' => $value['title']);
   }

   $hidden_get_variables = '';
   reset($HTTP_GET_VARS);
   while (list($key, $value) = each($HTTP_GET_VARS)) {
     if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
       $hidden_get_variables .= tep_draw_hidden_field($key, $value);
     }
   }

   $info_box_contents = array();
   $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),

                                'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 80%"') . $hidden_get_variables . tep_hide_session_id());

   new cssinfoBox($info_box_contents);

 }
?>



Edited by npn2531

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Share this post


Link to post
Share on other sites

I have got it down to 11 errors for XHTML Strict.

 

Some easy changes

 

1.)Replace all occurrences of <br> and <br/> with <br />

 

2.)In all catalog files add the space and slash i.e.

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> BECOMES

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />

and

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> BECOMES

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />

 

In catalog/includes/functions/html_output.php find

function tep_image and replace

$image .= '>'; with

$image .= ' />';

AND

$image = '<img src="' . tep_output_string($src) . '" class="'. tep_output_string($class) .'" border="0" alt="' . tep_output_string($alt) . '"';

REPLACE with

$image = '<img src="' . tep_output_string($src) . '" class="border_0" alt="' . tep_output_string($alt) . '"';

and add

.border_0{

border:0;

}

to the stylesheet

 

In catalog/includes/functions/html_output.php find

function tep_draw_input_field and replace

$field .= '>'; with

$field .= ' />';

 

In catalog/includes/functions/html_output.php find

function tep_draw_pull_down_menu and replace

$field .= 'selected'; with

$field .= 'selected="selected"';

 

Replace all occurences of the button functions in whichever files they appear with no capital letters i.e. onSubmit is one of them

 

I will post more as I find them

Share this post


Link to post
Share on other sites

I have found a couple of problems with cat-navbar.

 

1.) There is a missing end </li> but I am struggling to rectify it.

 

2.) There is a call to an undefined function tep_make_catsf_ulbranch on line 109, but looking at it the function is defined below it. Should the order be changed around?

Share this post


Link to post
Share on other sites

I have converted the best sellers box to a div with an ordered list

 

$bestsellers_list = '<div class="infobox"><div class="clear"></div><ol>';

while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {

$rows++;

 

$bestsellers_list .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></li>';

 

}

$bestsellers_list .= '</ol></div>';

 

$info_box_contents = array();

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

Edited by pdcelec

Share this post


Link to post
Share on other sites

XHTML Strict: using the higher standard will cut down on the IE discrepancies. Getting the border="0" out of the inline styling of the image is a good idea. It can be done for the entire shop in one place, includes/functions/html_output.php. About line 75 find the function, function tep_image, and down a few lines delete border="0" . In fact if you open up reset.css you can see that the border for 'img' (and everything else) is already set to '0' so deleting this should not affect anything at all. There is no need to add a new CSS selector border_0. The class for the image is a separate variable in that same function, and allows you to add a class directly in the image itself, and thus is quite useful.

Look at the top of nearly all the catalog pages for this:

<?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT,'','stock-image'); ?>

By adding 'stock-image' directly into the image, that image on that page acquires a class of 'stock-image'. In styles.css I have this selector:

.stock-image{
display:none;
}

That's why none of the cartoonish stock images are showing up. OSCommerce is really a well written cart.

Edited by npn2531

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Share this post


Link to post
Share on other sites

bestsellers list: Converting it to an ordered list from tables is a good idea, and it looks better on your site that it does on the demo. There is only one column in that table, so why not? However, note the information box is an unordered list. It would create visual consistency and cut down on the number of CSS selectors if those two boxes had identical classes and list types. (order_history, product_notifications and whats_new are other infoboxes that should match as well). Those are simple one or two column boxes similar to the bestsellers. I have converted a couple to divs, but now you have brought it up, I think they would be easier to work with if there was a consistent class, and an ordered or unordered list across this group. If you work on this and get them looking nice, post what you do.


Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Share this post


Link to post
Share on other sites

cat-navbar: Are you sure there is an error? I have checked the demo, it works fine and there is a closing </li> everyplace it should be. Looking at the source code of your site, both the superfish and the categories infobox look good, and have all there closing </li>'s

 

That cat-navbar is a direct adaptation from this contribution:

http://addons.oscommerce.com/info/4201

 

and everything matches up against the original as well.


Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Share this post


Link to post
Share on other sites

Here is the output from cat navbar from W3C Validator

It is saying that there should be a </li> on line 89 to close of <li> on line 82

 

 

66.<div class="cat_navbar">

67.<div class="cat_navbar_bg"><ul class="sf-menu"><li class="current_0"><a href="xxxxxxxxx/hardware-c-1.html" class="current">Hardware (6)</a>

68.<ul><li class="current_1"><a href="xxxxxxxxx/hardware-cdrom-drives-c-1_17.html">CDROM Drives</a></li>

69.<li class="current_1"><a href="xxxxxxxxx/hardware-graphics-cards-c-1_4.html">Graphics Cards (2)</a></li>

70.<li class="current_1"><a href="xxxxxxxxx/hardware-keyboards-c-1_8.html">Keyboards (1)</a></li>

71.<li class="current_1"><a href="xxxxxxxxx/hardware-memory-c-1_16.html">Memory</a></li>

72.<li class="current_1"><a href="xxxxxxxxx/hardware-mice-c-1_9.html">Mice (2)</a></li>

73.<li class="current_1"><a href="xxxxxxxxx/hardware-monitors-c-1_6.html">Monitors</a></li>

74.<li class="current_1"><a href="xxxxxxxxx/hardware-printers-c-1_5.html">Printers (1)</a></li>

75.<li class="current_1"><a href="xxxxxxxxx/hardware-speakers-c-1_7.html">Speakers</a></li>

76.</ul></li>

77.<li class="current_0"><a href="xxxxxxxxx/software-c-2.html" class="current">Software (4)</a>

78.<ul><li class="current_1"><a href="xxxxxxxxx/software-action-c-2_19.html">Action (1)</a></li>

79.<li class="current_1"><a href="xxxxxxxxx/software-simulation-c-2_18.html">Simulation (1)</a></li>

80.<li class="current_1"><a href="xxxxxxxxx/software-strategy-c-2_20.html">Strategy (2)</a></li>

81.</ul></li>

82.<li class="current_0"><a href="xxxxxxxxx/dvd-movies-c-3.html" class="current">DVD Movies (17)</a>

83.<ul><li class="current_1"><a href="xxxxxxxxx/dvd-movies-action-c-3_10.html">Action (9)</a></li>

84.<li class="current_1"><a href="xxxxxxxxx/dvd-movies-cartoons-c-3_13.html">Cartoons (1)</a></li>

85.<li class="current_1"><a href="xxxxxxxxx/dvd-movies-comedy-c-3_12.html">Comedy (2)</a></li>

86.<li class="current_1"><a href="xxxxxxxxx/dvd-movies-drama-c-3_15.html">Drama (3)</a></li>

87.<li class="current_1"><a href="xxxxxxxxx/dvd-movies-science-fiction-c-3_11.html">Science Fiction (1)</a></li>

88.<li class="current_1"><a href="xxxxxxxxx/dvd-movies-thriller-c-3_14.html">Thriller (1)</a></li>

89.</ul></ul></div>

90.</div>

Share this post


Link to post
Share on other sites

This should fix the validation of includes/modules/cat-navbar.php and also includes/boxes/ul_categories.php. (cat-navbar.php is the horizontal version of ul_categories so the fix is the same in both files.

 

in either file:

 

change:

// Close off nested lists
   for ($nest = 0; $nest <= $GLOBALS['this_level']; $nest++) {
      $output .= '</ul>';		
	}

 

to this:

// Close off nested lists
   for ($nest = 1; $nest <= $GLOBALS['this_level']; $nest++) {
      //closing tags for entire list
       $output .= '</ul></li></ul>';		
	}

Edited by npn2531

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Share this post


Link to post
Share on other sites

This should fix the validation of includes/modules/cat-navbar.php and also includes/boxes/ul_categories.php. (cat-navbar.php is the horizontal version of ul_categories so the fix is the same in both files.

 

in either file:

 

change:

// Close off nested lists
   for ($nest = 0; $nest <= $GLOBALS['this_level']; $nest++) {
      $output .= '</ul>';		
	}

 

to this:

// Close off nested lists
   for ($nest = 1; $nest <= $GLOBALS['this_level']; $nest++) {
      //closing tags for entire list
       $output .= '</ul></li></ul>';		
	}

 

 

Spot on, cat navbar now validates!!!. Just got 4 errors to go for XHTML transitional and 11 for strict. Tomorrow,I will start working on the other boxes

Share this post


Link to post
Share on other sites

Here is glaring one that we both missed!!!

 

Change

 

<link rel="stylesheet" href="css/reset.css" />

<link rel="stylesheet" href="css/960.css" />

<link rel="stylesheet" href="css/text.css" />

<link rel="stylesheet" href="css/styles.css" />

<link rel="stylesheet" href="css/css-buttons.css" />

<link rel="stylesheet" href="css/superfish.css" />

<link rel="stylesheet" href="css/json-addtocart-themes.css" />

<link rel="stylesheet" href="css/ui-tabs.css" />

<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" />

 

To

 

<link rel="stylesheet" href="css/reset.css" type="text/css" />

<link rel="stylesheet" href="css/960.css" type="text/css" />

<link rel="stylesheet" href="css/text.css" type="text/css" />

<link rel="stylesheet" href="css/styles.css" type="text/css" />

<link rel="stylesheet" href="css/css-buttons.css" type="text/css" />

<link rel="stylesheet" href="css/superfish.css" type="text/css" />

<link rel="stylesheet" href="css/json-addtocart-themes.css" type="text/css" />

<link rel="stylesheet" href="css/ui-tabs.css" type="text/css" />

<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" />

Share this post


Link to post
Share on other sites

Here is the matching information box

 

<!--start information -->

<?php

$info_box_contents = array();

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

 

new cssinfoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => '<div class="infobox"><div class="clear"></div><ol><li><a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a></li>' .

'<li><a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a></li>' .

'<li><a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a></li>' .

'<li><a href="' . tep_href_link('faqs.php') . '">' . 'Faqs' . '</a></li>' .

'<li><a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a></li></ol></div>');

 

new cssinfoBox($info_box_contents);

?>

Share this post


Link to post
Share on other sites

Here is the matching whats new box

 

<!--start whats_new -->

<?php

$random_product['products_name'] = tep_get_products_name($random_product['products_id']);

$random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);

$info_box_contents = array();

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

new cssinfoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW));

if (tep_not_null($random_product['specials_new_products_price'])) {

$whats_new_price = '<s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br />';

$whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';

} else {

$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));

}

$info_box_contents = array();

$info_box_contents[] = array('text' => '<div class="infobox-image"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div>

<div class="infobox"><div class="clear"></div><ol><li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br />' . $whats_new_price.'</li></ol></div>');

new cssinfoBox($info_box_contents);

}

?>

Share this post


Link to post
Share on other sites

here is the matching product_notifications

 

<!--start notifications infobox-->

 

<?php

 

$info_box_contents = array();

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

 

new cssinfoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'));

 

if (tep_session_is_registered('customer_id')) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$_GET['products_id'] . "' and customers_id = '" . (int)$customer_id . "'");

$check = tep_db_fetch_array($check_query);

 

$notification_exists = (($check['count'] > 0) ? true : false);

} else {

 

$notification_exists = false;

}

 

$info_box_contents = array();

if ($notification_exists == true) {

$info_box_contents[] = array('text' => '<div class="clear"></div><ol><li><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></div><div class="infobox"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($_GET['products_id'])) .'</a></li></ol></div>');

 

} else {

$info_box_contents[] = array('text' => '<div class="clear"></div><ol><li><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a><p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($_GET['products_id'])) .'</a></p></li></ol></div>');

}

 

new cssinfoBox($info_box_contents);

 

}

?>

Share this post


Link to post
Share on other sites

They look good. Put these selectors in styles.css and you can override the default settings for ordered lists that is in text.css, with styling unique for the infoboxes. I took a bit of the left margin out, but there's still a bit between the number and the text.

 

#column_left ol, #column_right ol { 
margin: 0.5em 0.5em 0.5em 1.5em; 
}

#column_left li, #column_right li{
padding:0.0em;
}


Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Share this post


Link to post
Share on other sites

I cannot seem to fathom out order history but this is what I have got so far. Those new css styles make a good difference. This has been my first attempt at styling and it has been a good learning curve

 

<?php

/*

$Id: order_history.php 1739 2007-12-20 00:52:16Z hpdl $

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License

*/

if (tep_session_is_registered('customer_id')) {

// retreive the last x products purchased

$orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);

if (tep_db_num_rows($orders_query)) {

?>

<!--start customer_orders -->

 

<?php

$info_box_contents = array();

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

new cssinfoBoxHeading($info_box_contents, false, false);

$product_ids = '';

while ($orders = tep_db_fetch_array($orders_query)) {

$product_ids .= (int)$orders['products_id'] . ',';

}

$product_ids = substr($product_ids, 0, -1);

// $customer_orders_string = '<table class="infobox">';

$products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");

while ($products = tep_db_fetch_array($products_query)) {

$customer_orders_string .= ' ' .

' <div class="infobox"><div class="clear"></div><ol><li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></ol>' .

' <div class="infobox-image"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif','infobox cart','','',ICON_CART,'infobox-cart') . '</a></div>' .

' ';

}

// $customer_orders_string .= '</table>';

$customer_orders_string .= '</div>';

$info_box_contents = array();

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

new cssinfoBox($info_box_contents);

}

}

?>

Share this post


Link to post
Share on other sites

see if this works:

 

// $customer_orders_string = '<table class="infobox">';
     $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");
     while ($products = tep_db_fetch_array($products_query)) {
       $customer_orders_string .= '  ' .
                                  '    <ol><li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a>' .
                                  '    <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif','infobox cart','','',ICON_CART,'infobox-cart') . '</a></li></ol>' .
                                  '  ';
     }
   //  $customer_orders_string .= '</table>';
   	$customer_orders_string .= '<div class="clear"></div>';


It on the demo like this now.

Note also the image has a class, . infobox-cart

 

 

Go to www dot css-oscommerce dot com/vtwo and you can see what the infoboxes look like a bit wider, but only one column. Those infoboxes are a bit narrow for something like order_history. If you sign on with a test account and place a couple of orders, you can see how that infobox looks like on account.php where I think it would be more useful anyway.

 

img src="images/icons/cart.gif" class="infobox-cart"  border="0"  alt="infobox cart" title=" infobox cart " width="16" height="17" In Cart>

 

and if you create a selector in the styles.css,

 img.infobox-cart

you may be able to get that image to line up better.

Edited by npn2531

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Share this post


Link to post
Share on other sites

I cannot seem to fathom out order history but this is what I have got so far. Those new css styles make a good difference. This has been my first attempt at styling and it has been a good learning curve

 

<?php

/*

$Id: order_history.php 1739 2007-12-20 00:52:16Z hpdl $

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

Copyright © 2003 osCommerce

Released under the GNU General Public License

*/

if (tep_session_is_registered('customer_id')) {

// retreive the last x products purchased

$orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);

if (tep_db_num_rows($orders_query)) {

?>

<!--start customer_orders -->

 

<?php

$info_box_contents = array();

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

new cssinfoBoxHeading($info_box_contents, false, false);

$product_ids = '';

while ($orders = tep_db_fetch_array($orders_query)) {

$product_ids .= (int)$orders['products_id'] . ',';

}

$product_ids = substr($product_ids, 0, -1);

// $customer_orders_string = '<table class="infobox">';

$products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int)$languages_id . "' order by products_name");

while ($products = tep_db_fetch_array($products_query)) {

$customer_orders_string .= ' ' .

' <div class="infobox"><div class="clear"></div><ol><li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></ol>' .

' <div class="infobox-image"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif','infobox cart','','',ICON_CART,'infobox-cart') . '</a></div>' .

' ';

}

// $customer_orders_string .= '</table>';

$customer_orders_string .= '</div>';

$info_box_contents = array();

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

new cssinfoBox($info_box_contents);

}

}

?>

 

I see where your trouble may be in rewriting the infoboxes. On the infoboxes, don't add any div classes within the box itself, those are added by the functions in includes/classes/boxes.php.

 

For example in converting these to ordered lists as you are attempting above, just write it like this:

 

$info_box_contents = array();
$info_box_contents[] = array('text' => '<ol><li><a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a></li>' .
'<li><a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a></li>' .
'<li><a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a></li>' .
'<li><a href="' . tep_href_link('faqs.php') . '">' . 'Faqs' . '</a></li>' .
'<li><a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a></li></ol>');


Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Share this post


Link to post
Share on other sites

I am having a problem with the product_info page. The footer has gone over to the left bottom. All other pages seem ok. I have checked it with other pages and cannot see any difference in the layout. Any idea what I should be looking for?

Share this post


Link to post
Share on other sites

I am having a problem with the product_info page. The footer has gone over to the left bottom. All other pages seem ok. I have checked it with other pages and cannot see any difference in the layout. Any idea what I should be looking for?

I have tracked it down to the product notifications box......

Share this post


Link to post
Share on other sites

Post your section of the code from that box that follows:

 

$info_box_contents = array();

 

I suspect all you have to do it remove a single div. When you rewrite that box the divs with the classes infobox_header, infobox and infoboxcontents are added by the programming and do not need to be in the infobox file itself. (that's what the "new cssinfoBox($info_box_contents); " is for)


Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Share this post


Link to post
Share on other sites

I had overwritten it with the original from the contrib but I have just changed it divs and it appears ok. I dont know what I have done different but it is now ok. I do have a problem with the also purchased products on product info though. They are all on the left. Having just looked, the module is calling for the old css styles from v1

 

$info_box_contents = array();

if ($notification_exists == true) {

$info_box_contents[] = array('text' => '<div class="clear"></div><ol><li><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></li></ol>');

} else {

$info_box_contents[] = array('text' => '<div class="clear"></div><ol><li><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a><p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></p></li></ol>');

}

Edited by pdcelec

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×