Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need to understand how the sort array is assigning numbers?


vampirehunter

Recommended Posts

Can someone help

 

im not sure how the sort array is assigning numbers

 

eg here

 

   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
					 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
					 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
					 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
					 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
					 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
					 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
					 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW,
					 'PRODUCT_LIST_BESTSELLING' => PRODUCT_LIST_BESTSELLING);

 

price is 3, quantity is 5

 

how are these assigned according to the above definitions?

 

if the array is starting at 0, then how does quantity = 5? when according to the array it should be 4?

 

 

thanks

Link to comment
Share on other sites

The array is subject to asort. Why do you insist on opening new threads to discuss the same issues as on other threads?

Note also that the array gives id according to what you have set up in the admin area for product listing (so unused ones are ZERO).

Link to comment
Share on other sites

The array is subject to asort. Why do you insist on opening new threads to discuss the same issues as on other threads?

Note also that the array gives id according to what you have set up in the admin area for product listing (so unused ones are ZERO).

 

Ok, so since i need to create a link to sort by "products_ordered" field.

 

does that mean i have to create a new configuration entry and then i can assign it from admin?

 

i didn't know the sorting was being assigned that way

Link to comment
Share on other sites

so i manually added an entry into phpmyadmin and made a new option for best selling.

 

 

	case 'PRODUCT_LIST_BESTSELLERS':
	  $select_column_list .= 'p.products_ordered, ';
	  break;

 

and added the other case switch in index and got it working

 

well at least i know now how to add sorting functions.

 

that was a mission. but finally done.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...