Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Customizing Product Description Text Formatting on Category Page

Customizing Product Description Text Formatting on Category Page

Locked

Views: 21,188

Results 21 to 40 of 51
This thread is locked. New replies are disabled.
25 Sep 2007, 7:54 AM
#21
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

25 Sep 2007, 8:43 AM
#22
andy_mcg avatar

andy_mcg

New Zenner

Join Date:
Aug 2007
Location:
Turku, Finland
Posts:
51
Plugin Contributions:
0

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.

11 Oct 2007, 2:05 AM
#23
relentless avatar

relentless

New Zenner

Join Date:
Sep 2007
Posts:
56
Plugin Contributions:
0

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.

11 Oct 2007, 2:25 AM
#24
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

24 Oct 2007, 7:44 PM
#25
what44 avatar

what44

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

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

25 Oct 2007, 6:29 AM
#26
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Customizing Product Description Text Formatting on Category Page

In /includes/modules/product_listing.php, find this section```php
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;

zen_clean_html
like this
/*zen_clean_html*/ 
in two places to get ```php
        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.
26 Oct 2007, 2:43 PM
#27
netiskiv avatar

netiskiv

New Zenner

Join Date:
Oct 2007
Posts:
2
Plugin Contributions:
0

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?

26 Oct 2007, 3:52 PM
#28
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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?

27 Apr 2010, 10:22 PM
#29
xshaanx avatar

xshaanx

New Zenner

Join Date:
Apr 2010
Posts:
52
Plugin Contributions:
0

Re: Customizing Product Description Text Formatting on Category Page

how do i add products info like that just like the it is n image

demo:http://www.alamodeonline.com/productinfo_OT704.html

30 Apr 2010, 3:04 AM
#30
xshaanx avatar

xshaanx

New Zenner

Join Date:
Apr 2010
Posts:
52
Plugin Contributions:
0

Re: Customizing Product Description Text Formatting on Category Page

anyone knows how to do that at all

4 May 2010, 8:14 AM
#31
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Customizing Product Description Text Formatting on Category Page

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.

31 May 2010, 8:31 PM
#32
doug_vegas avatar

doug_vegas

New Zenner

Join Date:
May 2010
Location:
St. Petersburg, FL
Posts:
2
Plugin Contributions:
0

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

31 May 2010, 9:01 PM
#33
doug_vegas avatar

doug_vegas

New Zenner

Join Date:
May 2010
Location:
St. Petersburg, FL
Posts:
2
Plugin Contributions:
0

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!!!

10 Dec 2010, 7:56 PM
#34
jeniferous avatar

jeniferous

New Zenner

Join Date:
Oct 2010
Posts:
46
Plugin Contributions:
0

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??

10 Dec 2010, 9:45 PM
#35
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.

13 Dec 2010, 8:25 AM
#36
jeniferous avatar

jeniferous

New Zenner

Join Date:
Oct 2010
Posts:
46
Plugin Contributions:
0

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.

13 Dec 2010, 7:16 PM
#37
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Customizing Product Description Text Formatting on Category Page

Don't know where your site is to look at it...

13 Dec 2010, 7:18 PM
#38
jeniferous avatar

jeniferous

New Zenner

Join Date:
Oct 2010
Posts:
46
Plugin Contributions:
0

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!

13 Dec 2010, 8:40 PM
#40
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.