Post by johnjj » Sat Feb 13, 2010 7:25 pm

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.

Newbie

Posts

Joined
Thu Jan 28, 2010 4:31 am

Post by Qphoria » Sat Feb 13, 2010 9:28 pm

1. EDIT: catalog/model/catalog/product.php

2. FIND:

Code: Select all

ORDER BY p.date_added DESC LIMIT " . (int)$limit);
3. REPLACE WITH:

Code: Select all

ORDER BY p.date_added ASC LIMIT " . (int)$limit);

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by johnjj » Sun Feb 14, 2010 1:30 am

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.

Newbie

Posts

Joined
Thu Jan 28, 2010 4:31 am

Post by johnjj » Mon Feb 15, 2010 3:12 am

Hi

Tried getting the values through sessions, it worked but i have to refresh the page twice, then it displays correctly.

Any idea? Please help me

Newbie

Posts

Joined
Thu Jan 28, 2010 4:31 am

Post by b0lty » Tue Feb 16, 2010 9:53 am

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...

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
				);
			}
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:

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 } ?>
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.

Newbie

Posts

Joined
Tue Feb 16, 2010 8:47 am
Who is online

Users browsing this forum: No registered users and 9 guests