order

How do I modify the Magento Order Slip to show a custom product attribute?

I need to display an additonal custom attribute from a product on the Order Slip PDF so that our distributor can find the proper product id. We have 3 different types of SKUs being used; one is our own, the other is from our supplier and another is from the manufacturer. Which part of Magento do I have to change in order to add the cust...

JavaScript - Sort an array based on another array of integers

Say I have an array: [0,3,4,2,5,1] What i want to do is sort an array such as: ["one", "two", "three", "four", "five", "six"] so that the order corresponds to the first array. This would be the output: ["one", "four", "five", "three", "six", "two"] Is there an easy way to accomplish this? ...

How do I get sum of value based on same key until some point in an array?

I have an array as following. I order that array by the value of the key "attack". Everything is ok until then, but I want to get for example only 9 of that total attack values are summed up: I want to sum up 3 of key1 (3 * 45), 4 of key3 (4 * 35) and 2 of key2 (2* 25) are automatically summed up. I would be greatly appreciated if somebo...

ordering mysql rows from derived columns?

i wanted to retrieve rows from the mysql database and order them by votes: votes_up + votes_down = votes table: posts{id, post_text, votes_up, votes_down, date} ORDER BY votes ...