Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

CageHound

Archived
  • Posts

    6
  • Joined

  • Last visited

Everything posted by CageHound

  1. That would be great! I can just hard code the vendor ID that uses this method and if other vendors decide to go this route I'll just keep adding "IFs" lol. Thanks Craig!
  2. Hello, I have a vendor that wants me to make a simple HTTP post to their site about the order details. I'm not very good with PHP, and this does seem simple since all the info that needs to be posted is in the //Vendors Email block. Since this is only for a single vendor, would it be some type of ELSE statement IF vendor ID = X ? Below is the example of the post I would be trying to make for 2 different products from the same vendor. http://www.somewhere.com/cgi-bin/store.cgi?order_number=001;product_codes=MODELNUMBER01,MODELNUMBER02;p_name=CUSTOMERNAME;p _email=CUSTOMEREMAIL Here is the code that I currently have in ORDERS.PHP. Craig any help you can provide is greatly apprieciatated. Once this is all setup and working like a charm, I won't forget about that donate button on your site ;) //vendors email begin function vendors_email($oID) { //Get the delivery address $delivery_address_query = tep_db_query("select distinct delivery_company, delivery_name, delivery_street_address, delivery_city, delivery_state, delivery_postcode from orders where orders_id='" . $oID ."'"); $delivery_address_list = tep_db_fetch_array($delivery_address_query); //Get Customer Details for this order $customers_info_query = tep_db_query("select distinct customers_name, customers_email_address from orders where orders_id='" . $oID ."'"); $customers_info = tep_db_fetch_array($customers_info_query); //find out what shipping methods the customer chose $shipping_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id='" . $oID . "' and class = 'ot_shipping'"); $shipping_method = tep_db_fetch_array($shipping_method_query); //vendors email query $vendors_email_query = tep_db_query("select distinct o.orders_id, v.vendors_id, v.vendors_name, v.vendors_email, v.vendors_contact, v.vendor_add_info, v.vendor_street, v.vendor_city, v.vendor_state, v.vendors_zipcode, v.vendor_country, v.account_number, o.products_id, o.orders_products_id FROM vendors v, orders_products o, products p where p.vendors_id=v.vendors_id and o.products_id=p.products_id and o.orders_id='" . $oID . "' and v.vendors_send_email=1 GROUP BY vendors_id"); while ($vendors_email_list= tep_db_fetch_array($vendors_email_query)) { $order_number='" . $oID . "'; $the_email=$vendors_email_list['vendors_email']; $the_name=$vendors_email_list['vendors_name']; $the_contact=$vendors_email_list['vendors_contact']; $email= 'To: ' . $the_contact . "\n" . $the_name . "\n" . $the_email . "\n" . $vendors_email_list['vendor_street'] . "\n" . $vendors_email_list['vendor_city'] .' ' . $vendors_email_list['vendor_state'] .' ' . $vendors_email_list['vendors_zipcode'] . "\n" . $vendors_email_list['vendor_country'] . "\n" . "\n" . EMAIL_SEPARATOR . "\n" . 'Special Comments or Instructions: ' . $vendors_email_list['vendor_add_info'] . "\n" . EMAIL_SEPARATOR . "\n" . "\n" . 'From: ' . STORE_OWNER . "\n" . STORE_NAME_ADDRESS . "\n" . 'Account #: ' . $vendors_email_list['account_number'] . "\n" . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . 'FSADDONS00' . $oID . "\n" . EMAIL_SEPARATOR . "\n" . "\n" . 'Shipping Method (If Applicable): ' . $shipping_method['title'] . "\n" . "\n" . 'Dropship deliver to (If Applicable): ' . "\n" . $delivery_address_list['delivery_company'] . "\n" . $delivery_address_list['delivery_name'] . "\n" . $delivery_address_list['delivery_street_address'] . "\n" . $delivery_address_list['delivery_city'] . ' ' . $delivery_address_list['delivery_state'] . ' ' . $delivery_address_list['delivery_postcode'] . "\n" . "\n"; //Get all the products to be included in the email $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id, p.vendors_prod_comments, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id, c.customers_name, c.customers_email_address FROM vendors v, orders_products o, products p, orders c where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' and c.customers_name='" . $customers_info['customers_name'] . "' and c.customers_email_address='" . $customers_info['customers_email_address'] . "' order by o.products_name"); $email = $email . "\n"; while ($vendors_email_products= tep_db_fetch_array($vendors_email_products_query)) { $product_attribs =''; $vendors_email_products_attrib_query = tep_db_query("SELECT products_options, products_options_values FROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " WHERE 1 AND orders_products_id = '" . $vendors_email_products['orders_products_id'] . "'"); while ($vendors_email_products_attribs = tep_db_fetch_array($vendors_email_products_attrib_query)) { $product_attribs .= $vendors_email_products_attribs['products_options'] . ': ' . $vendors_email_products_attribs['products_options_values'] . "\n"; } $email = $email . 'ITEMS ORDERED:' . "\n" . "\n" . EMAIL_SEPARATOR . "\n" . 'Order Number: ' . 'FSADDONS00' . $oID . "\n" . 'Qty: ' . $vendors_email_products['products_quantity'] . "\n" . 'Product Name: ' . $vendors_email_products['products_name'] . "\n" . 'Product Attributes: ' . $product_attribs . "\n" . 'Product ID: ' . $vendors_email_products['vendors_prod_id'] . "\n" . 'Product Model: ' . $vendors_email_products['products_model'] . "\n" . 'Payout Due: $' . $vendors_email_products['vendors_product_price'] . "\n" . 'Customers Name: ' . $vendors_email_products['customers_name'] . "\n" . 'Customers Email: ' . $vendors_email_products['customers_email_address'] . "\n" . "\n" . 'Product Comments: ' . $vendors_email_products['vendors_prod_comments'] . "\n" . EMAIL_SEPARATOR . "\n"; } $email = $email . ''; tep_mail($the_name, $the_email, EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID , $email . '<br>', STORE_NAME, STORE_OWNER_EMAIL_ADDRESS); } return true; } //vendors_email end, but there is more to do, keep looking //customer_email begin function customers_email($oID) { //Get the delivery address $delivery_address_query = tep_db_query("select distinct delivery_company, delivery_name, delivery_street_address, delivery_city, delivery_state, delivery_postcode from orders where orders_id='" . $oID ."'"); $delivery_address_list = tep_db_fetch_array($delivery_address_query); //Get Customer Details for this order $customers_info_query = tep_db_query("select distinct customers_name, customers_email_address from orders where orders_id='" . $oID ."'"); $customers_info = tep_db_fetch_array($customers_info_query); //find out what shipping methods the customer chose $shipping_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id='" . $oID . "' and class = 'ot_shipping'"); $shipping_method = tep_db_fetch_array($shipping_method_query); //vendors email query $vendors_email_query = tep_db_query("select distinct o.orders_id, v.vendors_id, v.vendors_name, v.vendors_email, v.vendors_contact, v.vendor_add_info, v.vendor_street, v.vendor_city, v.vendor_state, v.vendors_zipcode, v.vendor_country, v.account_number, o.products_id, o.orders_products_id FROM vendors v, orders_products o, products p where p.vendors_id=v.vendors_id and o.products_id=p.products_id and o.orders_id='" . $oID . "' and v.vendors_send_email=1 GROUP BY vendors_id"); while ($vendors_email_list= tep_db_fetch_array($vendors_email_query)) { $order_number='" . $oID . "'; $the_email=$customers_info['customers_email_address']; $the_name=$customers_info['customers_name']; $email= 'Hello ' . $the_name . '!' . "\n" . "\n" . "Thank you for ordering from FSAddOns.com! Below you will find important information about your purchase, please read carefully and if you have any questions don't hesitate to email us by replying to this message." . "\n" . "\n" . "If you have ordered a Downloadable Product, Instructions for registering that product with the Author are below. Not all products purchased require a registration key to be activated or installed. If your product does not, this info will also be noted below." . "\n" . "\n" . "If you have ordered a Product which requires shipping, we ship within 24 hours Monday thru Friday, and will provide tracking number information after your product has been shipped by the chosen method during purchase." . "\n" . "\n" . "Thank You for Visiting http://www.fsaddons.com!" . "\n" . "\n" . "-FSAddOns Staff" ."\n" . "\n" . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . 'FSADDONS00' . $oID . "\n" . EMAIL_SEPARATOR . "\n" . "\n" . 'Shipping Method (If Applicable):' . "\n" . $shipping_method['title'] . "\n" . "\n" . 'Deliver To (If Applicable):' . $delivery_address_list['delivery_company'] . "\n" . $delivery_address_list['delivery_name'] . "\n" . $delivery_address_list['delivery_street_address'] . "\n" . $delivery_address_list['delivery_city'] . ' ' . $delivery_address_list['delivery_state'] . ' ' . $delivery_address_list['delivery_postcode'] . "\n" . "\n"; //Get all the products to be included in the email $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id, p.vendors_prod_customer, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id, c.customers_name, c.customers_email_address FROM vendors v, orders_products o, products p, orders c where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' and c.customers_name='" . $customers_info['customers_name'] . "' and c.customers_email_address='" . $customers_info['customers_email_address'] . "' order by o.products_name"); while ($vendors_email_products= tep_db_fetch_array($vendors_email_products_query)) { $email = $email . "\n" . EMAIL_SEPARATOR . "\n" . "\n" . 'Quantity: ' . $vendors_email_products['products_quantity'] . "\n" . "\n" . 'Product: ' . $vendors_email_products['products_name'] . "\n" . "\n" . 'Registration Instructions (If Applicable): ' . $vendors_email_products['vendors_prod_customer'] . "\n" . "\n" . "\n" . EMAIL_SEPARATOR . "\n"; $vendors_email_products_attributes_query = tep_db_query("select distinct p.vendors_id, opa.products_options_values from orders_products_attributes opa, orders o, products p where opa.orders_id='" . $oID . "' and opa.orders_products_id='" . $current_products_id . "' and p.vendors_id='" . $vendors_email_products['vendors_id']. "' GROUP BY vendors_id"); while ($vendors_email_products_attributes= tep_db_fetch_array($vendors_email_products_attributes_query)) { $email_message = $email_message . ' ' . $vendors_email_products_attributes['products_options_values'] .' '; } } $email = $email . ''; //send the email tep_mail($the_name, $the_email, EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID , $email . ' ', STORE_NAME, STORE_OWNER_EMAIL_ADDRESS); } return true; } //customer_email end
  3. Hi Craig, No Problem on the reply delay! I totally understand how it is to be busy, believe me. Thanks for the tips in the right direction, after many hours of Trial and Error I finally have it all worked out the way I need for sending customers and vendors emails at the same time. In /admin/orders.php I created another Function that duplicated this one //vendors email begin function vendors_email($oID) New function is named //vendors email begin function customers_email($oID) Then I poked around in the categories.php page and duplicated the Vendors Info Text box, and added a new field to the database. So now when somone orders a download and the "status" is updated, it will send them "notes" or "instructions" on how to activate the software with the vendor, or the time to wait for the vendor to send the KEY to them. Its worked out quite nicely with your mod. Great Job! Q: I now only have one problem with PayPal, and I've read posts about this just a few steps back. When PayPal returns the order, the status is updated to "2" but the emails won't go out. Is there a work around for this without having to manually go in and change the status from 2 to 1 and back to 2 again? I appreciate the response! Thanks.
  4. Hello, I figured out my own question, here it is below for others info. FIND: $delivery_address_list = tep_db_fetch_array($delivery_address_query); AFTER ADD: //Get Customer Details for this order $customers_info_query = tep_db_query("select distinct customers_name, customers_email_address from orders where orders_id='" . $oID ."'"); $customers_info = tep_db_fetch_array($customers_info_query); FIND: // Get all the products to be included in the email $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id, p.vendors_prod_comments, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id FROM vendors v, orders_products o, products p where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' order by o.products_name"); REPLACE WITH: //Get all the products to be included in the email $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id, p.vendors_prod_comments, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id, c.customers_name, c.customers_email_address FROM vendors v, orders_products o, products p, orders c where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' and c.customers_name='" . $customers_info['customers_name'] . "' and c.customers_email_address='" . $customers_info['customers_email_address'] . "' order by o.products_name"); The above is based on the most resent release near the date of this post.
  5. Hello Craig, Nice job on the mod, its working as well as it can using paypal. Quick question and I'm sure this is an easier one than what I have read in this entire thread :) Q1: I would like to add the "Customers" First Name, Last Name and Email Address to VAE sent out. We are selling software, and the information in the email will be parsed by the software company and entered into their database. So when the customer follows the instructions in the email, all the info will be present and they can obtain the KEY to unlock and install. Q2: Is there a mod out there that will allow me to send per product instructions? Best Regards, Robert
  6. Yep, she said "Oh yea with the OS module you don't need to test". And bam it worked.
×
×
  • Create New...