Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How can I style zen_create_sort_heading output without messing the core?

How can I style zen_create_sort_heading output without messing the core?

Views: 399

Results 1 to 4 of 4
24 May 2016, 7:02 PM
#1
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

How can I style zen_create_sort_heading output without messing the core?

Hi
I was trying to style the product listings.
I only have price, and name....and image.

First , is there a way to not have the image in the sort by ?
THe only way I can do it is clearing the $lc_text related to the image...

case 'PRODUCT_LIST_IMAGE':
    $lc_text = '';
    $lc_align = 'center';
    $zc_col_count_description++;
    break;

But, I want to add some class or even add a space bettween the name and the "+".
I already try just to give a blank space, and   + , in the configuration section.

To the class, looking at product_listings , looks like it has the same class name that is presente in the function... but no changes happen in here:

$list_box_contents[0][$col] = array('align' => $lc_align,
                                      'params' => 'class="productListing-heading"',
                                      'text' => $lc_text
                                       );

Is there a way to achieve this without messing with this function ?

// Return table heading with sorting capabilities
function zen_create_sort_heading($sortby, $colnum, $heading) {
$sort_prefix = '';
$sort_suffix = '';

if ($sortby) {
  $sort_prefix = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('page', 'info', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a')) . '" title="' . zen_output_string(TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading) . '" class="productListing-heading">' ;
  $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? PRODUCT_LIST_SORT_ORDER_ASCENDING : PRODUCT_LIST_SORT_ORDER_DESCENDING) : '') . '</a>';
}

return $sort_prefix . $heading . $sort_suffix;

}

Thanks

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

24 May 2016, 7:46 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How can I style zen_create_sort_heading output without messing the core?

Using css would be a way that could be used to control the visibility of the image. Not sure I understand where this image is being displayed that is not desired. There is guidance on generating a CSS file located in the includes/templates/template_default/css directory...

The applicable css code can be seen typically through inspection of the source code of the displayed page. An appropriate css file could then be generated with the desired css to hide the image(s).

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

24 May 2016, 7:53 PM
#3
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: How can I style zen_create_sort_heading output without messing the core?

Thanks
I think the image is there because on configuration -> Product Listing , I have it on....I think everything that is On there, it display on that productListing-heading ... i guess.

About the style, I think I could style it by css , I think I want to have a kind of button, and I'm using foundation, so yep...
but the space for "+" and "-"....
Now i have this : Name+ , I would like to have Name +

THis is probably easy... but haven't found how to do it

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

24 May 2016, 7:57 PM
#4
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: How can I style zen_create_sort_heading output without messing the core?

Right
Language file :frusty:
Of course !

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison