Q:

How to change a given attribute a product is sold? (When the order is completed)

I need to change one attribute when a product is sold, when the order is completed, I guess I can hook something/somewhere but I've no idea where/what.
thank you.

A:

If your question is asked "the magento way", when you say "order is completed", this means that its status is "complete". An order with "complete" status has been ordered on the frontend site, then invoiced and shipped from the admin.
My answer is based on this terminology, thus giving you clues to change a product attribute once an order has been completed (again, in the magento way).
Coding the whole thing for you is not good help and is very long, so here is the path (in my opinion) :)

Create a module
(Google is your friend for that)
Attach an observer to this module and make it observe the event "sales_order_save_after"
(Google is your friend for that)
In the observer file / method, retrieve the order and its status
        $order = $observer->getEvent()->getOrder();
        $orderStatus = $order->getStatus();

If order status is "completed", create a foreach that updates the attribute you want for all items

This will give the same attribute value to all products. In this example, all products for a completed order will be renamed to 'Sold Product'.
            if ($orderStatus == 'complete') {
                $items = $order->getAllItems();
                foreach ($items as $item) {
                    $productsToUpdate[] = $item->getProductId();
                }
                $theAttributeToUpdate = 'name';
                $theAttributeValue = 'Sold Product';
                Mage::getSingleton('catalog/product_action')->updateAttributes($productsToUpdate, array($theAttributeToUpdate => $theAttributeValue), 0);
            }

This should be enough to put you on the right track.

