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?
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?
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:and move this linePHP Code: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 Code: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>
I have customized the tpl_modules_products_new_listing.php file but then the descriptions totally disappear.
Here's my code:
PHP Code: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>
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.
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.
That code is about as simple as you can get. If you havein both groups of output, I don't know what could be preventing it from working.PHP Code: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.
Thanks! Somehow it works now.
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.
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.
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?
Last edited by miles; 22 Jul 2008 at 03:11 AM.
Can you post a link to your site?