Forums / Templates, Stylesheets, Page Layout / How do I move "New Products ..." & "All Products ..." to top of category box?

How do I move "New Products ..." & "All Products ..." to top of category box?

Started by doooomed on 26 Feb 2013, 1:41 PM · Views: 1,901

Results 1 to 8 of 8
26 Feb 2013, 1:41 PM
#1
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

How do I move "New Products ..." & "All Products ..." to top of category box?

I am trying to do this in the categories side box...

Attachment 11999

Thank you!

26 Feb 2013, 1:46 PM
#2
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: How do I move "New Products ..." & "All Products ..." to top of category box?

you should be able to just move the code in the categories sidebox template

Phil Rogers
A problem shared is a problem solved.

26 Feb 2013, 1:52 PM
#3
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: How do I move "New Products ..." & "All Products ..." to top of category box?

includes/templates/YOUR_TEMPLATE/templates/sideboxes/tpl_categories.php

if it doesnt exist take a copy from here:
includes/templates/template_default/templates/sideboxes/tpl_categories.php

and upload it here:
includes/templates/YOUR_TEMPLATE/templates/sideboxes/

take this:

 if (SHOW_CATEGORIES_BOX_SPECIALS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true' or SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
    // display a separator between categories and links
        if (SHOW_CATEGORIES_SEPARATOR_LINK == '1') {
          $content .= '<hr id="catBoxDivider" />' . "\n";
        }
        if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
          $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
          if ($show_this->RecordCount() > 0) {
            $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a>' . '<br />' . "\n";
          }
        }
        if (SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true') {
          // display limits
          $display_limit = zen_get_products_new_timelimit();
    
          $show_this = $db->Execute("select p.products_id
                                     from " . TABLE_PRODUCTS . " p
                                     where p.products_status = 1 " . $display_limit . " limit 1");
          if ($show_this->RecordCount() > 0) {
            $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">' . CATEGORIES_BOX_HEADING_WHATS_NEW . '</a>' . '<br />' . "\n";
          }
        }
        if (SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true') {
          $show_this = $db->Execute("select products_id from " . TABLE_FEATURED . " where status= 1 limit 1");
          if ($show_this->RecordCount() > 0) {
            $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a>' . '<br />' . "\n";
          }
        }
        if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
          $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
        }
      }

and pu it just below this:

$content = "";
      
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";

always backup before trying stuff..

Phil Rogers
A problem shared is a problem solved.

26 Feb 2013, 2:14 PM
#4
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

Re: How do I move "New Products ..." & "All Products ..." to top of category box?

Thanks for the reply! I did already try that but it seems to break my page as it makes me lose everything except my header?

26 Feb 2013, 2:18 PM
#5
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: How do I move "New Products ..." & "All Products ..." to top of category box?

really thats odd because all you are doing is outputting the $content for the links before the categories.. strange. not at my pc to try, if i get chance laster i'll give it a try for you

Phil Rogers
A problem shared is a problem solved.

26 Feb 2013, 2:23 PM
#6
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

Re: How do I move "New Products ..." & "All Products ..." to top of category box?

Thank you, I appreciate it!

4 Mar 2013, 5:02 PM
#7
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

Re: How do I move "New Products ..." & "All Products ..." to top of category box?

Anyone on this? Thanks!

4 Mar 2013, 5:37 PM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I move "New Products ..." & "All Products ..." to top of category box?

philip937 posted the solution
You can see it HERE

Zen-Venom Get Bitten