Hi all knowledgeable and intellectually imbued peoples
I would like to sort the contents of my shopping cart alphabetically by name. I know how to do this by modifying the core file (/includes/classes/shopping_cart.php) as I've shown here: http://www.zen-cart.com/forum/showthread.php?t=181068
As I've just begun to look into using observers/notifiers I figured I should write it properly so as not to modify core files.
Now I'm totally stumped!!!
From the other thread, you can see that I need to do a sort on the values in array $products_array before it is returned by the get_products() method.
I am tying into NOTIFIER_CART_GET_PRODUCTS_END that is triggered just before the $shopping_cart->get_products method returns the $products_array content.
1) How can I get access to the $products_array content from within my observer class so that I can run the sort on it?
2) How can I pass the newly sorted array back into $shopping_cart->get_products so that it returns the sorted cart details back to its original calling source?
3) Or should I be approaching this completely differently?
Thanks,
Celtic



Reply With Quote
