Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Reordering products


kelvin95

Recommended Posts

Hi,

 

I am trying to reorder the products according to weight and I have had the code fixed as below. But it still doesn't working.

 

 if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
      for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
        if ($column_list[$i] == 'PRODUCT_LIST_WEIGHT') {
          $HTTP_GET_VARS['sort'] = $i+1 . 'a';
          $listing_sql .= " order by p.products_weight";
          break;
        }
      }
Any ideas?
Link to comment
Share on other sites

Is that new code you added, part of the shop you are using or from an addon? What does doesn't work mean? Does the code crash, give an error, not sort or something else? What version of oscommerce are you using?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...