Definire variabile cod afiliere in Prestashop

Stiu ca acesta este un forum in lb. romana dar voi copia mai jos postarea originala a problemei de pe forumul Prestashop in speranta ca vom gasi o solutie PUBLICA (aka Open Sourced) care sa ajute si pe altii care ajung sa se loveasca de ea.

Long story short, I have to implement an affiliate tracking code on the Order Confirmation page.
The issue is that I suck at PHP and I think I messed up functions in OrderConfirmationController.php

Code template from developers is as follows (I have used codeshare for the codes because the editor blocks this cetrain tag:
http://www.codeshare.io/ZTiOK

WHERE:

[advertiser_code] - this one I have it from them so it’s okay
[encrypted_params] - here will be the end result of the encryption (AES-256-ECB) of a string of parameters

My difficulties are for now with the parameters string that have to get pulled into the URL to be encrypted:

external_reference=[ext_reference]&product_code[]=[code]&product_price[]=[price]&product_name[]=[name]&product_link[]=[link]&product_category[]=[cat_code]&product_category_name[]=[cat_name]&product_part_no[]=[part_no]&product_brand[]=[brand_name]&product_brand_code[]=[brand_code]&product_qty[]=[qty]

So, as you can see, there are 11 different parameters required. Following another thread, solved by Vekia, for another affiliate code, I started form there with a few variables and added bits and pieces from different threads here.

My bet is I messed things up in the OrderConfirmationController.php

Here’s the piece of the php file:
http://www.codeshare.io/u5Gas

And here’s the crappy html code from the .tpl file:
http://www.codeshare.io/FKADz

It all breaks down to basic PHP defining of certain usual variables regarding products, categories and order, but I fail at them :frowning:

Please help? :frowning:

Ăsta e gol: http://www.codeshare.io/ZTiOK