Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Sort Products By Code Problem Rate Topic   - - - - -

 
  • jsv
  • Junior Member
  • Members
  • Join Date: 13-Nov 07
  • 29 posts

Posted 21 March 2018 - 11:18 AM #1

Hello,

 

i have a little problem. I extended fn_get_products_sorting function in app/functions/fn.catalog.php to sort goods by product code, but after every CS-CART update i must edit fn.catalog.php again.

 

Is there any way to avoid this ? eg. add-on MyChanges ? How ?

 

 

Thanks

 

J.Svoboda | CZ

 

 

 

 

 


Jaroslav Svoboda
Czech republic / Prague

 


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18150 posts

Posted 21 March 2018 - 11:26 AM #2

Sure, there is the products_sorting hook, which can be used by My changes module.

 

1. app/addons/my_changes/init.php

<?php

if (!defined('BOOTSTRAP')) { die('Access denied'); }

fn_register_hooks(
    'products_sorting'
);

2. app/addons/my_changes/func.php

<?php

if (!defined('BOOTSTRAP')) { die('Access denied'); }

function fn_my_changes_products_sorting(&$sorting, $simple_mode)
{
    $sorting['code'] = array('description' => __('product_code'), 'default_order' => 'asc');
}

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • jsv
  • Junior Member
  • Members
  • Join Date: 13-Nov 07
  • 29 posts

Posted 21 March 2018 - 12:33 PM #3

thank you for your advice, unfortunately this solution does not work...

 

JS


Jaroslav Svoboda
Czech republic / Prague

 


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18150 posts

Posted 21 March 2018 - 01:14 PM #4

Did you clear cache? Try to delete var/cache directory manually


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • jsv
  • Junior Member
  • Members
  • Join Date: 13-Nov 07
  • 29 posts

Posted 21 March 2018 - 01:31 PM #5

cache cleaned manualy, still not function... 


Jaroslav Svoboda
Czech republic / Prague

 


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18150 posts

Posted 21 March 2018 - 01:46 PM #6

Where do you check result?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • jsv
  • Junior Member
  • Members
  • Join Date: 13-Nov 07
  • 29 posts

Posted 21 March 2018 - 01:55 PM #7

in admin ->  Settings: Appearance -> Available product list sortings - Here is not visible checkbox to select this options.

 

Created language variables sort_by_code_asc + sort_by_code_desc

 

and nothing....


Jaroslav Svoboda
Czech republic / Prague

 


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18150 posts

Posted 22 March 2018 - 05:03 AM #8

We have corrected code for init.php file. Please check

 

http://prntscr.com/iumsfy


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • jsv
  • Junior Member
  • Members
  • Join Date: 13-Nov 07
  • 29 posts

Posted 22 March 2018 - 07:29 AM #9

THANK YOU, works great.


Jaroslav Svoboda
Czech republic / Prague

 


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18150 posts

Posted 22 March 2018 - 08:45 AM #10

You are welcome!


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18150 posts

Posted 23 March 2018 - 03:42 PM #11

Hi eComLabs,

 

is this possible sort by vendor plan? for example paid members above than a free members. like GOLD / SILVER / BRONZE / FREE

 

Unfortunately more complex changes are required in this case


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.