Forums / Templates, Stylesheets, Page Layout / Specials, Featured, etc at Top Of Category List

Specials, Featured, etc at Top Of Category List

Locked

Views: 2,083

Results 1 to 19 of 19
This thread is locked. New replies are disabled.
6 Apr 2010, 1:52 PM
#1
scytheuk avatar

scytheuk

New Zenner

Join Date:
Apr 2009
Posts:
42
Plugin Contributions:
0

Specials, Featured, etc at Top Of Category List

Hi all, does anyone have any idea how i can move the Specials, Featured Products etc, from the bottom to the top of the categories list?

I found a post that shows someone had luck, but unfortunately the two people involved seemed to do everything via emails and private messages and no details are showing,

While on that topic how do i change the text from 'Specials ...' to 'Special Offers' i did a search via Developers Tool Kit, but it only came back with the text for the Specials Sidebox.

Pete

6 Apr 2010, 2:49 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Specials, Featured, etc at Top Of Category List

Peek at the template file:
tpl_index_product_list.php

Notice everything below about line 108 ... this is all of the centerboxes ...

Everything about the line 108 ... this is the product listing ...

Be sure to use your templates and overrides ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

6 Apr 2010, 2:55 PM
#3
scytheuk avatar

scytheuk

New Zenner

Join Date:
Apr 2009
Posts:
42
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

Hi Ajeh, glancing at the code in tpl_index_product_list.php i would guess it was responsible for the layout of the centre boxes on the index page and not the categories list is that correct?

Or have i misread?

Pete

6 Apr 2010, 3:22 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Specials, Featured, etc at Top Of Category List

Below line 108 does the Center boxes ... above line 108 does the listing ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

6 Apr 2010, 3:29 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Specials, Featured, etc at Top Of Category List

NOTE: an even easier way is to comment out this code around line 90:

<?php
/**
 * require the code for listing products
 */
 require($template->get_template_dir('tpl_modules_product_listing.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_product_listing.php');
?>

And copy it to the bottom of the file before the closing </div>

Now the Centerboxes come first and then the listing ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

6 Apr 2010, 3:33 PM
#6
twaddle avatar

twaddle

Banned

Join Date:
Jul 2009
Location:
Prague, Czech Republic
Posts:
478
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

I think he's referring to the left side box, and wants to have specials, all products, new products etc above the categories...

6 Apr 2010, 3:37 PM
#7
twaddle avatar

twaddle

Banned

Join Date:
Jul 2009
Location:
Prague, Czech Republic
Posts:
478
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

scytheuk:

While on that topic how do i change the text from 'Specials ...' to 'Special Offers' i did a search via Developers Tool Kit, but it only came back with the text for the Specials Sidebox.

Pete
Developers Tool Kit worked for me :wink:
shop/includes/languages/YOUR_TEMPLATE/english.php
Line #71 : define('TOP_MENU_SPECIALS', 'Specials');

Line #108 : // specials box text in sideboxes/specials.php

Line #109 : define('BOX_HEADING_SPECIALS', 'Specials');

Line #110 : define('CATEGORIES_BOX_HEADING_SPECIALS','Specials ...');

Line #284 : define('TEXT_DISPLAY_NUMBER_OF_SPECIALS', 'Displaying <strong>%d</strong> to <strong>%d</strong> (of <strong>%d</strong> specials)');

Line #513 : define('TABLE_HEADING_SPECIALS_INDEX', 'Monthly Specials For %s');

6 Apr 2010, 4:12 PM
#8
scytheuk avatar

scytheuk

New Zenner

Join Date:
Apr 2009
Posts:
42
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

Hi, Twaddle your completely right i mean the categories list on the left hand side (Main Menu, if that makes it easier)

With regards to your comment on DTK, you found the same result i did, this line

Line #110 : define('CATEGORIES_BOX_HEADING_SPECIALS','Specials ...');

is the heading for the sidebox for specials and not the menu entry :D

Pete

Edit - Actually reading again what you posted, you find an additional line to me,

shop/includes/languages/YOUR_TEMPLATE/english.php
Line #71 : define('TOP_MENU_SPECIALS', 'Specials');

This one is not in my english.php file, although as it only says 'Specials' and not 'Specials ...' i would have possibly discounted it. Unless its the correct one, and the ' ...' is added in from elsewhere?

Pete

6 Apr 2010, 4:33 PM
#9
twaddle avatar

twaddle

Banned

Join Date:
Jul 2009
Location:
Prague, Czech Republic
Posts:
478
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

scytheuk:

Hi, Twaddle your completely right i mean the categories list on the left hand side (Main Menu, if that makes it easier)

With regards to your comment on DTK, you found the same result i did, this line

Line #110 : define('CATEGORIES_BOX_HEADING_SPECIALS','Specials ...');

is the heading for the sidebox for specials and not the menu entry :D

Pete

Edit - Actually reading again what you posted, you find an additional line to me,

shop/includes/languages/YOUR_TEMPLATE/english.php
Line #71 : define('TOP_MENU_SPECIALS', 'Specials');

This one is not in my english.php file, although as it only says 'Specials' and not 'Specials ...' i would have possibly discounted it. Unless its the correct one, and the ' ...' is added in from elsewhere?

Pete
You should have kep scrolling :P

includes/languages/english/specials.php
Line #19 : // $Id: specials.php 1969 2005-09-13 06:57:21Z drbyte $

Line #22 : define('NAVBAR_TITLE', 'Specials');

6 Apr 2010, 4:33 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Specials, Featured, etc at Top Of Category List

Like duh ... 'cause I was thinking that change gave would be the dumbest thing to do on the Product Listing ... :lamo:

Thanks for jumping in there ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

6 Apr 2010, 4:44 PM
#11
scytheuk avatar

scytheuk

New Zenner

Join Date:
Apr 2009
Posts:
42
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

Hi Twaddle, thats the nav bar title :P

The text that actually appears in the menu is 'specials ...' and i have changed all instances of that text on my localhost test site with no luck.

So either the correct text is 'Specials' and the ' ...' is added is elsewhere, or the 'Specials ...' doesnt appear in any language files.

So i do a search for All Files, 'Specials ...' which only shows the following

Line #101 : define('CATEGORIES_BOX_HEADING_SPECIALS','Specials ...');

Which is the sidebox header again.

Pete

6 Apr 2010, 4:51 PM
#12
scytheuk avatar

scytheuk

New Zenner

Join Date:
Apr 2009
Posts:
42
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

:oops:

Sorry Twaddle

I have just changed the text in the first line we discussed on an off chance

Line #101 : define('CATEGORIES_BOX_HEADING_SPECIALS','Specials ...');

and it did sort the menu,

So My Apologies

Because this was the Box Heading and i have changed several of these (so i could have images for sidebox titles), i thought there would be a seperate entry for the menu

On a sidenote this could potentially cause conflict as the menu item would reflect a filename had i implemented both a Specials Sidebox, and the Menu option. I Think

Pete

6 Apr 2010, 4:54 PM
#13
twaddle avatar

twaddle

Banned

Join Date:
Jul 2009
Location:
Prague, Czech Republic
Posts:
478
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

Well I assumed you got the two confused, so I scrolled down a bit more for you, I didn't know now I had to scroll back up again :D:D

6 Apr 2010, 4:58 PM
#14
scytheuk avatar

scytheuk

New Zenner

Join Date:
Apr 2009
Posts:
42
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

Doesnt solve the initital problem though :smile:

Do you think if we chat long enough we'll stumble on the solution anyway lol :)

Pete

6 Apr 2010, 5:10 PM
#15
scytheuk avatar

scytheuk

New Zenner

Join Date:
Apr 2009
Posts:
42
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

Right Back To The Original Query! :D

I have identified the file and code i need to move within the tpl_categories.php file in templates sideboxes

  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();
      $display_limit = zen_get_new_date_range();

      $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";
    }
  }

This code seems to control that bottom section of the categories menu (the bit in question)

Short of pasting it randomly until it works, i cant work out is where exactly to move it in the file, any suggestions anyone?

Pete

6 Apr 2010, 5:18 PM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Specials, Featured, etc at Top Of Category List

Move that below line 11 and see if you get the affect that you are looking for ...

Line 11 reads:

  $content = "";

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

6 Apr 2010, 5:23 PM
#17
scytheuk avatar

scytheuk

New Zenner

Join Date:
Apr 2009
Posts:
42
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

Hi Ajeh, thanks for suggestion, moving the code to that point helps, but breaks the border that i applied to the sidebox (see image)

I then tried finding somewhere within the section surround by Div ID and broke it :(

Pete

6 Apr 2010, 5:25 PM
#18
scytheuk avatar

scytheuk

New Zenner

Join Date:
Apr 2009
Posts:
42
Plugin Contributions:
0

Re: Specials, Featured, etc at Top Of Category List

A-ha found it!!!

Moved code to below

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

and it works,

Thanks everyone

Pete

6 Apr 2010, 5:29 PM
#19
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Specials, Featured, etc at Top Of Category List

I guess inside the div would have been a tad bit smarter, eh? :cool:

Thanks for the update on what worked for you ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!