-
Customizing Product Description Text Formatting on Category Page
I'm going to start a separate thread for this question. Referencing this page...
*** URL removed *** index.php?main_page=product_info&cPath=1
You can see that the "preview text" of the product description here doesn't have the proper formatting that it does on the actual product page shown here...
*** URL removed *** /index.php?main_page=product_info&cPath=1&products_id=1
How can this be resolved?
Ideally, to be honest, I'd like that preview text to be different than the full text on the product page. Any tips on either of these?
Thanks for the great forum support, I've found about all the answers I seek so far.
-
Re: Customizing Product Description Text Formatting on Category Page
This looks like a good opportunity to post a mod I've had on the back burner for a while. I worked this out a few months ago here; the current version is just tidied up from that.
This is more complex than your requirement, but can be simplified to fit.
################################################################################____
Multiple Product Descriptions
################################################################################____
This mod gives the ability to have different descriptions in product listing and product info pages, and different parts of the info page description in different places.
First you need to allow HTML to function on the product listing page. Edit /includes/modules/your_template/product_listing.php to comment out zen_clean_html in two places around lines 98 & 100, as explained in this thread. You may also need to do a similar thing in products_all_listing.php (not sure of the filename) to allow HTML on the all products page.
It is also necessary to set the product listing description to allow a larger number of characters than you are ever likely to use (Configuration > Product Listing), so HTML tags don't get truncated. That would be bad. I set mine to 2000.
Enter all the different parts you want to display, with <span class=productDescList>text text text</span><span id=productDesc1>text text text</span><span id=productDesc2>text text text</span> tags around each section.
Put the short description for listing pages in productDescList, and blocks for the info page in 1, 2, etc.
You can use this as a template to paste into the description textarea and fill in:
HTML Code:
<span class=productDescList>your text here
</span>
<span id=productDesc1>your text here
</span>
<span id=productDesc2>your text here
</span>
Copy the product description block in tpl_product_info_display to all the locations where you want to display a section of text, and give each block (including the original) a separate id.
PHP Code:
<!--bof Product description -->
<?php if ($products_description != '') { ?>
<div id="productDescription1" class="biggerText productGeneral"><?php echo stripslashes($products_description); ?></div>
<?php } ?>
<!--eof Product description -->
<br class="clearBoth" />
Give any desired styling to each description block.
In your stylesheet, find #productDescription and change it to #productDescription1. Below that declaration, add
#productDescription2 {your desired styling} etc.
Next, turn off all display of #productDesc1 and #productDesc2 etc., and .productDescList in the product info page, and turn them on again selectively.
Code:
#productGeneral .productDescList, #productDesc1, #productDesc2 { display: none; }
#productDescription1 #productDesc1 { display: block; } /*or inline*/
#productDescription2 #productDesc2 { display: block; }
The desired parts of the description will display in their respective locations.
-
Re: Customizing Product Description Text Formatting on Category Page
Awesome - thanks so much for posting. Once again I'll have to work on this in the evening but I'm pumped about trying it.
-
Re: Customizing Product Description Text Formatting on Category Page
Thanks for the help - pardon my ignorance as I'm still waiting on my CSS lesson from a friend. For this block of text below, what file to do enter this in? I may be requesting some hand holding here, but perhaps by the time we're done I can summarize it into a very basic step by step for others...
Enter all the different parts you want to display, with <span class=productDescList>text text text</span><span id=productDesc1>text text text</span><span id=productDesc2>text text text</span> tags around each section.
Put the short description for listing pages in productDescList, and blocks for the info page in 1, 2, etc.
You can use this as a template to paste into the description textarea and fill in:
-
Re: Customizing Product Description Text Formatting on Category Page
Sorry for not being explicit there - you would save that "template" block of text as a text file somewhere handy on your computer, and copy & paste it into the description field when you are creating a new product. Then you just add your text in place of the "your text here".
For a quick start on CSS, check out www.w3schools.com - they have tutorials and interactive examples where you can actually practice live.
-
Re: Customizing Product Description Text Formatting on Category Page
Great thanks I'll look at this again.
-
Re: Customizing Product Description Text Formatting on Category Page
great contribution and directions. Have a small problem, all my description boxes are different sizes and misaligned, any ideas on how to fix this.
Also one of my products doesnt have a description2 boxes
any help would be great,
-
Re: Customizing Product Description Text Formatting on Category Page
You can use the classes and ids in your stylesheet to fine-tune the size, shape, position, font and other characteristics of the individual description areas. If a particular product doesn't have any text to go in #productDesc2, leave it empty (or eliminate the <span id=productDesc2>your text here</span>) and if it has no borders or background color it will at most add a small blank space where it would usually display.
-
Re: Customizing Product Description Text Formatting on Category Page
The problem is in the description boxes in the admin area. they are now aligned like
xxx
xx
x
x
x
xx
xxx
The lines at the bottom of the page where you can add a pic and everything are misaligned too. I looked at the style sheet but I think its for the webpage not the admin area. Is there a style sheet for the admin area?
-
Re: Customizing Product Description Text Formatting on Category Page
There should be a separate stylesheet for admin, and any editing you have done to your template stylesheet can have no effect on admin. Zen Cart will never see the template stylesheet when rendering admin pages. So I don't know what could have happened to your display.
Can you post a screenshot of the display? (Obviously you can't post your admin for us to look at live.)
-
1 Attachment(s)
Re: Customizing Product Description Text Formatting on Category Page
couldnt get the whole product admin area in the screen shot, but hope this sheds a little light on whats happening see attached file.
-
Re: Customizing Product Description Text Formatting on Category Page
You're using multiple languages? I have only used English, so don't know what this page should look like for more than one language. It does look somewhat disorderly.
At any rate, I don't think there is any way that changes to tpl_product_info_display.php or the catalog stylesheet can be seen by the admin to affect it, even if by chance one of the class/id tags in the new code matched an admin tag. Maybe someone with authoritative knowledge can confirm this? I hope someone can figure out why your problem would be happening and if it is connected to this code.
-
Re: Customizing Product Description Text Formatting on Category Page
fixed the problem, in collect_info.php there was this line
<tr>
<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
I copied the code from
http://anekostudios.com/2007/04/25/m...t-zencart-tip/
and it was missing the
<table border="0" cellspacing="0" cellpadding="0">
-
Re: Customizing Product Description Text Formatting on Category Page
That clears up the mystery. The thread referred to at the top actually contains references to two completely different solutions to the problem. Mine is a simple block of code added to tpl_product_info_display.php, and some stylesheet manipulation. Anekostudios' is a full-featured new field in the database with admin control. Both can achieve the same output results.
The missing code from anekostudios' tip would certainly account for a messed-up display in admin.
-
Re: Customizing Product Description Text Formatting on Category Page
Hi Glen,
This is continuing on from our discussion in another thread.
And for reference my site is here.
Just to re-cap I'm wanting to show an image of 1) measurements diagram, 2) a table of measurements and 3) a product description all on the Product Info Page.
Example below:
http://i18.photobucket.com/albums/b1...Picture2-2.png
And this is the code which is in the product description field in ZC admin:
<span class=productDescList><img src = images/DiaCorn_sm.jpg>
</span>
<span id=productDesc1><table width="180" border="1" align="left" cellpadding="3" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#CCCCCC">
<tr>
<td width="50">Name</td>
<td width="121"><strong>Criss Cross </strong></td>
</tr>
<tr>
<td width="50">A</td>
<td>3000 mm</td>
</tr>
<tr>
<td width="50">B</td>
<td>100 mm</td>
</tr>
<tr>
<td width="50">C</td>
<td>160 mm</td>
</tr>
</table>
</span>
<p><span id=productDesc2>Product description text here.
</span></p>
As you can see I've managed this with your help last week.
But I need to know how to "switch off" the measurements diagram (no.1 in the above image ex) when the products are displayed in the Products Listing Page.
As far as all the different listing pages go I'll only ever be using the Products Listing Page as I've disabled the Featured, New, All, Discounted etc etc pages.
Thanks.
-
Re: Customizing Product Description Text Formatting on Category Page
You're doing well so far, but this is going to require a bit of tweaking for your situation.
It occurs to me that a table, being a block-level element, is not supposed to be inside a span. You should change the <span id=productDesc1> to <div id=productDesc1>, and maybe the others as well - not sure how much difference they will make. It will probably eliminate the need to have the <p> around the span.
The diagram you have labeled as productDescList is actually the only part you don't want in the listing. (For semantic clarity, you should probably change its name to productDescNoList.) Since you do want productDesc1 and productDesc2 in the listing, and id's are supposed to be unique on a page, change all the id="... to class="...
Next for the styling to get display organized.
-
Re: Customizing Product Description Text Formatting on Category Page
The styling will differ depending on whether you want to have the parts of the description in different places on the product info page. I will proceed on the assumption that you basically like the arrangement that shows now and will not want it radically different. This will eliminate the need to add new divs to the code in tpl_product_info_display.php. Let me know if it is otherwise.
Modified from post #2:
Next, turn off all display of .productDescNoList, .productDesc1 and .productDesc2, and turn them on again selectively. Add to your stylesheet:
Code:
.productDescNoList, .productDesc1, .productDesc2 { display: none; }
#productListing .productDesc1 { display: block; } /*or inline*/
#productListing .productDesc2 { display: block; } /*or inline*/
#productGeneral .productDescNoList { display: block; } /*or inline*/
#productGeneral .productDesc1 { display: block; } /*or inline*/
#productGeneral .productDesc2 { display: block; } /*or inline*/
If all of these end up with the same display values, you can collect them all into one declaration. There are many things you can do to get the display arranged in specific ways. If there is some arrangement you can't figure out how to get, let me know.
-
Re: Customizing Product Description Text Formatting on Category Page
Quote:
Originally Posted by
gjh42
The styling will differ depending on whether you want to have the parts of the description in different places on the product info page. I will proceed on the assumption that you basically like the arrangement that shows now and will not want it radically different.
Thanks Glen. Yes indeed absolutely correct. The client wanted quite large prod images so space is at a premium. I think the present layout is best for now.
Quote:
Originally Posted by
gjh42
This will eliminate the need to add new divs to the code in tpl_product_info_display.php. Let me know if it is otherwise.
Great to hear not much tweaking required. Anything over a moderate difficulty level involving CSS or .php often leads to a world of pain for an oldskool tables boy like myself.
Quote:
Originally Posted by
gjh42
Modified from post #2:
Next, turn off all display of .productDescNoList, .productDesc1 and .productDesc2, and turn them on again selectively.
Sorry for a daft question but does the:
Code:
.productDescNoList, .productDesc1, .productDesc2 { display: none; }
Turn off all the displays? If so to turn them on selectively do I just /* */ out the above line of code and then add { display: none;} selectively to the #prod.... codes below?
Quote:
Originally Posted by
gjh42
Add to your stylesheet:
Code:
.productDescNoList, .productDesc1, .productDesc2 { display: none; }
#productListing .productDesc1 { display: block; } /*or inline*/
#productListing .productDesc2 { display: block; } /*or inline*/
#productGeneral .productDescNoList { display: block; } /*or inline*/
#productGeneral .productDesc1 { display: block; } /*or inline*/
#productGeneral .productDesc2 { display: block; } /*or inline*/
Done.
Quote:
Originally Posted by
gjh42
If all of these end up with the same display values, you can collect them all into one declaration. There are many things you can do to get the display arranged in specific ways. If there is some arrangement you can't figure out how to get, let me know.
I'll start tweaking and getting used to what exactly this code does. I'll no doubt return to this space for some guidence.
Thanks Glen.
ps An off topic question, Is table design really a dying technique these days?
-
Re: Customizing Product Description Text Formatting on Category Page
Just a thought but I posted the given code into the /*the main content classes*/ section of my stylesheet.
Does it matter where it sits within the stylesheet?
.productDescNoList, .productDesc1, .productDesc2 { display: none; }
#productListing .productDesc1 { display: block; } /*or inline*/
#productListing .productDesc2 { display: block; } /*or inline*/
#productGeneral .productDescNoList { display: block; } /*or inline*/
#productGeneral .productDesc1 { display: block; } /*or inline*/
#productGeneral .productDesc2 { display: block; } /*or inline*/
-
Re: Customizing Product Description Text Formatting on Category Page
Well there it is! :clap:
After a little fiddling around it seems to be functioning very well with the test data.
Glen, I had to add the red highlighted text below to your suggested code in order for it to work:
Code:
.productDescNoList, .productDesc1, .productDesc2 { display: block; }
#productListing .productDescNoList {
display: none; /*or inline*/
}
#productListing .productDesc1 {
display: block; /*or inline*/
}
#productListing .productDesc2 {
display: block; /*or inline*/
}
#productGeneral .productDescNoList {
display: block; /*or inline*/
}
#productGeneral .productDesc1 {
display: block; /*or inline*/
}
#productGeneral .productDesc2 {
display: block; /*or inline*/
}
Many thanks for your time on this issue.
-
Re: Customizing Product Description Text Formatting on Category Page
Changing
.productDescNoList, .productDesc1, .productDesc2 { display: none; }
to
.productDescNoList, .productDesc1, .productDesc2 { display: block; }
negates the purpose of this declaration, and does make
#productListing .productDescNoList {
display: none;
}
required. Actually, since in your case .productDescNoList in the listing page is the only item that wants to be turned off, the code can be simplified by just eliminating
.productDescNoList, .productDesc1, .productDesc2 { display: block; }
as it serves no purpose.
And yes, table design is very much deprecated these days. They are still appropriate for displaying tabular data, but for page layout, divs and CSS are more flexible and powerful and assist in making comprehensible code that can be displayed equally well in many different circumstances.
-
Re: Customizing Product Description Text Formatting on Category Page
That's what I'd been hearing more and more.
My trade is originally photography and image manipulation/retouching.
However, as the market changes so must I and I've found increasing demand for web site design and building.
So, it seems that I must tackle the CSS and divs minefield if I'm to survive!
Cheers.
-
Re: Customizing Product Description Text Formatting on Category Page
Re: Customizing Product Description
Is this new in development mod,
if I understand it, able to, add a long product description,
10 or 15 lines, on Add to Cart page, below add to cart box,
and product(s) in cart display.
---------
Does it have the ability to, work with TinyMCE, (edit) html .
---------
I have seen this in some sites using tables,
I would prefer css, with this product description
---------
Also thank you again for Category Dressing Mod,
it worked with no issues.
-
Re: Customizing Product Description Text Formatting on Category Page
The multiple description code by itself only deals with getting different descriptions in product listing and product info pages, and different pieces of description in different places in the info page. Any styling for the listing page is a separate issue. If I understand your desire, you may want to check out a commented-out section of code in (I think) product_listing.php which gives the full-width description below the rest, like the all listing.
I don't use HTML editors, so can't say anything about this question. Experiment on something unimportant and see.
You can do as much CSS styling of the descriptions as you want, and you can use tables where appropriate.
THis mod deals with individual product descriptions, not a group item placed outside the normal listing.
-
Re: Customizing Product Description Text Formatting on Category Page
hi Glenn
ive read through this post and am a bit lost. hope u can help me. i just wanna b abe to use html inthe product description field. thats all.
canu help me? i hope so.
cheers
simon
-
Re: Customizing Product Description Text Formatting on Category Page
In /includes/modules/product_listing.php, find this section
PHP Code:
case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
} else {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
}
break;
and comment out the
zen_clean_html
like this
/*zen_clean_html*/
in two places to get
PHP Code:
case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(/*zen_clean_html*/(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
} else {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(/*zen_clean_html*/(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
}
break;
Save as /includes/modules/your_template/product_listing.php.
-
Re: Customizing Product Description Text Formatting on Category Page
Hi,
Your explanation sounds perfect for the CSS approach.
I am working on search engine optimization for a merchant that already has Zen cart installed. I am worried about hiding text, though using a perfectly clean CSS solution. Google in its answer to this question targets as well CSS technics.
As my client has already lost many visitors after adopting zen cart, I don't feel so confident with display none.
I am a Miva and perl developer not so skill in PHP. Buth I would think to modify the PHP template to get the same result: taking or not taking piece A or piece B or Piece A+B from the product description, to feed the listing and the product info page distinctly.
Would this be possible?
-
Re: Customizing Product Description Text Formatting on Category Page
Yes, it would be possible without additional database fields.
The cutting product descriptions manually (for listings) thread describes a way to select a breakpoint in the description text. This could be duplicated as many times as needed with *more1*, *more2*, etc, and the text before and after the desired segment stripped off using the PHP strstr(), strpos() and/or str_replace() functions at each display location.
You say "Google in its answer to this question targets as well CSS technics." Where did you hear this? And what techniques are targeted?
-
customs Products Description
-
Re: customs Products Description
anyone knows how to do that at all
-
Re: customs Products Description
The amount of customization in that product info page is beyond the scope of a forum post. You need to start with basic aspects of the layout, and ask for help if you need to figure something out, or post in Commercial Help Wanted to have someone build it for you.
-
1 Attachment(s)
Re: Customizing Product Description Text Formatting on Category Page
1st time poster only because this forum is excellent!!! Ive been using ZC for about 2 weeks & this is a killer resource - especially for us that are new to the e-commerce arena! Now that thats out of the way...
Glenn, your code to customize a product description worked like a charm - THANK YOU!.... the only thing that is giving me any issues is that my new description that is displayed on my main product page needs to be placed in the original description location. currently it displays under my image & not right justified to the image like the original description... i know that this is prob an easy fix but I havent come across a solution for it... any help would be greatly appreciated!
Once again THANKS for all who have kept this forum alive because it has been a lifesaver for newbies like myself!!!
oh yea BTW im using ZC 1.3.9b
-
Re: Customizing Product Description Text Formatting on Category Page
I guess part of being comfortable with ZC is just sometimes diving in head first (of course having a good backup helps with my confidence to make drastic changes) so I braved the .php & was able to get the description in the correct place! I just followed my instincts & removed the original product description code & put mine in its place & taaa-daaa! Thanks again to everyone who helps answer our questions as I have gained so much insight from all the posters here!!! Thanks again for making this forum the ultimate resource for ZC!!!
-
Re: Customizing Product Description Text Formatting on Category Page
Hi - i've been trying to get this working today and it seemed to work like a dream.. until i realised that some of the products seemed to disappear entirely... it might be coincidence but i think the issue is with Linked products.
I added this to my CSS... which if i remove resolves the missing products problem but did work with hiding the right bit of description:-
#productGeneral .productDescList, #productDesc1, #productDesc2 { display: none; }
#productDescription1 #productDesc1 { display: block; } /*or inline*/
#productDescription2 #productDesc2 { display: block; }
Any ideas??
-
Re: Customizing Product Description Text Formatting on Category Page
That bit of code and the product listing/info code in general can't distinguish linked products from unlinked ones, so I think that is a red herring.
Seeing your site live (with the styling in place) might help to diagnose the problem.
-
Re: Customizing Product Description Text Formatting on Category Page
Hi, I've added the code back in for a short while (not keen to leave it there as it means visitors aren't seeing all the products...)
At least you can see a bit more what i mean...
i added: #productGeneral .productDescList, #productDesc1, #productDesc2 { display: none; }
#productDescription1 #productDesc1 { display: block; } /*or inline*/
#productDescription2 #productDesc2 { display: block; }
to the stylesheet.
-
Re: Customizing Product Description Text Formatting on Category Page
Don't know where your site is to look at it...
-
Re: Customizing Product Description Text Formatting on Category Page
Hmmn - it gets worse. I just noticed that my Babies/Gifts section also appears to have died... there are products in the category but they don't show up in the product listing and the right sidebar disappears.... i cant see how this would be linked to my addition to the product_info file though!
-
Re: Customizing Product Description Text Formatting on Category Page
Apologies - it is www.jambaroo.co.uk
http://www.jambaroo.co.uk/babies/gifts-gift-boxes shows my missing products entirely... and http://www.jambaroo.co.uk/babies/t-shirts-tops-jumpers shows my issue where its not showing all the products!
Thanks!
-
Re: Customizing Product Description Text Formatting on Category Page
An edit to product_listing.php that caused a PHP fatal error would cut off the page output just as seen in gifts-gift-boxes. The curious thing is that it does not happen with all categories. What is the content of the first product description (or maybe we need to see the text for all of them) in the category that is malfunctioning? What is your setting for Configuration > Product Listing > Display Product Description ?
Adding CSS (even with errors) to your stylesheet could not cut off the HTML page output in view source.
-
Re: Customizing Product Description Text Formatting on Category Page
Hi - here's the contents of a product which works:-
<span class=productDescList><img src="http://www.jambaroo.co.uk/images/BBlueSwatch.gif" alt txt='Baby Blue Boys T-shirts Swatch'><br></br>
<strong>Sizes: 1-2Y/2-3Y/3-4Y/4-5Y</strong><br></br>
<ul class="ProductDetailsList">
<li>Made By With Hugs & Kisses</li>
<li>Made From 100% Cotton.</li>
<li>Delivery Time - Within 5 days by 1st Class Mail</li>
</ul></span>
<span id=productDesc1>A gorgeous short sleeved pale blue t-shirt , appliqued with a cute little monkey. Perfect for any cheeky little monkey. Comfortable and practical!
T-shirt is 100% cotton and machine washable. Handmade in the UK.</span>
And one which seems to be missing from the listing:-
<span class=productDescList><img src="http://www.jambaroo.co.uk/images/BBlueSwatch.gif" alt="Baby Blue Personalised T-shirts"/>
<img src="http://www.jambaroo.co.uk/images/BlueSwatch.gif" alt="Blue Personalised T-shirt"/>
<img src="http://www.jambaroo.co.uk/images/WhiteSwatch.gif" alt="White Personalised T-shirts"/>
<img src="http://www.jambaroo.co.uk/images/BPinkSwatch.gif" alt="Baby Pink Personalised T-shirts"/>
<img src="http://www.jambaroo.co.uk/images/RedSwatch.gif" alt="Red Personalised T-shirts"/>
<img src="http://www.jambaroo.co.uk/images/PinkSwatch.gif" alt="Baby Pink Personalised T-shirts"/>
<br></br>
<strong>Sizes: 0-3M/3-6M/6-12M/12-18M</strong>
<ul class="ProductDetailsList">
<li>Made By Jack Spratt Baby</li>
<li>Made From Cotton</li>
<li>Delivery Time - Dispatched within 5 days by 1st Class Royal Mail</li>
</ul></span>
<span id=productDesc1>Available in sizes ranging from 0-3 Months to 12-18 Months and in both Hot Pink and Baby Pink colours.
Personalise with Name and Date of Birth to Front with Angel Wings on reverse, this design is purely angelic. This Edition features stunning 'Glitz' effect print front and reverse to give it that extra wow factor.
All T Shirts have been designed to be a stylish slim fit. They have envelope necks for no tears dressing (12 -18 months round neck) and are made in England from 100 % luxury cotton. Please provide Babies First Name and Date of Birth (in number format) in the Personalised Details Section.</span>
and one from the category which is entirely missing:-
<span class=productDescList><img src="http://www.jambaroo.co.uk/images/BPinkSwatch.gif" alt txt "Pink baby swatch"><br></br><strong>Sizes: 0-3M/3-6M/6-9M/9-12M</strong><br></br>
<ul class="ProductDetailsList">
<li>Made By Milk Two Bunnies</li>
<li>Made From Cotton & Nylon Tulle with Elasticated Legs & Waist
li>
<li>Delivery Time - Delivery Time - Dispatched within 5 days by 1st Class Royal Mail</li>
</ul>
</span>
<span id=productDesc1>The perfect gift for a new baby. A beautifully soft organic cotton T-shirt, appliqued with a Liberty print Bunny, complete with beautifully handmade Tutu Knickers nappy cover in a gift box. With an exclusive Milk Two Bunnies woven label and tab.
The t-shirt is 100% Organic Cotton ex trims, Liberty print cotton, soft nylon tulle.
Complete with a white gloss gift box
Hand wash. We do not recommend tumble drying.
Limited edition
Hand made in England</span>
And finally - here is the product_listing.php contents:-
<?php
/**
* product_listing module
*
* @package modules
* @copyright Copyright 2003-2007 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: product_listing.php 6787 2007-08-24 14:06:33Z drbyte $
* UPDATED TO WORK WITH COLUMNAR PRODUCT LISTING For Zen Cart v1.3.6 - 10/25/2006
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
// Column Layout Support originally added for Zen Cart v 1.1.4 by Eric Stamper - 02/14/2004
// Upgraded to be compatible with Zen-cart v 1.2.0d by Rajeev Tandon - Aug 3, 2004
// Column Layout Support (Grid Layout) upgraded for v1.3.0 compatibility DrByte 04/04/2006
//
if (!defined('PRODUCT_LISTING_LAYOUT_STYLE')) define('PRODUCT_LISTING_LAYOUT_STYLE','rows');
if (!defined('PRODUCT_LISTING_COLUMNS_PER_ROW')) define('PRODUCT_LISTING_COLUMNS_PER_ROW',3);
$row = 0;
$col = 0;
$list_box_contents = array();
$title = '';
$max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)(MAX_DISPLAY_PRODUCTS_LISTING/PRODUCT_LISTING_COLUMNS_PER_ROW)) : MAX_DISPLAY_PRODUCTS_LISTING;
$show_submit = zen_run_normal();
$listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id', 'page');
$zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT', $listing_split->number_of_rows);
$how_many = 0;
// Begin Row Layout Header
if (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') { // For Column Layout (Grid Layout) add on module
$list_box_contents[0] = array('params' => 'class="productListing-rowheading"');
$zc_col_count_description = 0;
$lc_align = '';
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_NAME':
$lc_text = TABLE_HEADING_PRODUCTS;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_text = TABLE_HEADING_MANUFACTURER;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;
$lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : '');
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_QUANTITY':
$lc_text = TABLE_HEADING_QUANTITY;
$lc_align = 'right';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_text = TABLE_HEADING_WEIGHT;
$lc_align = 'right';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_IMAGE':
$lc_text = TABLE_HEADING_IMAGE;
$lc_align = 'center';
$zc_col_count_description++;
break;
}
if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
$lc_text = zen_create_sort_heading($_GET['sort'], $col+1, $lc_text);
}
$list_box_contents[0][$col] = array('align' => $lc_align,
'params' => 'class="productListing-heading"',
'text' => $lc_text );
}
} // End Row Layout Header used in Column Layout (Grid Layout) add on module
///////////// HEADER ROW ABOVE /////////////////////////////////////////////////
$num_products_count = $listing_split->number_of_rows;
if ($listing_split->number_of_rows > 0) {
$rows = 0;
// Used for Column Layout (Grid Layout) add on module
$column = 0;
if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
if ($num_products_count < PRODUCT_LISTING_COLUMNS_PER_ROW || PRODUCT_LISTING_COLUMNS_PER_ROW == 0 ) {
$col_width = floor(100/$num_products_count) - 0.5;
} else {
$col_width = floor(100/PRODUCT_LISTING_COLUMNS_PER_ROW) - 0.5;
}
}
// Used for Column Layout (Grid Layout) add on module
$listing = $db->Execute($listing_split->sql_query);
$extra_row = 0;
while (!$listing->EOF) {
if (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') { // Used in Column Layout (Grid Layout) Add on module
$rows++;
if ((($rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) {
$list_box_contents[$rows] = array('params' => 'class="productListing-even"');
} else {
$list_box_contents[$rows] = array('params' => 'class="productListing-odd"');
}
$cur_row = sizeof($list_box_contents) - 1;
} // End of Conditional execution - only for row (regular style layout)
$product_contents = array(); // Used For Column Layout (Grid Layout) Add on module
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
$lc_align = '';
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_align = '';
$lc_text = $listing->fields['products_model'];
break;
case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(/*zen_clean_html*/(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
} else {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(/*zen_clean_html*/(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
}
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
break;
case 'PRODUCT_LIST_PRICE':
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
$lc_align = 'right';
$lc_text = $lc_price;
// more info in place of buy now
$lc_button = '';
if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
$lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
} else {
if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
if (
// not a hide qty box product
$listing->fields['products_qty_box_status'] != 0 &&
// product type can be added to cart
zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
&&
// product is not call for price
$listing->fields['product_is_call'] == 0
&&
// product is in stock or customers may add it to cart anyway
($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
$how_many++;
}
// hide quantity box
if ($listing->fields['products_qty_box_status'] == 0) {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
} else {
$lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
}
} else {
// qty box with add to cart button
if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
$lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
} else {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
}
}
}
$the_button = $lc_button;
$products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
$lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
$lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');
break;
case 'PRODUCT_LIST_QUANTITY':
$lc_align = 'right';
$lc_text = $listing->fields['products_quantity'];
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_align = 'right';
$lc_text = $listing->fields['products_weight'];
break;
case 'PRODUCT_LIST_IMAGE':
$lc_align = 'center';
if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
$lc_text = '';
} else {
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
} else {
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
}
}
break;
}
$product_contents[] = $lc_text; // Used For Column Layout (Grid Layout) Option
if (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') {
$list_box_contents[$rows][$col] = array('align' => $lc_align,
'params' => 'class="productListing-data"',
'text' => $lc_text);
}
}
// add description and match alternating colors
//if (PRODUCT_LIST_DESCRIPTION > 0) {
// $rows++;
// if ($extra_row == 1) {
// $list_box_description = "productListing-data-description-even";
// $extra_row=0;
// } else {
// $list_box_description = "productListing-data-description-odd";
// $extra_row=1;
// }
// $list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"',
// 'text' => zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listi ng->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION));
//}
// Following code will be executed only if Column Layout (Grid Layout) option is chosen
if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
$lc_text = implode('<br />', $product_contents);
$list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => $lc_text);
$column ++;
if ($column >= PRODUCT_LISTING_COLUMNS_PER_ROW) {
$column = 0;
$rows ++;
}
}
// End of Code fragment for Column Layout (Grid Layout) option in add on module
$listing->MoveNext();
}
$error_categories = false;
} else {
$list_box_contents = array();
$list_box_contents[0] = array('params' => 'class="productListing-odd"');
$list_box_contents[0][] = array('params' => 'class="productListing-data"',
'text' => TEXT_NO_PRODUCTS);
$error_categories = true;
}
if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) {
$show_top_submit_button = true;
} else {
$show_top_submit_button = false;
}
if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART >= 2) ) {
$show_bottom_submit_button = true;
} else {
$show_bottom_submit_button = false;
}
if ($how_many > 0 && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0) {
// bof: multiple products
echo zen_draw_form('multiple_products_cart_quantity', zen_href_link(FILENAME_DEFAULT, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"');
}
?>
I'll go and have a look at these myself and see if i can suss anything out but i'm pretty stumped as your right... why would only some things work!
Thanks Jx
-
Re: Customizing Product Description Text Formatting on Category Page
And the config is set to 2000 as if i set it lower the grid layout goes all wrong!
-
Re: Customizing Product Description Text Formatting on Category Page
The error log shows:- [14-Dec-2010 07:17:24] PHP Warning: include_once(includes/languages/english.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /home/jambaro1/public_html/includes/init_includes/init_templates.php on line 72
[14-Dec-2010 07:17:24] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening 'includes/languages/english.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jambaro1/public_html/includes/init_includes/init_templates.php on line 72
I don't think i've made any changes to this though?!
-
Re: Customizing Product Description Text Formatting on Category Page
Failed opening 'includes/languages/english.php' for inclusion
Whether you changed this file or not, it is apparently not being found. Run a refresh on a category that works, then run one on a category that doesn't, and see if there is a new error message and what it says.
Check that the file is actually there with content (filesize > 0).
-
Re: Customizing Product Description Text Formatting on Category Page
Well i don't seem to get any errors anymore... but still no gift boxes page and i've still got the missing products (which re-appear if i remove the CSS).
This one really is weird... i've not made any category specific changes, yet some work and some don't.... i've not made and product specific changes... yet some work and some don't!
Argh...
-
Re: Customizing Product Description Text Formatting on Category Page
Righty i think i've fixed my missing category issue... i seemed to have a rogue product (don't know what was up with it but it works now it's deleted.)
I thought i would delete the category so started moving products... when i noticed that halfway through it stopped working... so realised it was a single product causing the problem.
Right so now i just need to work out why some of my products are missing from certain categories...... it says showing 1-9 of 13 products but only shows 5... so the DB is right, it knows there should be more... but doesn't show them all.
Thanks
-
Re: Customizing Product Description Text Formatting on Category Page
When I looked before, the HTML output created by PHP was cutting off just before the product description etc. would be output. CSS styles cannot affect the PHP functioning of the page. There has to be something else (perhaps connected with what you are doing with CSS) that is the real cause.
Which categories have problems, and which products do not show up?
-
Re: Customizing Product Description Text Formatting on Category Page
I fixed the missing category page.... but here's a missing example.. this product is under babies/t-shirts...
http://www.jambaroo.co.uk/babies/t-s...-glitz-t-shirt
<span class=productDescList><img src="http://www.jambaroo.co.uk/images/BBlueSwatch.gif" alt="Baby Blue Personalised T-shirts"/>
<img src="http://www.jambaroo.co.uk/images/BlueSwatch.gif" alt="Blue Personalised T-shirt"/>
<img src="http://www.jambaroo.co.uk/images/WhiteSwatch.gif" alt="White Personalised T-shirts"/>
<img src="http://www.jambaroo.co.uk/images/BPinkSwatch.gif" alt="Baby Pink Personalised T-shirts"/>
<img src="http://www.jambaroo.co.uk/images/RedSwatch.gif" alt="Red Personalised T-shirts"/>
<img src="http://www.jambaroo.co.uk/images/PinkSwatch.gif" alt="Baby Pink Personalised T-shirts"/>
<br></br>
<strong>Sizes: 0-3M/3-6M/6-12M/12-18M</strong>
<ul class="ProductDetailsList">
<li>Made By Jack Spratt Baby</li>
<li>Made From Cotton</li>
<li>Delivery Time - Dispatched within 5 days by 1st Class Royal Mail</li>
</ul></span>
<span id=productDesc1>Available in sizes ranging from 0-3 Months to 12-18 Months and in both Hot Pink and Baby Pink colours.
Personalise with Name and Date of Birth to Front with Angel Wings on reverse, this design is purely angelic. This Edition features stunning 'Glitz' effect print front and reverse to give it that extra wow factor.
All T Shirts have been designed to be a stylish slim fit. They have envelope necks for no tears dressing (12 -18 months round neck) and are made in England from 100 % luxury cotton. Please provide Babies First Name and Date of Birth (in number format) in the Personalised Details Section.</span>
It shows up perfectly without the CSS, but isn't there in the listing when the stylesheet entry is made. If i go straight to the URL it loads fine though.
-
Re: Customizing Product Description Text Formatting on Category Page
Well its been a very very long evening... but i think i've finally cracked it.
In both cases it looked like it was rogue products which when i finally worked it out and deleted/amended them, seemed to solve the issues I had. The category one i can't see at all why the product was causing the issue and the product listing on there was a missing >.
I'm not missing any categories, and the products are showing the reduce listing as I require.
Sincere thanks for everything... and now i'm going to go to bed!
Night night from the UK!
-
Re: Customizing Product Description Text Formatting on Category Page
At that link I get the "page not found" page.
At least now the page output isn't cutting off.
The listing says "Displaying 1 to 7 (of 7 products)" - how many are supposed to be in T-shirts, Tops & Jumpers?
Okay, I guess that would explain why it was looking alright when I was examining it:) Glad you got it sorted!
-
Re: Customizing Product Description Text Formatting on Category Page
I say its sorted - and it is in that they all now work.. however if i add a new product (even if i just put test in all the fields) it adds the product but the category page then is blank as per before.
If i move the product to another category - the category it was in re-appears and the new page is blank. It's so odd and seems to only appear when i add products to the gifts & accessories category (which i deleted and re-made since the last problem!)
To make it even weirder - i deleted two products as a part of my investigation and i re-added one of those just fine, but the 22nd product always kills the page whatever it is!
I'll just have to not add any more products to that category!