Zen Cart Logo
Forums / All Other Contributions/Addons / Using one single listing template

Using one single listing template

Views: 90,800

Results 21 to 40 of 327
14 Feb 2008, 9:00 PM
#21
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Using one single listing template

Are you using a custom template?
Copy and paste the content of that products_all.php language file here.

libragear:

Hi there. :) I am relatively new to Zen Cart, and have been doing a trial and error learning of its system. :) Learning a lot.

So anyway, I followed your directions for this mod. And it seems to work fine, however I ran into the same problem as an earlier person in this thread. The problem with the Header table column names showing up. I know what file you are reffering to modifying. It is the 'products_all.php' in the /includes/languages/english file right? So I have tried a number of combos for this, but without knowing SQL or PHP very well I can't figure out the correct syntax to use. any help would be appriciated. :)

Here is a link to my page,
http://www.libragear.com/zencart/index.php?main_page=products_all
. Please excuse my mess, I am still building. :) Thanks in advance for you help.

Thanks,

Kate

http://www.libragear.com

13 Mar 2008, 12:54 AM
#22
skylab001 avatar

skylab001

New Zenner

Join Date:
Jan 2008
Posts:
67
Plugin Contributions:
0

Re: Using one single listing template

Hi-
I've managed to get this working for the "all products" link with no problems. So now my all products listing shows up in columns like most everything else, except I can't figure out which files need to be edited to make it work with the "new products" or "specials" listing. Everything I have tried has ended in errors. Can you tell me exactly what files to edit so that my "new products" and specials display the same?

-sky

13 Mar 2008, 1:42 AM
#23
skylab001 avatar

skylab001

New Zenner

Join Date:
Jan 2008
Posts:
67
Plugin Contributions:
0

Re: Using one single listing template

OK so I figured out how to get "specials" and "new products" working, but my featured products won't work properly, is there something I'm missing?

20 Mar 2008, 2:16 AM
#24
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Using one single listing template

includes/modules/featured_products.php
or includes/modules/your_template/featured_products.php

21 Mar 2008, 9:06 PM
#25
skylab001 avatar

skylab001

New Zenner

Join Date:
Jan 2008
Posts:
67
Plugin Contributions:
0

Re: Using one single listing template

actually let me reword the problem, when I do the same process for laying out all the other pages in grid format----when it comes to featured products, it does display in grid format.....but it doesn't show just featured products....it shows all products.

21 Mar 2008, 11:13 PM
#26
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Using one single listing template

skylab001:

actually let me reword the problem, when I do the same process for laying out all the other pages in grid format----when it comes to featured products, it does display in grid format.....but it doesn't show just featured products....it shows all products.
Then you did something wrong with the sql statement, you probably need to look at the original sql query in the original file.

26 Mar 2008, 7:12 AM
#27
noella avatar

noella

New Zenner

Join Date:
Oct 2005
Posts:
71
Plugin Contributions:
0

Re: Using one single listing template

I'm not very up with php. But I am understanding that I only need to replace the header_php.php file and tpl_products_all_default.php files and it should be using the tpl_modules_product_listing.php template. would this cause problems if i installed the grid mod? it's b/c I want all the pages to have that layout.

I replaced the header_php.php and tpl_products_all_default.php files, but doesn't seem to be working. I know I'm missing something for sure. I'm running 1.3.8

thanks.

12 Apr 2008, 1:47 AM
#28
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Using one single listing template

Yellow1912,
Could you please take a look at my page and tell me what I did wrong? :
http://accessory-avenue.com/hbhcatalog/index.php?main_page=products_all

I can't figure out the TABLE_HEADING_IMAGE and TABLE_HEADING_PRICE issue. I also don't know why there are so many "add selected items to cart" buttons at the bottom!

12 Apr 2008, 1:59 AM
#29
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Using one single listing template

Yellow1912,
I figured out the heading bit (you will probably have responded by the time I post this- if so, sorry!)

For those that need help with that, go to the /includes/languages/your_template/english.php file and add something like this: (I added the note MY ADDITIONS for my own use- you don't have to add that)

// MY ADDITIONS
define('TABLE_HEADING_IMAGE', 'Image');
define('TABLE_HEADING_PRICE', 'Price');

.......

I still don't know about the add to cart buttons at the bottom though!

12 Apr 2008, 2:08 AM
#30
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Using one single listing template

P.S. (Sorry for the multiople posts!)

The files that need to be changed in the modules/pages folders
includes/modules/pages/products_all/header_php.php and
includes/modules/pages/products_new/header_php.php

Is there a way to put those in a custom folder so they don't get overwritten later? For example, would includes/modules/pages/your_template/products_all/header.php work?

12 Apr 2008, 2:09 AM
#31
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Using one single listing template

No, too bad, but ZC doesnt allow that yet.

12 Apr 2008, 2:12 AM
#32
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Using one single listing template

Phooey.
Ok.

Do you have any idea why there are so many "add selected products to cart" buttons at the bottom though? I can't figure that one out. It's not like that on the products_new page. I've only changed the products_all page so far though.

12 Apr 2008, 2:41 AM
#33
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Using one single listing template

All I can think of is that, you may have done something wrong while following the instruction. I dont know where, since I cant look at your code. You have to back track what you have done, files you have changed, compare the content with the sample code posted here.

12 Apr 2008, 2:43 AM
#34
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Using one single listing template

Well... ok. I literally only changed what you mentioned to change in your tutorial though.

stumped

12 Apr 2008, 3:17 AM
#35
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Using one single listing template

All I know so far is that the original files, when uploaded again, make everything look right again (but obviously not laid out how I want!) After editing the files you mentioned in the tutorial by copying and pasting exactly what you had, on the product_all page, when viewing it, the sort order is at the top, then the product listing, then the "Displaying 1 to 10 (of 330 products)" (which is different per person, I know), then the page numbers, then the "add selected products to cart" and finally, below that, is the page name. Followed by another sort order and another "add selected products" button. It's crazy. Check it out. It did that the first time I tried this mod too, but I changed it. After putting all the original files back and trying again, it did it again.

http://accessory-avenue.com/hbhcatalog/index.php?main_page=products_all

12 Apr 2008, 3:33 AM
#36
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Using one single listing template

Does this happen if you use the default template?

12 Apr 2008, 3:42 AM
#37
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Using one single listing template

No. With all the original files, the products_all page looks just like my products_new page (I haven't changed the _new page, so you can see the example here: http://accessory-avenue.com/hbhcatalog/index.php?main_page=products_new)
When I originally fixed the placement of the page title (I think I just moved your coding down a little bit), it looked like it should have, but the bottom was left with all the additional "add selected products" images. All the extras are still there now, but the page title/sort order is too, right now. If you took the page title/sort order from the bottom and put it to the top, that's the original problem I was talking about, with all those extra buttons at the bottom. And also there that wasn't before is where it says, "More products will be added soon. Please check back later." Check out that products_new link, you'll get the idea of how it looked and how it does now.

12 Apr 2008, 3:47 AM
#38
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Using one single listing template

Im talking about the default template that goes with ZC.
Anyway, I really cant figure out why, sorry. It works for me and for some other people, if it doesnt work in your case then something went wrong.

There are too many things need to be checked. But if you are familiar with php and zc, i suggest you check where that add to cart button drawn in the code, then see why it is drawn more than it should be.

12 Apr 2008, 4:00 AM
#39
celtickatt avatar

celtickatt

Zen Follower

Join Date:
Mar 2005
Location:
Tulsa, Ok
Posts:
174
Plugin Contributions:
0

Re: Using one single listing template

I don't know if it works with the actual "template_default" that comes with ZC- I'm not using that template. But the default template files were what I copied when I edited what your tutorial said to do. I just saved them in the custom template folder. So that should have had the same affect. If you're interested in looking, here's all the coding for the tpl_products_all_default.php file that was edited (the products_all/header_php.php file was replace entirely with what you wrote on the first page.)

<?php
/**
 * Module Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_product_listing.php 3241 2006-03-22 04:27:27Z ajeh $
 * UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING 04/04/2006
 */
require($template->get_template_dir('/tpl_modules_listing_display_order.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_listing_display_order.php');
    require($template->get_template_dir('tpl_modules_product_listing.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_product_listing.php');
?>

<div class="centerColumn" id="allProductsDefault">



<h1 id="allProductsDefaultHeading"><?php echo HEADING_TITLE; ?></h1>



<?php

require($template->get_template_dir('/tpl_modules_listing_display_order.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_listing_display_order.php'); ?>



<br class="clearBoth" />



<?php

  if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0 and $show_submit == true and $products_all_split->number_of_rows > 0) {

?>



<?php

    if ($show_top_submit_button == true or $show_bottom_submit_button == true) {

      echo zen_draw_form('multiple_products_cart_quantity', zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"');

    }

  }

?>



<?php

  if ($show_top_submit_button == true) {

// only show when there is something to submit

?>

<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit1" name="submit1"'); ?></div>



<?php

  } // top submit button

?>

<br class="clearBoth" />



<?php

  if (($products_all_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {

?>

  <div id="allProductsListingTopNumber" class="navSplitPagesResult back"><?php echo $products_all_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_ALL); ?></div>

  <div id="allProductsListingTopLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $products_all_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div>

<?php

  }

?>

<br class="clearBoth" />



<?php

/**

 * display the new products

 */

require($template->get_template_dir('/tpl_modules_products_all_listing.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_products_all_listing.php'); ?>



<?php

  if (($products_all_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {

?>

  <div id="allProductsListingBottomNumber" class="navSplitPagesResult back"><?php echo $products_all_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_ALL); ?></div>

  <div id="allProductsListingBottomLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $products_all_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div>

<?php

  }

?>

<br class="clearBoth" />



<?php

  if ($show_bottom_submit_button == true) {

// only show when there is something to submit

?>

  <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit2" name="submit1"'); ?></div>



<?php

  }  // bottom submit button

?>



<?php

// only end form if form is created

    if ($show_top_submit_button == true or $show_bottom_submit_button == true) {

?>

</form>

<?php } // end if form is made ?>

</div>

Obviously something is wrong somewhere, lol! Unforunately though, I'm completely php stupid, hence the reason I need to much help!

12 Apr 2008, 4:03 AM
#40
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Using one single listing template

Why do you have that in your tpl file? Did you read my post carefully? If you did, you should have replaced that by:

  <?php
/**
 * Module Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_product_listing.php 3241 2006-03-22 04:27:27Z ajeh $
 * UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING 04/04/2006
 */
require($template->get_template_dir('/tpl_modules_listing_display_order.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_listing_display_order.php');
    require($template->get_template_dir('tpl_modules_product_listing.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_product_listing.php');
?>