Could anyone please advice on how to add Sort/Filter by date for products, front end, for the customers.
I tried searching the forums, no joy, tried extensions, nada also.
We just want to be able to add the option of sorting by date added, along with name, model & price,
I see there is reference to date_added amongst the masses of code, can this be applied to products also somehow?
Running 154.1.
Many thanks in advance.
I tried searching the forums, no joy, tried extensions, nada also.
We just want to be able to add the option of sorting by date added, along with name, model & price,
I see there is reference to date_added amongst the masses of code, can this be applied to products also somehow?
Running 154.1.
Many thanks in advance.
Skills: Ripp, copy, paste.
Edit:
http://forum.opencart.com/viewtopic.php?f=20&t=56125
Could this post apply to product.php?
Thanks.
http://forum.opencart.com/viewtopic.php?f=20&t=56125
Could this post apply to product.php?
Thanks.
Skills: Ripp, copy, paste.
For those who need the solution. I got this from another programmer. This is a VQmod file: date_added_sort_order.xml
Code: Select all
<modification>
<id>Display products by date added at frontend by default</id>
<version>1.0.0</version>
<vqmver>2.1</vqmver>
<author>everthemes.com</author>
<file name="catalog/controller/product/category.php">
<operation>
<search position="replace"><![CDATA[$sort = 'p.sort_order';]]></search>
<add><![CDATA[
$sort = 'p.date_added';
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[$order = 'ASC';]]></search>
<add><![CDATA[
$order = 'DESC';
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[p.sort_order-ASC]]></search>
<add><![CDATA[
p.date_added-DESC
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[p.sort_order&order=ASC]]></search>
<add><![CDATA[
p.date_added&order=DESC
]]></add>
</operation>
</file>
</modification>
Thanks ameliaa,
it works well.
Now the only down turn is that, if you try another sorting option like for instance price and then go back to default, it sorts everything alphabetically (that's default) but backwards- so Z-A.
Any idea to put the default option back in place? Just looks funny to have Z items first as default.
Alexandra
it works well.
Now the only down turn is that, if you try another sorting option like for instance price and then go back to default, it sorts everything alphabetically (that's default) but backwards- so Z-A.
Any idea to put the default option back in place? Just looks funny to have Z items first as default.
Alexandra
That vqmod that Ameliaa posted did the trick - however, The sorting and filtering is also used on the search page, so Add on the same file operation for catalog/controller/product/search.php
Also, if you run into any problems with the sorting not working in the front end, just remove the white-space inside the CDATA and keep it on one line.
Code: Select all
<file name="catalog/controller/product/search.php">
<operation>
<search position="replace"><![CDATA[$sort = 'p.sort_order';]]></search>
<add><![CDATA[
$sort = 'p.date_added';
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[$order = 'ASC';]]></search>
<add><![CDATA[
$order = 'DESC';
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[p.sort_order-ASC]]></search>
<add><![CDATA[p.date_added-DESC]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[p.sort_order&order=ASC]]></search>
<add><![CDATA[p.date_added&order=DESC]]></add>
</operation>
</file>
I have successfully created and installed the "date_added_sort_order.xml".
Is there a way to only have this only affect a specific category of products?
Is there a way to only have this only affect a specific category of products?
Joomla Web Site Designer at www.modernmagic.com
Guldan,
There appears to be NO support anymore. I asked in Nov 2013.
There appears to be NO support anymore. I asked in Nov 2013.
Joomla Web Site Designer at www.modernmagic.com
Hi modernmagic,
I've just created a new thread, and got a response that solve our problem
Check here:
http://forum.opencart.com/viewtopic.php?f=20&t=123925
I've just created a new thread, and got a response that solve our problem
Check here:
http://forum.opencart.com/viewtopic.php?f=20&t=123925
how to multi sort ?
example sort by date and quantity.
http://forum.opencart.com/viewtopic.php?f=20&t=145304
example sort by date and quantity.
http://forum.opencart.com/viewtopic.php?f=20&t=145304
Who is online
Users browsing this forum: No registered users and 97 guests