How do I create e-products, and store order id+uid in my own tables in case of successful purchase via PayPal
OK, solved it with Conditional Actions!


I created a new product class on /admin/store/products/classes site. Let's call it "My Stuff" (class id: my_stuff).
The previous step created a new content type with the "My Stuff" name. So I went to "Create content > My Stuff" (/node/add/my-stuff).
I left "Product and its derivatives are shippable." UNCHECKED (as I didn't to be shipped). Gave it an own SKU, sell price, description, uploaded an image, etc. as usual. OK, product created.
Went to "Conditional actions" (/admin/store/ca ; don't forget to enable this module), "Add a predicate" (/admin/store/ca/add).
Gave it a title, set "Customer completes checkout" trigger, gave a description, set my own class, set status to Enabled, pushed "Save predicate" button.
Under "Conditions" tab, selected "Check an order's products", pushed "Add condition" button.
Under "Product models:", I selected the SKU given in step 3.
Clicked on "Actions" tab. Selected "Execute custom PHP code", pushed "Add action" button. 
Here I could "play" with the $order and $account variables in my custom code, and this was the key. This way I could loop through $order-&gt;products array (with for or foreach), reach the customer's user id via $order-&gt;uid (or $account-&gt;uid), read quantities (in the loop, with e.g. $order-&gt;products[$product_index]-&gt;qty, where $product_index is the actual index of the loop steps) and save them in my own database tables with db_query() function. Everything needed could now be saved in my own tables where they could be handled the appropriate way, so everything works fine now. I'm happy.