Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Where are <a> links "Product Name" and &quot


Guest

Recommended Posts

Hi all,

 

I'm starting this as a new thread because I think I've worked out part of my problem with the text color of the "Product Name" and "Price" headings in the product listing that results from clicking on a category in the "Categories" box in the left column.

 

The "Product Name" and "Price" headings are actually <a> tag links that sort the list either by product name or by price. Hence they are the color defined by the HTML "A" TAG style definition in stylesheet.css. This style also defines the color of the links in the various boxes.

 

H o w e v e r ! That's a BIG however. :D There is another <a> CLASS style named "A.headerNavigation". IT is the color I want to use. I am already using it for the navigation links at the top of the page, i. e. "My Account", "Cart Contents" , and "Checkout".

 

So o o o . . . my question is:

 

Where (in which file) can I find the HTML that creates the "Product Name" and "Price" <a> links that are at the top of the product listing generated when you click on a category in the "Categories" box in the left column?

 

Any help will be greatly appreciated.

 

Goin' live soon!!

 

Jerry Nielsen

Link to comment
Share on other sites

Ian,

 

Thanks for your response. You're right, of course. I have finally figured out that the line

 

$lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);

 

in the file /includes/modules/product_listing.php is the one that calls the tep_create_sort_heading function in the file /includes/function/general.php.

 

The <a href is being created in the line

 

$sort_prefix = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('page', 'info', 'x', 'y', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a'), 'NONSSL') . '" title="' . TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading . '">' ;

 

You can see that I have traced the creation of the Product List headiing back to this line. What is beyond my skill or understanding of PHP and/or HTML is how to assign the a.headerNavigation and a.headerNavigation:hover styles to this <a href

 

Do you know how this could be done? Any clues or help would be appreciated.

 

Jerry Nielsen

Link to comment
Share on other sites

Hi all again,

 

It's really exciting to trace things back in the code to where they are created and figure out how to make your shop look the way you want it to look. I wanted to have the same color for navigation links in my product listing as I did for the navigation bar at the top of the page. I figured out that the class A.headerNavigation in stylesheet.css was giving me that color. The problem is that the color for the SORT headings in the product listing you get when you click on a category in the "Categorries" box is the color define for the <a> tag in stylesheet.css. I finally figured out that the line

 

$lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);

 

in the file /includes/modules/product_listing.php is the one that calls the tep_create_sort_heading function in the file /includes/function/general.php which creates an ordinary <a> tag with now style definition. Hence the color of the text created by this line is that of any other <a> text.

 

For those of you trying to figure out where stuff comes from in osCommerce look at the source for your pages in your browser. That's where I got all of my clues. If default.php needs something, it usually calls it from another file with an INCLUDE.

 

Anyway, the <a href sort heading that gets it's color from the <a> tag style is being created in the line

 

$sort_prefix = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('page', 'info', 'x', 'y', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a'), 'NONSSL') . '" class="headerNavigation" title="' . TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading . '">' ;

 

As I mentioned, I traced the creation of the Product List headiing back to this line. By looking at the source code for the top bar's navigation color/style in the browser I figured out that I could add the bolded/underlined addition to the line as I have done above. That solved my problem. In this case, I used an existing style definition in the stylesheet.css, but you could create a NEW style and use that instead. Damn, I'm proud of myself. :D It's reallly been fun. Hope this helps someone else.

 

Jerry Nielsen

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...

Thank you so much for taking the time to post this for others to read.

 

If everyone would do what you have done and post your solution at the end this board would be even better. There are a lot of dead ends here though.

I'm not really a dog.

Link to comment
Share on other sites

Jerry,

 

Would you make your solution into an FAQ and add it to the Wiki area of the forum? It would be a great help! Thanks!!

Link to comment
Share on other sites

Honestly, without this thread or someone's guidance I wouldn't have been able to solve this on my own. At least not for a long time. Maybe when MS5 was being released :?

I'm not really a dog.

Link to comment
Share on other sites

  • 1 year later...

Rock on. Been looking for this as well. Didn't think that the forum was so old and there's no new ones created. Thought I might add this message so that others who are new to osCommerce may find this to be of some use.

 

Keywords: manufacturer model product quantity price listing sort order line of code to change class and link color

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...