Short answer is no, you cannot order the objecs in a packing slip alphabetically unless you write a new function to sort the products out.
The products are not stored in a SQL statement that can be ordered, they are stored in a fixed object array like below
Code:
Array
(
[0] => Array
(
[qty] => 1
[id] => 111
[name] => TEST $120 Special $90.00 Sale -$5.00 Skip
[model] => Test120-90-5SKIP
[tax] => 0.0000
[price] => 90.0000
[onetime_charges] => 0.0000
[final_price] => 120.0000
[product_is_free] => 0
[attributes] => Array
(
[0] => Array
(
[option] => Size
[value] => X-Small
[prefix] => +
[price] => 40.0000
[product_attribute_is_free] => 0
)
)
)
[1] => Array
(
[qty] => 1
[id] => 1
[name] => Matrox G200 MMS
[model] => MG200MMS
[tax] => 0.0000
[price] => 299.9900
[onetime_charges] => 0.0000
[final_price] => 299.9900
[product_is_free] => 0
[attributes] => Array
(
[0] => Array
(
[option] => Model
[value] => Value
[prefix] => +
[price] => 0.0000
[product_attribute_is_free] => 0
)
[1] => Array
(
[option] => Memory
[value] => 4 mb
[prefix] =>
[price] => 0.0000
[product_attribute_is_free] => 0
)
)
)
[2] => Array
(
[qty] => 1
[id] => 1
[name] => Matrox G200 MMS
[model] => MG200MMS
[tax] => 0.0000
[price] => 299.9900
[onetime_charges] => 0.0000
[final_price] => 469.9900
[product_is_free] => 0
[attributes] => Array
(
[0] => Array
(
[option] => Model
[value] => Premium
[prefix] => +
[price] => 100.0000
[product_attribute_is_free] => 0
)
[1] => Array
(
[option] => Memory
[value] => 16 mb
[prefix] => +
[price] => 70.0000
[product_attribute_is_free] => 0
)
)
)
[3] => Array
(
[qty] => 1
[id] => 1
[name] => Matrox G200 MMS
[model] => MG200MMS
[tax] => 0.0000
[price] => 299.9900
[onetime_charges] => 0.0000
[final_price] => 299.9900
[product_is_free] => 0
[attributes] => Array
(
[0] => Array
(
[option] => Model
[value] => Value
[prefix] => +
[price] => 0.0000
[product_attribute_is_free] => 0
)
[1] => Array
(
[option] => Memory
[value] => 4 mb
[prefix] =>
[price] => 0.0000
[product_attribute_is_free] => 0
)
)
)
)
which is from the examples shipped with zen-cart. One would need to write a new function to take the $order->products object, put in a temp object, resort it on the name attribute and then pop it back into the code.
Bookmarks