Zen Cart Logo
Forums / Basic Configuration / Can someone *please* help me fix my layout problem?

Can someone *please* help me fix my layout problem?

Locked

Views: 1,180

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
12 Feb 2008, 10:08 PM
#1
gourmets avatar

gourmets

New Zenner

Join Date:
Jan 2007
Posts:
61
Plugin Contributions:
0

Can someone *please* help me fix my layout problem?

I've been trying to fix this issue and search for solutions, but I think this was a manual edit that was done by the person who programmed my site and now I cant figure out how to un-do it.

Currently, the descriptions are NOT showing on my product listing page. See http://www.gourmetshoppe.net/index.php?main_page=index&cPath=65_68_398 for example. When I originally had the site programmed, I didnt want the descriptions to be shown, but now I do.

Unfortunatley, the "Display Product Description" under Config > Product Listing is set to show and set to 150 characters, but still the description will not show, which leads me to believe this was a manual removal, or something is not working right.

I dont even know where to begin to troubleshoot this within the php of the files. Is there anyone that would be willing to take a look at whatever file controls this and tell me how to fix it? I can post the file here, or the applicable part of the file that controls it, or we can do it off the site. I'd be eternally grateful if someone could help! Thanks

12 Feb 2008, 11:11 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Can someone *please* help me fix my layout problem?

The description output happens in /includes/modules/your_template/product_listing.php. The "name" section around line 95 should look pretty much like this:```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;

Post the code you have and we can see what needs to be done.

If you do not have /includes/modules/your_template/product_listing.php, then the original editing was done in the core file (/includes/modules/product_listing.php) and you should make a copy as noted.
12 Feb 2008, 11:54 PM
#3
gourmets avatar

gourmets

New Zenner

Join Date:
Jan 2007
Posts:
61
Plugin Contributions:
0

Re: Can someone *please* help me fix my layout problem?

Thanks gjh!
I was going through your posted code and comparing it to mine and it is different, so there were changes made, but they were made because I added an additional "manufacturer's field" to the product listing, so I'm worried about changing it back to the way it should be without screwing that up. Can you take a look at my code below and advise if there is anything that I can change/add or remove to make the description show, but to also still leave the manufacturers_name addition?

 
case 'PRODUCT_LIST_NAME':
        $lc_align = 'left';
        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_not_null($listing->fields['manufacturers_name']) ? '<span class="product_listing_brand">' . TEXT_BRAND_NAME . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></span>' : '') . 
/*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_not_null($listing->fields['manufacturers_name']) ? '<span class="product_listing_brand">' . TEXT_BRAND_NAME . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></span>' : '') . '</div>';
        }
        break;

Thanks so much for offering to help! You're the best! :clap:

13 Feb 2008, 12:00 AM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Can someone *please* help me fix my layout problem?

In the first line for $lc_text, you simply have the description code commented out. Remove the /* and */ around```php
/*zen_trunc_string ... PRODUCT_LIST_DESCRIPTION) . */

In the second $lc_text line, the description code is gone. I'll have to look closer at that, but you can probably just add it back in from the original code posted above, after the product name code.
13 Feb 2008, 12:07 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Can someone *please* help me fix my layout problem?

As your code is arranged, the description will come after the manufacturer text. If that is ok, you should be able to add in the code the same as the first line:```php
. '</a></span>' : '') . '</div>';

```php
. '</a></span>' : '') . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
13 Feb 2008, 12:12 AM
#6
gourmets avatar

gourmets

New Zenner

Join Date:
Jan 2007
Posts:
61
Plugin Contributions:
0

Re: Can someone *please* help me fix my layout problem?

Edit.......I got your message after I typed my previous question...however I got it semi working!!!! Thank you soooo much!
One last quick style question though....how do you put a paragraph break into php code? Right now, the description is showing as starting on the same line as the Brand. I'd like to have a space between the line for the Brand and the start of the Description.

13 Feb 2008, 1:16 AM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Can someone *please* help me fix my layout problem?

That is in the HTML output.
You can just put in a <br /> like this:```php
. '</a></span>' : '') . zen_trunc_string(zen_clean_html

. '</a></span>' : '') . '<br />' . zen_trunc_string(zen_clean_html
```(Or '<br /><br />' if you want ...)
13 Feb 2008, 1:28 AM
#8
gourmets avatar

gourmets

New Zenner

Join Date:
Jan 2007
Posts:
61
Plugin Contributions:
0

Re: Can someone *please* help me fix my layout problem?

:clap: It works!! Thank you so much! You made this much easier than I feared it would be. Thanks again!