Post by slavib » Fri Mar 20, 2015 4:38 pm

Hello
where can I change the sorting category - last modified

New member

Posts

Joined
Wed Sep 11, 2013 4:13 am

Post by OSWorX » Fri Mar 20, 2015 5:04 pm

slavib wrote:Hello
where can I change the sorting category - last modified
Hello,

1. which OpenCart version
2. front- or backend
3. at which operation

thx

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by slavib » Fri Mar 20, 2015 6:15 pm

2.0.1.1
front
default view category list

New member

Posts

Joined
Wed Sep 11, 2013 4:13 am

Post by slavib » Tue Mar 24, 2015 6:52 am

I made this mod but it did not work
Work on first load.
But does not work in case of sort
please help

Code: Select all

<modification>
    <name>Sort Last modified</name>
	<version>1.0.0</version>
	<link>http://dreams-bg.com</link>
	<author>Computer Dreams</author>
	<code>sort_last_modified_ocmod</code>
	
	<file path="catalog/controller/product/category.php">
		<operation> 
			<search ><![CDATA[$sort = 'p.sort_order';]]></search>
			<add position="replace"><![CDATA[
			$sort = 'p.date_modified';
			]]></add>
		</operation>
		<operation> 
			<search ><![CDATA[$order = 'ASC';]]></search>
			<add position="replace"><![CDATA[
			$order = 'DESC';
			]]></add>
		</operation>
		<operation> 
			<search index="1" ><![CDATA[$data['sorts'][] = array(]]></search>
			<add position="before"><![CDATA[
			$data['sorts'][] = array(
				'text'  => $this->language->get('text_date_modified_asc'),
				'value' => 'p.date_modified-ASC',
				'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.date_modified&order=ASC' . $url)
			);
			$data['sorts'][] = array(
				'text'  => $this->language->get('text_date_modified_desc'),
				'value' => 'p.date_modified-DESC',
				'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.date_modified&order=DESC' . $url)
			);
			]]></add>
		</operation>
	</file>
	
	<file path="catalog/language/english/product/category.php">
		<operation> 
			<search ><![CDATA[$_['text_model_desc']   = 'Model (Z - A)';]]></search> 
			<add position="after"><![CDATA[
		    $_['text_date_modified_desc']= 'Newestmod > Oldestmod';
			$_['text_date_modified_asc']    = 'Oldestmod > Newestmod';
			]]></add>
		</operation>
	</file>
	
	<file path="catalog/model/catalog/product.php">
		<operation>
			<search><![CDATA['p.sort_order',]]></search>
			<add position="after"><![CDATA[
			'p.date_modified',
			]]></add>
		</operation>
		
	</file>	

</modification>



New member

Posts

Joined
Wed Sep 11, 2013 4:13 am
Who is online

Users browsing this forum: No registered users and 3 guests