Jump to content
The Lego Man

Product / Sort add-on not working as expected

Recommended Posts

I downloaded and installed the following Producs / Sort add-on from @geoffrywalton

 

http://addons.oscommerce.com/info/8311

 

It appears to be working fine on the Admin side (ie in Admin I can sort products upon allocating them a numerical value). However from the customer side (store category) the products remain listed in alphabetical order.

 

Did I misunderstand the add-on does anyone know or is there some trick I am missing?

 

My OSC version is v2.3.3. The add-on is stated as for 2.3

Share this post


Link to post
Share on other sites

Is the + sign still showing beside the Products Name heading on the customers side?

 

If so did you run BOTH SQL Queries in the instructions.

 

If you did, check the second one is still in the configuration table.


Live Phoenix 1.0.5.0 on PHP 7.3

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.7.6) here.

Share this post


Link to post
Share on other sites

Martin

 

Thanks for the reply.

 

I have no + sign nor do I remember having one beforehand.

 

I have doubled checked the SQL queries. Second one is still in the configuration table.

Share this post


Link to post
Share on other sites

Sorry, apart from checking carefully that you have performed all the code changes and uploaded the amended files then I can think of nothing else. It works perfectly on my shop.

Edited by mhsuffolk

Live Phoenix 1.0.5.0 on PHP 7.3

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.7.6) here.

Share this post


Link to post
Share on other sites

Can I ask, are you running 2.3.3 and does the visitor to your store see the products in the order you have sorted them?

 

Appreciate your help!

Share this post


Link to post
Share on other sites

2.3.3.4 and yes the customers side reflects the admin side.

 

Question, on your admin side do the products appear in alphabetican order, date added or your sort order?


Live Phoenix 1.0.5.0 on PHP 7.3

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.7.6) here.

Share this post


Link to post
Share on other sites

Yes, on the Admin side, the products display correctly as expected i.e. in the sorted order. Customer side however is in standard alphabetical order.

Share this post


Link to post
Share on other sites

The install instructions state :

 

catalog/admin/categories.php
Line 20
After
 if (tep_not_null($action)) {
   switch ($action) {
add
//sort order
  case 'beginsort':
    $sorting = true;
    break;
    tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_POST_VARS['cPath']));
  case 'setsortorder':
    for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {
	    tep_set_product_sort_order($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['sortorder'][$i]);
	  }
    $sorting = false;
    tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_POST_VARS['cPath']));
    break;
//end sort order

 

However my code already has the following modification in this area:

 

if (tep_not_null($action)) {
   // ULTIMATE Seo Urls 5 PRO by FWR Media
   // If the action will affect the cache entries
   if ( $action == 'insert' || $action == 'update' || $action == 'setflag' ) {
  tep_reset_cache_data_usu5( 'reset' );
   }
   switch ($action) {

 

 

I therefore am trying the following:

 

 if (tep_not_null($action)) {
   // ULTIMATE Seo Urls 5 PRO by FWR Media
   // If the action will affect the cache entries
   if ( $action == 'insert' || $action == 'update' || $action == 'setflag' ) {
  tep_reset_cache_data_usu5( 'reset' );
   }
   switch ($action) {
//sort order
  case 'beginsort':
    $sorting = true;
    break;
    tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_POST_VARS['cPath']));
  case 'setsortorder':
    for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {
	    tep_set_product_sort_order($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['sortorder'][$i]);
	  }
    $sorting = false;
    tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_POST_VARS['cPath']));
    break;
//end sort order

 

Could this be the problem?

Share this post


Link to post
Share on other sites

I had the same issue as Lego Man. But solved it as suggested above. You have to make sure you run both SQL queries.

 

1) ALTER TABLE products ADD products_sort_order INT( 4 ) DEFAULT '0' NOT NULL;

 

2) INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('', 'PRODUCT_LIST_SORT_ORDER', '6', '', '0', '', now());

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×