NSP GK4 Virtuemart product sort by order field or product_id or SKU

Free responsive Joomla 2.5 and 3.x module to present your content with easy and intuitive way.
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Thu Aug 18, 2011 8:01 am
Hi,

I want to share my small modification of NSP GK4 module for user that use NSP GK4 together with Virtuemart. This modification add options to sort Virtuemart products by order field or by product_id or by product_sku.

In file modulesmod_news_pro_gk4gk_classesgk.source.vm.php find this code:
Code: Select all
else $sort_value = 'product_id';
$order_options = ' content.'.$sort_value.' '.$config['news_sort_order'].' ';

replace with this code:
Code: Select all
else if($config['news_sort_value'] == 'product_sku') $sort_value = 'product_sku';
else $sort_value = 'product_id';
if ($config['news_sort_value'] == 'ordering') {
   $order_options = ' category_xref.product_list'.' '.$config['news_sort_order'].' ';
   } else {
   $order_options = ' content.'.$sort_value.' '.$config['news_sort_order'].' '; }


In file modulesmod_news_pro_gk4mod_news_pro_gk4.xml, right after <option value="hits">HITS</option> insert this code:
Code: Select all
<option value="product_id">PRODUCT_ID</option>
<option value="product_sku">PRODUCT_SKU</option>


Last, in file languageen-GBen-GB.mod_news_pro_gk4.ini, right after HITS=By hits amount, insert this:

PRODUCT_ID=By product id
PRODUCT_SKU=By product SKU
User avatar
Fresh Boarder

GK User
Fri Sep 20, 2013 1:27 pm
Would be good if somebody shows such modification for the VM2 and NSP 3.3.8
User avatar
Fresh Boarder

teitbite
Sat Sep 21, 2013 4:26 pm
Hi

@ataman79 I think this solution is exactly for this version :) Please just try it.

@ZDJL505 thank You for shearing.
User avatar
Moderator

GK User
Mon Sep 23, 2013 9:33 am
teitbite wrote:Hi

@ataman79 I think this solution is exactly for this version :) Please just try it.

@ZDJL505 thank You for shearing.



Hello teitbite,

Yes I tried but actually the file gk.source.vm.php, is much different than the source code from ZDJL505
For ex. in current version there is no code such as :

Code: Select all
else $sort_value = 'product_id';
$order_options = ' content.'.$sort_value.' '.$config['news_sort_order'].' ';


I mean we have no only 'product_id'

That's why I stucked'.If someone can give a help will be good

Thanks in advance
User avatar
Fresh Boarder

teitbite
Fri Sep 27, 2013 4:07 pm
Hi

Ok. I can see that You have a separated thread for this question: https://www.gavick.com/forums/news-show ... 25913.html so lets stick with that thread. I'm closing this one.
User avatar
Moderator


cron