Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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

Link to comment
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 shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions.

Link to comment
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 shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions.

Link to comment
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 shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions.

Link to comment
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?

Link to comment
Share on other sites

  • 1 year later...

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());

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...