Forums / Templates, Stylesheets, Page Layout / How to customize 'New Products' page?

How to customize 'New Products' page?

Locked

Views: 1,371

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
9 Jul 2008, 3:55 AM
#1
miles avatar

miles

Zen Follower

Join Date:
Oct 2006
Location:
At Home
Posts:
357
Plugin Contributions:
0

How to customize 'New Products' page?

I need to customize the 'new products' page. I want the product descriptions to be placed underneath the price rather than the product image.

Which file should I edit?

- Nothing is impossible. Some things are just less likely than others. -

9 Jul 2008, 5:05 AM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: How to customize 'New Products' page?

The description is the one thing that is not customizable in admin for the New listing page. You can move it by editing
/includes/templates/your_template/templates/tpl_modules_products_new_listing.php.
Find this section:```php
if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_PRICE') {
echo $display_products_price;
}
if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_WEIGHT') {
echo $display_products_weight;
}
if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_DATE_ADDED') {
echo $display_products_date_added;
}
$disp_sort_order->MoveNext();
}
?>
</td>
</tr>

<?php if (PRODUCT_NEW_LIST_DESCRIPTION != 0) { ?>
      <tr>
        <td colspan="3" valign="top" class="main">
          <?php
            echo $display_products_description;
          ?>
        </td>
      </tr>
<?php } ?>
echo $display_products_description;
to just below this
echo $display_products_price;
adding  . '<br />' at the end.

Delete the original description section:

<?php if (PRODUCT_NEW_LIST_DESCRIPTION != 0) { ?>
          <tr>
            <td colspan="3" valign="top" class="main">
              <?php
                echo $display_products_description;
              ?>
            </td>
          </tr>
<?php } ?>
```php
                  if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_PRICE') {
                    echo $display_products_price;
                    echo $display_products_description . '<br />';
                  }
                  if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_WEIGHT') {
                    echo $display_products_weight;
                  }
                  if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_DATE_ADDED') {
                    echo $display_products_date_added;
                  }
                  $disp_sort_order->MoveNext();
                }
              ?>
            </td>
          </tr>
9 Jul 2008, 5:49 AM
#3
miles avatar

miles

Zen Follower

Join Date:
Oct 2006
Location:
At Home
Posts:
357
Plugin Contributions:
0

Re: How to customize 'New Products' page?

I have customized the tpl_modules_products_new_listing.php file but then the descriptions totally disappear.

Here's my code:

             ```php

if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_PRICE') {

                echo $display_products_price;
                echo $display_products_description . '<br />';

              }

              if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_WEIGHT') {

                echo $display_products_weight;

              }

              if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_DATE_ADDED') {

                echo $display_products_date_added;

              }

              $disp_sort_order->MoveNext();

            }

          ?>

        </td>

      </tr>


      <tr>

        <td colspan="3"><hr /></td>

      </tr>
<?php $products_new->MoveNext(); } } else { ?>
      <tr>

        <td class="main" colspan="2"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td>

      </tr>
<?php } ?> </table> ```

- Nothing is impossible. Some things are just less likely than others. -

9 Jul 2008, 6:11 AM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: How to customize 'New Products' page?

Which side do you have the price displayed on? The above will only work for the right column. To make it work for either column, add the echo line in the same place in the first group of echo statements.

9 Jul 2008, 7:03 AM
#5
miles avatar

miles

Zen Follower

Join Date:
Oct 2006
Location:
At Home
Posts:
357
Plugin Contributions:
0

Re: How to customize 'New Products' page?

The image is on the left and the name, price, weight etc are on the right side of it. The description is underneath all of them.

I have moved the 'echo $display_products_description' code as you pointed but it still missing. I'm not sure what's going on but it's not there when I move it.

- Nothing is impossible. Some things are just less likely than others. -

9 Jul 2008, 3:24 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: How to customize 'New Products' page?

That code is about as simple as you can get. If you have```php
if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_PRICE') {
echo $display_products_price;
echo $display_products_description . '<br />';
}

Maybe try doing the copied code on a fresh copy of the file, and leave the original code at the bottom. That should give the description in both locations, which may help in diagnosis.
11 Jul 2008, 10:00 AM
#7
miles avatar

miles

Zen Follower

Join Date:
Oct 2006
Location:
At Home
Posts:
357
Plugin Contributions:
0

Re: How to customize 'New Products' page?

Thanks! Somehow it works now. :wink:

Can you help me on one more thing. I want to remove the more info text under the image. There are too many MORE_INFO_TEXT in tpl_modules_products_new_listing.php file. I'm not sure which one can I remove.

- Nothing is impossible. Some things are just less likely than others. -

11 Jul 2008, 3:17 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: How to customize 'New Products' page?

Your best bet on that is to redefine the MORE_INFO_TEXT constant in the language file - you can set it to nothing ( define('MORE_INFO_TEXT'=''); ), or whatever you want it to read. Use the Developers Toolkit in admin to find the file & line number to change, and be sure to change the /your_template/ copy of the file, or make a /your_template/ copy and edit that one.

If products have attributes, you can only get a more info button, not an add to cart, so you want to be aware of that while editing. Clicking the product name or image will still get you to the info page, so that may be ok for you.

22 Jul 2008, 2:07 AM
#9
miles avatar

miles

Zen Follower

Join Date:
Oct 2006
Location:
At Home
Posts:
357
Plugin Contributions:
0

Re: How to customize 'New Products' page?

There are TWO 'more info' in new products page. I want to remove the 'more info' that is located right after the description. Not the one underneath the product image.

Actually I want it to look exactly like 'categories page'. How?

- Nothing is impossible. Some things are just less likely than others. -