Forums / Templates, Stylesheets, Page Layout / All product listing - moving the description text up?

All product listing - moving the description text up?

Locked

Started by cashee on 25 Sep 2009, 1:05 AM · Views: 4,077

Results 1 to 20 of 29
This thread is locked. New replies are disabled.
25 Sep 2009, 1:05 AM
#1
cashee avatar

cashee

New Zenner

Join Date:
Mar 2009
Posts:
4
Plugin Contributions:
0

All product listing - moving the description text up?

Hi everyone, I am using zen cart 1.3.8 and I just have a really quick question.

How can I move my description of the product to the empty space? It used to be where the model, manufacturer, weight, etc are.

I tried searching for the solution but I was unsuccessful.

Thank you.

25 Sep 2009, 1:23 AM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: All product listing - moving the description text up?

"The server at https://www.qpetsupplies.com is taking too long to respond."

I moved the all products listing description on my site a few years ago - it's pretty easy. Let me go check on the file.

25 Sep 2009, 2:03 AM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: All product listing - moving the description text up?

/includes/templates/your_template/templates/tpl_modules_all_listing.php

These are the lines I changed - you might not want to do all of these, depending on your display desires:
Around line 110, comment out the line```php
if (PRODUCT_ALL_LIST_DESCRIPTION > '0') {
$disp_text = zen_get_products_description($products_all->fields['products_id']);
//$disp_text = zen_clean_html($disp_text); //gjh42 2007-12-15


Around line 189, add the description output and comment out the original table row output:```php
<?php

                  $disp_sort_order->MoveNext();
                }
                echo '<br /><span class="allListingDesc">' . $display_products_description . '</span>'; //gjh42 2007-12-15 - hard-code description at bottom of right column
              ?>
            </td>
          </tr>
<!--<?php// if (PRODUCT_ALL_LIST_DESCRIPTION != 0) { ?>gjh42 2007-12-15 - remove description spanning below rest of product - html and php comment tags
          <tr class="<?php// echo ((int)($row_counter/2)==($row_counter/2)) ? 'productListing-even' : 'productListing-odd'; ?>">
            <td colspan="3" valign="top" class="main">
              <?php
                //echo $display_products_description;
              ?>
            </td>
          </tr>
<?php// } ?>
          <tr>
            <td colspan="3"><hr /></td>
          </tr> -->
<?php
      $products_all->MoveNext();
25 Sep 2009, 2:19 AM
#4
kdays avatar

kdays

Zen Follower

Join Date:
May 2008
Posts:
239
Plugin Contributions:
0

Re: All product listing - moving the description text up?

Have you had a look in **Admin **> **Configuration **> All Listing?

In this Admin section you get to select the information you want to appear in a product listing (eg model no, weight, date added, etc) and also the layout of the information.

It may be that 'Display product Price' is set to show a number of blank lines after it. Or if you moved description to be on the Right it might sit better.

Play around with the options - you can change the listing layout quite a lot without going into the template files at all.

There's also Admin function to do the same for Featured Listings and New Listings.

Hope this helps.

Cheers
K

25 Sep 2009, 4:40 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: All product listing - moving the description text up?

The all products listing does not allow the description to be anywhere but across the bottom of the product's listing area. Also, the elements are in table cells instead of divs, so rearranging the code is the only way to alter this part of the layout.

If you want to be able to tweak the styling of individual parts of the left or right cell, you can add a span with a class tag, like this:```php
if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_IMAGE') {
echo '<span class="allListingImage">' . $display_products_image . '</span>'; //gjh42 2007-12-15

1 Oct 2009, 4:28 AM
#6
lauriesscraps avatar

lauriesscraps

Zen Follower

Join Date:
Sep 2009
Posts:
255
Plugin Contributions:
0

Re: All product listing - moving the description text up?

I was able to do this, so thank you very much! Is there any way to vertical align center so that the text is centered both vertically and horizontally next to the product image?

Thanks again, you rock my world!

1 Oct 2009, 5:16 PM
#7
greengreetings avatar

greengreetings

Zen Follower

Join Date:
May 2009
Location:
Virginia
Posts:
90
Plugin Contributions:
0

Re: All product listing - moving the description text up?

I tried this and it made my page display the same product all the way down the list. Why is that?

1 Oct 2009, 5:21 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: All product listing - moving the description text up?

You probably moved some bits of code that you shouldn't have. Start again and follow the example very carefully.
The output code is```php
echo '<br /><span class="allListingDesc">' . $display_products_description . '</span>';

1 Oct 2009, 5:40 PM
#9
greengreetings avatar

greengreetings

Zen Follower

Join Date:
May 2009
Location:
Virginia
Posts:
90
Plugin Contributions:
0

Re: All product listing - moving the description text up?

gjh42:

You probably moved some bits of code that you shouldn't have. Start again and follow the example very carefully.
The output code is```php
echo '<br /><span class="allListingDesc">' . $display_products_description . '</span>';


You were right.  I still have to tweak some CSS, I think, but I re-read the directions very carefully and started again.  :D
29 Oct 2009, 10:11 PM
#10
lauriesscraps avatar

lauriesscraps

Zen Follower

Join Date:
Sep 2009
Posts:
255
Plugin Contributions:
0

Re: All product listing - moving the description text up?

I have tried to do this and I am not able to get it to work. Not sure if I am doing something wrong or not. My problem is that my "All Listing" page is prfect, juts the way I want it, but now I want to do the same on the new products and featured products listing page and am not able to achieve the same thing. I achieved the results on the all listing page by altering different code, so I am not sure how to apply this technique to the other pages. Can you help?

Thanks

http://www.lauriesscraps.com/store/index.php?main_page=products_new
http://www.lauriesscraps.com/store/index.php?main_page=featured_products

The way I want it to look.....
http://www.lauriesscraps.com/store/index.php?main_page=products_all

30 Oct 2009, 7:52 AM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: All product listing - moving the description text up?

I checked the new products file, and the code is identical except for "new" instead of "all" constant and variable names. You can use the same edits, as long as you adjust for the differences in the base files. The files to edit are

/includes/templates/your_template/templates/tpl_modules_products_all_listing.php (fixing typo in filename in post #3 above)

/includes/templates/your_template/templates/tpl_modules_products_featured_listing.php

and

/includes/templates/your_template/templates/tpl_modules_products_new_listing.php

30 Oct 2009, 3:27 PM
#12
lauriesscraps avatar

lauriesscraps

Zen Follower

Join Date:
Sep 2009
Posts:
255
Plugin Contributions:
0

Re: All product listing - moving the description text up?

I am getting a different result than what is intended I think. I am not sure what is meant by comment out and what all the different colors mean. In the other thread that you had helped me on, you had me add this productListing-odd .main, .productListing-even .main {vertical-align: middle;text-align: center} to the stylesheet. Is there a way of doing this for the other 2 pages in the style sheet?

I was able to get the text to the right of the image to vertically and horizontally align center by editing the tpl_modules_products_featured_listing.php and tpl_modules_products_new_listing.php under the /public_html/store/includes/templates/my_template/templates/ file path, but just can't get that text to move from the bottom to the right.

(The farthest I got was getting the description text to go just under the image in the same width as the image).

I guess I didn't know as much as a I thought, any help would be great, thanks!

30 Oct 2009, 3:34 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: All product listing - moving the description text up?

Moving the description text requires the PHP file edit. See your other thread.

You didn't need to edit the PHP files to center the text that was already to the right of the image. That is what you use the web tools for, to find the class or id that controls it and edit the CSS to try out changes.

30 Oct 2009, 3:41 PM
#14
lauriesscraps avatar

lauriesscraps

Zen Follower

Join Date:
Sep 2009
Posts:
255
Plugin Contributions:
0

Re: All product listing - moving the description text up?

Unless I am missing it, I do not see where it explains in this thread how to move the text to below the product price, and name, to the right of the image. The question was asked, but I don't think it was explained how to. Just how to center the text. Am I missing it? Apologies in advance if I am.

30 Oct 2009, 3:44 PM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: All product listing - moving the description text up?

Add the "echo" line as shown here.
Add HTML comment marks <!-- and --> at beginning and end of the section shown.
Add PHP comment marks // wherever you don't see them in your copy of the file.```php

<?php $disp_sort_order->MoveNext(); } //add the following line echo '<br /><span class="allListingDesc">' . $display_products_description . '</span>'; //gjh42 2007-12-15 - hard-code description at bottom of right column ?>
        </td>
      </tr>
<!--<?php// if (PRODUCT_ALL_LIST_DESCRIPTION != 0) { ?>gjh42 2007-12-15 - remove description spanning below rest of product - html and php comment tags <tr class="<?php// echo ((int)($row_counter/2)==($row_counter/2)) ? 'productListing-even' : 'productListing-odd'; ?>"> <td colspan="3" valign="top" class="main"> <?php //echo $display_products_description; ?> </td> </tr> <?php// } ?> <tr> <td colspan="3"><hr /></td> </tr> --> <?php $products_all->MoveNext(); ``` The colors indicate different kinds of elements which a good file editor will automatically distinguish for you. What are you using to edit files?
30 Oct 2009, 3:54 PM
#16
gjh42 avatar

gjh42

Black Belt

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

Re: All product listing - moving the description text up?

Sorry, with one conversation going on in two threads, I forgot which was which. The original explanation is at the top of this thread.

30 Oct 2009, 4:24 PM
#17
lauriesscraps avatar

lauriesscraps

Zen Follower

Join Date:
Sep 2009
Posts:
255
Plugin Contributions:
0

Re: All product listing - moving the description text up?

Ya, sorry about that... I am not sure what I am doing wrong. I am following all directions, but when I am done, I go and look and the products have disappeared. I am missing something. Any ideas?

30 Oct 2009, 4:27 PM
#18
lauriesscraps avatar

lauriesscraps

Zen Follower

Join Date:
Sep 2009
Posts:
255
Plugin Contributions:
0

Re: All product listing - moving the description text up?

Also, the coding in red, in your examples, is that coding that needs to be deleted?

30 Oct 2009, 4:35 PM
#19
lauriesscraps avatar

lauriesscraps

Zen Follower

Join Date:
Sep 2009
Posts:
255
Plugin Contributions:
0

Re: All product listing - moving the description text up?

OK! I think I finally got it, I was deleting coding I should not be, but here is something interesting for you..... The text is larger now, and not showing 150 characters like it was when it was located below the image. Any idea why or how to change that?

30 Oct 2009, 5:44 PM
#20
gjh42 avatar

gjh42

Black Belt

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

Re: All product listing - moving the description text up?

Some products show no description text, some show a few words. I notice that your new products page has an unclosed <font tag showing in a product with no text. It is also a proprietary class name; what are you using to create the description text?

<table border="0" width="100%" cellspacing="2" cellpadding="2">
          <tr>
            <td colspan="3"><hr /></td>
          </tr>
          <tr>

            <td width="235" valign="top" class="main" align="center">
              <a href="http://www.lauriesscraps.com/store/index.php?main_page=product_info&cPath=84&products_id=260"><img src="images/LS_GoneCampingBB1.jpg" alt="Gone Camping Brag Book Page" title=" Gone Camping Brag Book Page " width="225" height="225" /></a>            </td>
            <td colspan="2" valign="middle" class="main" align="center">
              <a href="http://www.lauriesscraps.com/store/index.php?main_page=product_info&cPath=84&products_id=260"><strong>Gone Camping Brag Book Page</strong></a><br clear="all" /><br clear="all" />Price: <s>$1.29</s><br /><img src="includes/templates/template_default/images/free.gif" alt="It's Free!" title=" It's Free! " width="60" height="21" /><br clear="all" /><br clear="all" /><br /><span class="newListingDesc"><span class="Apple-style-span" style="font-family: verdana, tahoma, arial, sans-serif; font-size: 13px; "><font class="Apple-style-span"<a href="http://www.lauriesscraps.com/store/index.php?main_page=product_info&cPath=84&products_id=260"> ... view details</a></span>            </td>
          </tr>
```Look for 
<font class="Apple-style-span"<a href="http
at the far right of the line.