I want to show the newely added products at the back, not in the front. How can i do it.
Also i want to show the view '50' '100' option in the category page.
Please help me.
Thank you.
1. EDIT: catalog/model/catalog/product.php
2. FIND:
3. REPLACE WITH:
2. FIND:
Code: Select all
ORDER BY p.date_added DESC LIMIT " . (int)$limit);
Code: Select all
ORDER BY p.date_added ASC LIMIT " . (int)$limit);
Hello.
Thanks a lot for your help. Please also help me add a sort view by "50" & "100" option in the category page. I tried modifying the module I found which displays all the product didn't work out
Thanks a lot. Appreciate your support a lot.
Thanks a lot for your help. Please also help me add a sort view by "50" & "100" option in the category page. I tried modifying the module I found which displays all the product didn't work out

Thanks a lot. Appreciate your support a lot.
Interesting. I'm after the same thing with the options. Need to display them on the category page.
I figure you need to update category.php within the controller/product directory as well as category.tpl in the within the template/product directory.
If you look at the product.php within controller you'll see it has these lines...
I guess this is defining how the options data will be stored for the category page (???). So this somehow needs to go within the category.php file within the controller directory but my coding abilities are not enoguh to figure how you'd do it correctly.
Once that's been done I'm guessing you'd then need to add something like this (as taken from product.tpl) to the template/product/category.tpl:
Like I say, I don't really know what I'm doing beyond this, so if someone can help it'd be really really appreciated.
I figure you need to update category.php within the controller/product directory as well as category.tpl in the within the template/product directory.
If you look at the product.php within controller you'll see it has these lines...
Code: Select all
$this->data['options'] = array();
$options = $this->model_catalog_product->getProductOptions($this->request->get['product_id']);
foreach ($options as $option) {
$option_value_data = array();
foreach ($option['option_value'] as $option_value) {
$option_value_data[] = array(
'option_value_id' => $option_value['product_option_value_id'],
'name' => $option_value['name'],
'price' => (float)$option_value['price'] ? $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))) : FALSE,
'prefix' => $option_value['prefix']
);
}
$this->data['options'][] = array(
'option_id' => $option['product_option_id'],
'name' => $option['name'],
'option_value' => $option_value_data
);
}
Once that's been done I'm guessing you'd then need to add something like this (as taken from product.tpl) to the template/product/category.tpl:
Code: Select all
<?php if ($options) { ?>
<b><?php echo $text_options; ?></b><br />
<div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-top: 2px; margin-bottom: 15px;">
<table style="width: 100%;">
<?php foreach ($options as $option) { ?>
<tr>
<td><?php echo $option['name']; ?>:
<select name="option[<?php echo $option['option_id']; ?>]">
<?php foreach ($option['option_value'] as $option_value) { ?>
<option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
<?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?>
<?php } ?>
</option>
<?php } ?>
</select></td>
</tr>
<?php } ?>
</table>
</div>
<?php } ?>
Who is online
Users browsing this forum: No registered users and 9 guests