Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Convert Product-Listings to table-less CSS


  • You cannot reply to this topic
33 replies to this topic

#21 npn2531

  • Community Member
  • 951 posts
  • Real Name:Jase
  • Gender:Not Telling

Posted 20 May 2010, 02:19

That is really nice. You have gotten away from the stock OSCommerce drearyness. Note I have a template system for the OSC to CSS now
http://addons.oscommerce.com/info/7403
, that makes things easier still. The nonproduct images are separated out and put in a template folder with the stylesheet. You can switch out designs in the admin.

Edited by npn2531, 20 May 2010, 02:20.


#22 piernas

  • Community Member
  • 7 posts
  • Real Name:Juanma

Posted 01 June 2010, 00:20

I was taking a look on your test site and tried with IE6. The header has gone and right column is under the left one. Is this a known issue?

#23 npn2531

  • Community Member
  • 951 posts
  • Real Name:Jase
  • Gender:Not Telling

Posted 02 June 2010, 05:23

No, I have been making changes to the site, and using it for development of another design. The method describe here works well and uses pretty simple css that should not be an issue on IE, outside of the usual differences in how IE calculates width of an element. (ie including the width of the border).

Edited by npn2531, 02 June 2010, 05:23.


#24 piernas

  • Community Member
  • 7 posts
  • Real Name:Juanma

Posted 02 June 2010, 10:21

Well this is how it looks in firefox:

[IMG]http://i800.photobucket.com/albums/yy285/Mazinfriki/Oscommerce/firefox.jpg[/IMG]

And these are the results on IE6:

[IMG]http://i800.photobucket.com/albums/yy285/Mazinfriki/Oscommerce/ie.jpg[/IMG]

Header is blank, page is not centered and right column is below left one. I've tested on two XP machines with IE6, currently do not have a newer version to test.

Edited by piernas, 02 June 2010, 10:22.


#25 npn2531

  • Community Member
  • 951 posts
  • Real Name:Jase
  • Gender:Not Telling

Posted 03 June 2010, 22:44

It is an issue with includes/languages/espanol.php and includes/languages/german.php. Those two files have not been converted. To convert them, you need to add a bit more to every instance of: define('BOX_HEADING_NAMEOFBOX', 'Name of Box'); for each box.

Change to:

define('BOX_HEADING_NAMEOFBOX', '<span class="Nameofbox">Box');

You are adding the opening span tag

It would be best to copy them from the english file to make sure you get the exact class name.

#26 piernas

  • Community Member
  • 7 posts
  • Real Name:Juanma

Posted 04 June 2010, 02:27

I don't think it's related to lang files, if I select english on http://www.alpha-clear.com/catalog/index.php?language=en the problem is still there.

I'll give it a try and test it on localhost.

Do you see it when selecting another language?

#27 npn2531

  • Community Member
  • 951 posts
  • Real Name:Jase
  • Gender:Not Telling

Posted 04 June 2010, 02:37

I'm guessing. On second look it does look like something else.

#28 piernas

  • Community Member
  • 7 posts
  • Real Name:Juanma

Posted 04 June 2010, 10:30

I installed a local copy and the same happens. Looks like an incompatibility with IE6, but I don't know if further IE versions are affected.

Dreamweaver also displays it well as firefox does.

I have very few knowledge on CSS but I will take a look and see if I can find something.

#29 bavautoM3

  • Community Member
  • 22 posts
  • Real Name:Michael

Posted 19 June 2010, 21:36

View Postpiernas, on 04 June 2010, 10:30, said:

I installed a local copy and the same happens. Looks like an incompatibility with IE6, but I don't know if further IE versions are affected.

Dreamweaver also displays it well as firefox does.

I have very few knowledge on CSS but I will take a look and see if I can find something.


The latest contribution is missing the $doctype variable in the application_top.php file. It was stated in the instructions but was missing in the file. I had the exact same problem. I commented out echo $doctype in the index.php file and pasted in a standard doctype statement and it worked.

So to take advantage of the $doctype variable you will need to define it in application_top.php with the following code.

$doctype='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">';

I added it right after the $stylesheet code that was modified for this contribution.

The author is going to need to update the contribution with this fix. It is affecting all users who download the latest full package.

#30 npn2531

  • Community Member
  • 951 posts
  • Real Name:Jase
  • Gender:Not Telling

Posted 03 August 2010, 02:46

View PostbavautoM3, on 19 June 2010, 21:36, said:

The latest contribution is missing the $doctype variable in the application_top.php file. It was stated in the instructions but was missing in the file. I had the exact same problem. I commented out echo $doctype in the index.php file and pasted in a standard doctype statement and it worked.

So to take advantage of the $doctype variable you will need to define it in application_top.php with the following code.

$doctype='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">';

I added it right after the $stylesheet code that was modified for this contribution.

The author is going to need to update the contribution with this fix. It is affecting all users who download the latest full package.

It's in step three of the instructions. You paste it in to application_top.php just like you add the reference to the stylesheet

Quote

3) Open includes/application_top.php

find, near the end:

// initialize the message stack for output messages
require(DIR_WS_CLASSES . 'message_stack.php');
$messageStack = new messageStack;
just above, add this:

$doctype='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$stylesheet='<link rel="stylesheet" type="text/css" href="stylesheet.css">';


#31 aiyou

  • Community Member
  • 64 posts
  • Real Name:Rob
  • Gender:Male

Posted 30 September 2010, 07:47

Hello.

Just installed the OSC to CSS v 2.0 to a clean 2.2 store, and have a couple of questions.

When attempting to add a product to the cart, I have the buy now/add to cart button, but the cart itself remains empty.

Cosmetically, when adding a product with attributes (for example, the Matrox G200 graphic card) to the cart, where would I modify the output so that each attribute is on its own line, and not wrapped? I looked at the /jsonServices/ProductObject.php file, but couldn't find where a <BR> or other tag might go.

Thanks for the time and effort to creating this contribution.

Rob

#32 risela

  • Community Member
  • 24 posts
  • Real Name:Rosa Hernandez

Posted 21 October 2010, 03:29

I did all of the above things and it made my new product listings perfect however it hid my normal product listings am I missing something? I'd like to have them both the same.

#33 risela

  • Community Member
  • 24 posts
  • Real Name:Rosa Hernandez

Posted 21 October 2010, 03:32

View Postnpn2531, on 27 January 2010, 21:34, said:

To convert the new product listing to tableless CSS as well, do the above and then:

1) in includes/modules/new_products.php , at the end of the file
change:

  while ($new_products = tep_db_fetch_array($new_products_query)) {
    $info_box_contents[$row][$col] = array('align' => 'center',
                                           'params' => 'class="smallText" width="33%" valign="top"',
                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

    $col ++;
    if ($col > 2) {
      $col = 0;
      $row ++;
    }
  }

  new contentBox($info_box_contents);

to this

while ($new_products = tep_db_fetch_array($new_products_query)) {    
    echo '<div class="cssproduct_listing_item"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '"><br/>' . $new_products['products_name'] . '</a><br/><br/>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).'</div>';   
  }

   new csscontentBox($info_box_contents);
2) add the following code (new class definition) to includes/classes/boxes.php before the final ?>
class csscontentBox extends csstableBox {
    function csscontentBox($contents) {
      $this->csstableBox($info_box_contents, true);
    }
  }
that's it


I did all of the above things and it made my new product listings perfect however it hid my normal product listings am I missing something? I'd like to have them both the same.

#34 cconlin

  • Community Member
  • 41 posts
  • Real Name:Cindy
  • Gender:Female
  • Location:United States

Posted 13 March 2011, 20:48

This looks like what I am trying to do. Is there an OSC to CSS mod for version 2.3.1?
Or, has anyone seen it updated for OSC 2.3+ or know where I can find it?

Thank you!
Cindy