DOSPLUS Posted September 4, 2010 Share Posted September 4, 2010 Hi,The aim is simple, trigger a URL when the virtual product download email is sent to the customer.One triggered URL per product bought (virtual only.)Once the email is triggered, I need a loop that will take each product info :1 - reference # (From back end ref number field), and; (number one is used as exemple)2 - member account email adressFor example, the script sending the download email (OrderHistory.php, i think) already contains these variables.But i need to post a URL to a specific adress INVISIBLY in order to trigger another script.Manually i would trigger the email like this in the browser adress bar:http://www.mydomain.com/a_folder/process.php?item=1&[email protected]Above URL triggers an email sent to mentionned email and containing instruction about product 1.So, i want to use ;$product_reference_number = 1 ;$curstomer_email = [[email protected]] ;And loop it to trigger an email for every product bought (Virtual only)So when the loop executes, i would have the URL posted.loop1 /// http://www.mydomain.com/folded/process.php?item=1&[email protected]loop 2 /// http://www.mydomain.com/folded/process.php?item=2&[email protected]Basically, these URL trigger another script!I need this asap...Any takers! Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 14, 2010 Share Posted September 14, 2010 How did you resolve this? Link to comment Share on other sites More sharing options...
DOSPLUS Posted September 14, 2010 Author Share Posted September 14, 2010 I added my script lines inside class/OrderHistory.php file after line 151. $assign[$key]['downloadable'] = $product_download->nb_downloadable; Does this help? Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 14, 2010 Share Posted September 14, 2010 I don't see how because it doesn't create a new email or run any link.It is going to be a little more complicated than that, I'm afraid.Take it from me. I am doing dynamically generated reports and only do them when I get the correct response from the payment processor.If you need more info, let me know. Link to comment Share on other sites More sharing options...
DOSPLUS Posted September 14, 2010 Author Share Posted September 14, 2010 The script i have added at line 152 does the required work. Send the links where it needs to and the process.php file does the email handling for me.So the URL is submitted only if a token exist from the payment processor. Link to comment Share on other sites More sharing options...
DOSPLUS Posted September 14, 2010 Author Share Posted September 14, 2010 The script added is: // Start $su_query = "select reference from ps_product where id_product = ". $virtualProduct['product_id']; $su_result = mysql_query($su_query); $su_res = mysql_fetch_object($su_result); $su_reference = $su_res->reference; $su_email = $result['email']; $URL="www.mydomain.com/my_script_folder/processfile.php"; $URL_tail = "?item=".$su_reference."&mail;=".$su_email ; $su_url = "http://". $URL. $URL_tail; echo $su_url; //$test = file($su_url); //print_r($test); // End Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 15, 2010 Share Posted September 15, 2010 To be more in line with PS code, why not change these lines: $su_query = "select reference from ps_product where id_product = ". $virtualProduct['product_id']; $su_result = mysql_query($su_query); $su_res = mysql_fetch_object($su_result); $su_reference = $su_res->reference; to this: $su_query = 'SELECT reference FROM `'._DB_PREFIX_.'product` WHERE `id_product`='.$virtualProduct['product_id']; $su_reference = Db::getInstance()->getValue($su_query); Link to comment Share on other sites More sharing options...
DOSPLUS Posted September 15, 2010 Author Share Posted September 15, 2010 yes that would be ok too, will try that Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now