If this is your first visit, check our documentation. To post, register or login.
Forums / All Other Contributions/Addons / Using one single listing template

Using one single listing template

Started by yellow1912 on 31 Dec 2007, 11:21 PM · Views: 90,908

Results 221 to 240 of 327
5 May 2010, 3:07 AM
#221
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Using one single listing template

Well it looks like only two of the four entries were inserted into the database. Trying to run the install again will give the error as it tries to re-insert one of these fields.

**Obviously you already made a database backup before installing this mod **so either you could revert to that and try again or you could use this edited version to insert the two remaining fields.

If it gives another duplicate error maybe you have some other mod installed that uses one of the same field names.

## The following may be run via phpMyAdmin rather than in Zen Cart Admin (if it gives an error)

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) 
VALUES ('Featured Listing Template', 'INDEX_FEATURED_USE_PRODUCT_LISTING', '1', 'Set to 1 to use the original listing templates, 2 to use the new index_listing template, 3 to use the Product Listing template.', 24, 2, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(''1'', ''2'', ''3''),'),
('Template Debugging', 'TEMPLATE_DEBUG', 'False', 'Display the template filenames where used', 24, 4, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(''False'', ''True''),');

good luck

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

5 May 2010, 7:27 AM
#222
livache73 avatar

livache73

New Zenner

Join Date:
May 2010
Posts:
7
Plugin Contributions:
0

Re: Using one single listing template

Thank you Steve, now it's working. I had to slightly modify your code, becouse only Template Debugging was missing.
My problem is still unsolved, about missing background in New Product area. Can you help me? Thank you again.
https://www.lucru.hostxd.com
Liviu

5 May 2010, 8:27 AM
#223
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Using one single listing template

I see you are using new products on the main page. I can see a blue background colour - image attached. Is there another page that shows what is missing?

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

5 May 2010, 8:36 AM
#224
livache73 avatar

livache73

New Zenner

Join Date:
May 2010
Posts:
7
Plugin Contributions:
0

Re: Using one single listing template

It should look like this:

http://eazyecommerce.com/demo/modern-zen

New products area has different background with border

5 May 2010, 9:22 AM
#225
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Using one single listing template

You are using the original template for new products.

I see the center section has

<div class="centerBoxWrapper" id="whatsNew">

I dont see these declared in the stylesheet css, although I have no tools apart from view source at the moment.

Is the problem on all the new, featured, specials pages?
If not, please leave them all enabled for for the main page and I will look later.
I am sure it is a css issue.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

5 May 2010, 2:14 PM
#226
livache73 avatar

livache73

New Zenner

Join Date:
May 2010
Posts:
7
Plugin Contributions:
0

Re: Using one single listing template

all are enabled now
You were right it was a stylesheet.css problem.
I had to add for each section someting like that:

#whatsNew {

          background-color: #ffffff;
          border: 1px solid #d2d2d2;
          height: 100%;
          margin-bottom: 10px;
          padding-bottom: 25px;

}

and for productListing to.
Now it works. Thank you for your help Steve.

Liviu

5 May 2010, 3:30 PM
#227
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Using one single listing template

I am glad you got it working, and that it was not down to one of the (too) many mistakes I have made with this mod,

Steve

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

12 May 2010, 12:05 PM
#228
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,022
Plugin Contributions:
2

Re: Using one single listing template

Hi Steve

I am still coming to grips with what you have done in this mod and am hoping you can provide clarity on the following:

  1. Do you assert any meaningful difference between the following comment types (being all that I have discerned so far)?

//Single Listing Template
//SLT
// Steve

  1. \includes\functions\extra_functions\index_listing.php

Line 32 should the following
&products_id=
be changed to
&products_id=

  1. \includes\modules\YourTemplate\product_listing.php

Line 162

<div class="listingDescription"> compared to <div class="itemManufacturer>

Can you provide your css for itemManufacturer?

  1. \includes\templates\YourTemplate\templates\tpl_modules_product_listing.php

Line 20
//$productListing = (!$productListingId) ? 'productListing' : $productListingId; //uncomment if you want css control over each section ?>

Is closing ?> supposed to be part of comment or should it be forced to next line for clarity?

Where does opening <?php close?

Line 34
if (TEMPLATE_DEBUG == 'True') echo '\includes\templates\YourTemplate\templates\tpl_modules_product_listing.php:line 32, $is_slt_listing = '. $is_slt_listing.'<br /><br />';//SLT?>

Is closing ?> supposed to be part of comment or should it be forced to next line for clarity?

Line 56
if (TEMPLATE_DEBUG == 'True') echo '\includes\templates\YourTemplate\templates\tpl_modules_product_listing.php:line 53, $is_slt_listing = '. $is_slt_listing.'<br /><br />';//SLT ?>

Is closing ?> supposed to be part of comment or should it be forced to next line for clarity?

  1. \includes\templates\YourTemplate\templates\tpl_specials_default.php
    Line 14 <h1 id="specialsListingHeading"><?php echo $breadcrumb->last(); ?></h1>

As I have not yet got around to offering any specials, could you please advise what echo $breadcrumb->last(); actually displays?

I note that echo $breadcrumb->last(); does not occur in the tpl_products_* files, all of which show
<h1 id="featuredDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

TIA

12 May 2010, 3:47 PM
#229
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Using one single listing template

  1. Do you assert any meaningful difference between the following comment types (being all that I have discerned so far)?

//Single Listing Template
//SLT
// Steve

Evidently I missed a few //Steves (now fixed).
I tend to comment all my changes everywhere in my site so they are easy to find. My product_listing.php is quite customized so there are a few of these that I had to extract before packaging the mod, not enough obviously.
So the answer is no! SLT is just a bit clearer than the full title when in amongst already busy code.

  1. \includes\functions\extra_functions\index_listing.php

Line 32 should the following
&products_id=
be changed to
&products_id=

Nope. If you get the HTML validator plugin for Firefox you would see this flagged as a validation error if left unencoded as just &.

  1. \includes\modules\YourTemplate\product_listing.php

Line 162

<div class="listingDescription"> compared to <div class="itemManufacturer>

Can you provide your css for itemManufacturer?

I don’t actually use any. I just put it in there for completeness if you should wish to use it.

  1. \includes\templates\YourTemplate\templates\tpl_modules_product_listing.php

Line 20
//$productListing = (!$productListingId) ? 'productListing' : $productListingId; //uncomment if you want css control over each section ?>

Is closing ?> supposed to be part of comment or should it be forced to next line for clarity?
Where does opening <?php close?

The <?php opens one line 1, and closes at the end of this comment, so the ?> is part of the code not the comment.
//comments out one line only

Line 34
if (TEMPLATE_DEBUG == 'True') echo '\includes\templates\YourTemplate\templates\tpl_modules_product_listing.php:line 32, $is_slt_listing = '. $is_slt_listing.'<br /><br />';//SLT?>

Is closing ?> supposed to be part of comment or should it be forced to next line for clarity?

as above, it is not part of the comment. It can be moved to the next line if you wish.

Line 56
if (TEMPLATE_DEBUG == 'True') echo '\includes\templates\YourTemplate\templates\tpl_modules_product_listing.php:line 53, $is_slt_listing = '. $is_slt_listing.'<br /><br />';//SLT ?>

Is closing ?> supposed to be part of comment or should it be forced to next line for clarity

as above

  1. \includes\templates\YourTemplate\templates\tpl_specials_default.php
    Line 14
<h1 id="specialsListingHeading"><?php echo $breadcrumb->last(); ?></h1>

As I have not yet got around to offering any specials, could you please advise what echo $breadcrumb->last(); actually displays?

Home ¬ Specials

My separator is not the default one.

I note that echo $breadcrumb->last(); does not occur in the tpl_products_* files, all of which show

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

Specials is a different animal to the others, it is coded differently in the original and modified files. To be honest, as I did not write this mod just fixed a few things, I can’t remember exactly why but the breadcrumb work ok.

If you find anything else that you think may be wrong, it possibly is! Good Luck

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

20 May 2010, 8:31 AM
#230
albi avatar

albi

New Zenner

Join Date:
May 2010
Posts:
5
Plugin Contributions:
0

Re: Using one single listing template

hey you all... Im new at zen cart... trying to figure out how the layout changes work... I changed the files header.php.php and tpl_products_all_default.php ... everything still works... now Im trying to change the featured product to that template but it doesnt work. How can I change the code that my Featured Product is displayed on the main page. I read a lot in this blog but couldnt figure it out...

thanks for you help... here is the link to the shop...
http://movez.de/catalog/index.php

Im using zencart v1.3.9b

thanks :shocking:

20 May 2010, 1:45 PM
#231
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Using one single listing template

albi:

hey you all... Im new at zen cart... trying to figure out how the layout changes work... I changed the files header.php.php and tpl_products_all_default.php ... everything still works... now Im trying to change the featured product to that template but it doesnt work. How can I change the code that my Featured Product is displayed on the main page. I read a lot in this blog but couldnt figure it out...

thanks for you help... here is the link to the shop...
http://movez.de/catalog/index.php

Im using zencart v1.3.9b

thanks :shocking:Did you read the part of this thread where this mod is now available in the downloads section???

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

20 May 2010, 7:22 PM
#232
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Using one single listing template

It's available for download here, and is 1.3.9 compatible!

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=1531

Jackie Taferner - JT Website Design
Custom Website Design and Ecommerce
Support the community. Don't Private Message, post your questions in the forum.

22 May 2010, 8:15 AM
#233
albi avatar

albi

New Zenner

Join Date:
May 2010
Posts:
5
Plugin Contributions:
0

Re: Using one single listing template

thank you very much for your fast reply... for the update do I just overwrite the old files... Changed Files (since release of v1.3.9b)? And do I loose my layout settings?
greetings and thank you guys for your support and that wonderful system.

by Albi

22 May 2010, 7:44 PM
#234
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Using one single listing template

Yes, you would just overwrite the files.

Depending on which template files you have modified in the past, you may lose those settings.

I strongly suggest you backup all your files and database, just in case you do not like the new listings and want to revert back.

Jackie Taferner - JT Website Design
Custom Website Design and Ecommerce
Support the community. Don't Private Message, post your questions in the forum.

24 May 2010, 11:47 PM
#235
albi avatar

albi

New Zenner

Join Date:
May 2010
Posts:
5
Plugin Contributions:
0

Re: Using one single listing template

thank you very much for your reply and the help...
by albi

25 May 2010, 4:27 PM
#236
autoace avatar

autoace

Totally Zenned

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

Re: Using one single listing template

Can someone tell me if I'm doing this right?

I'd like to insert this bit of code:

echo '<div id="reviewCount">';
         if ($flag_show_product_info_reviews_count == 1) {
           //echo TEXT_CURRENT_REVIEWS . ' <strong>' . $reviews->fields['count'] . '</strong><br />';
           $stars_image_suffix = str_replace('.', '_', zen_round($reviews_average_rating->fields['average_rating'] * 2, 0) / 2); // for stars_0_5.gif, stars_1.gif, stars_1_5.gif etc.
           $average_rating = zen_round($reviews_average_rating->fields['average_rating'], 2);
           echo TEXT_CURRENT_REVIEWS_RATING . ' <strong>' . $average_rating . '</strong> ' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $stars_image_suffix . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $average_rating));
         } else {
           echo '';
         }
         echo '</div>';

into my includes/modules/MY_TEMPLATE/product_listing.php, so that I can show the the average product rating on the product listing display! So far though, I can not seem to make it work.

Does anyone know where that code snippet should be placed in that file?

NOTE: I am using Single Template Listing v1-6 AND Column Layout Grid v138

Thank you,
autoace

18 Jul 2010, 3:49 AM
#237
fei2010 avatar

fei2010

New Zenner

Join Date:
Jun 2010
Posts:
56
Plugin Contributions:
0

Re: Using one single listing template

I am using this mod to list products 3 columns per row, two questions:
1). how to add some spaces around each product? currently it is too close vertically.
2). how can I add a dotted grid around the list? something like this site: http://fashionfoot.net/index.php?main_page=index&cPath=2_16.

thanks.

19 Jul 2010, 5:59 AM
#238
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Using one single listing template

Formatting the product listing in your template is not the topic of this support thread but the principles are always the same for making style changes:

  1. Get Firebug for Firefox and learn how it works
  2. Inspect the element(s) on the page that you want to change to identify what css in the template is defining its current appearance.
  3. edit that css

In this case I think
centerBoxContentsProducts
is the class you need to add auto margins to left and right, and a dotted border.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

19 Jul 2010, 6:41 PM
#239
fei2010 avatar

fei2010

New Zenner

Join Date:
Jun 2010
Posts:
56
Plugin Contributions:
0

Re: Using one single listing template

torvista:

Formatting the product listing in your template is not the topic of this support thread but the principles are always the same for making style changes:

  1. Get Firebug for Firefox and learn how it works
  2. Inspect the element(s) on the page that you want to change to identify what css in the template is defining its current appearance.
  3. edit that css

In this case I think
centerBoxContentsProducts
is the class you need to add auto margins to left and right, and a dotted border.

torvista, thanks very much for your reply.

I posted here since, according to my check, the class="centerBoxContentsProducts centeredContent back" is introduced after this addon is installed (in file product_listing.php).

also I didn't find the definition for this css class in any of the CSS files.

19 Jul 2010, 10:28 PM
#240
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Using one single listing template

I posted here since, according to my check, the class="centerBoxContentsProducts centeredContent back" is introduced after this addon is installed (in file product_listing.php).

also I didn't find the definition for this css class in any of the CSS files.

I'm not surprised, those are three different style definitions applied to the same element. Messy.

You need to look at/create:
.centerBoxContentsProducts
.centeredContent
.back

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...