Jump to content
Sign in to follow this  
blucollarguy

Vendor_Auto_E-mail (In_Development)

Recommended Posts

:D I was just wondering if anyone has the time to help me with finishing off a re-do of the "Manufacterers e-mail" contribution, I am a bit of a php newbie. This mod will enable us to enter all "Vendor" info and have it all available in the Admin. Top it off with the ability to link each product to a "vendor". I also want to have an extra price entry for each product, customer price and our "Vendor" price. I have borrowed some code from the old contrib "Manufacterer email", "Vendors" sql entries as well as additional entries I have already put in, and the standard "manufacterer" feature already installed in osCommerce. I already have most of this working, just a few problems left to work out see the following post for details:

 

http://forums.oscommerce.com/index.php?act=ST&f=7&t=98168

 

Or if you would like to help, you can contact me directly thru my profile. I have installed many mods to my site, and I think this is an awesome peice of work, with or without help on this, I thank all those who have worked on osCommerce.

 

*Edit* - URL

Edited by Johnson

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

I have posted a few requests for help finishing off a mod I have been working on but haven't gotten any responses. So, I am wondering if it is simply that noone is interested in this mod, or if I should handle it differently. What is it? I thought the "manufacterer_email" contrib from John Croson, from June of last year was exactly what I needed to handle my many different vendors for all my products. Of course, I needed to be able change the "manufacterers" to "vendors", but I figured that would be no big deal. LOL! I had no idea how much of the code would have to be updated. Anyway, I have it working now! It is a separate add-on to the "add/edit products" page that allows you to link each product individually to a specififc vendor. The vendors are editable through Admin. I have not fully tested the auto send e-mail function yet, but everything else has been fully tested and works except for one little thing. When you click to "edit" a vendor that has been entered, none of the info fields get filled in. So, I need some help from someone with more knowledge and experience with the coding, shouldn't be hard to do since I am quite new to this stuff. I have more plans for this mod and want to be able to offer to all as a working contribution. Any suggestions would be greatly appreciated. Future plans: Add "Vendor Price" to product pages so that one could preset a % or flat rate markup and always be able to see the actual "vendor" price is, integrate this with sales and tax accounting, get the "multi-vendor shipping" conrib to work with this mod, and many other ideas. If you would like to help in any way please let me know.

 

*Download*

Edited by Johnson

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

are you useing get to get the database info and prepare input to input data


No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites

Yes, I think so.

I assume you referring to:

 

echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_VENDORS, 'page=' . $HTTP_GET_VARS['page'] . '&vID=' . $vendors['vendors_id'] . '&action=edit') . '\'">' . "\n";

} else {

echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_VENDORS, 'page=' . $HTTP_GET_VARS['page'] . '&vID=' . $vendors['vendors_id']) . '\'">' . "\n";

 

Something like this? Is this right?


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

I have gotten most of this working and am working with a few kind folks on this through the following thread now;

 

http://forums.oscommerce.com/index.php?act=ST&f=11&t=98505


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

I notice from one of your many other posts that you have the prepare input part.

 

Could you ask a moderator to merge your threads please as this would make it much easier to work with.

 

the get part was for the edit section that you refered to as the get part would populate the fields duriing edit and would be something along this lines.

$languages = tep_get_languages();
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
if ($HTTP_GET_VARS['read'] == 'only') {
$pInfo->newsdesk_article_name = newsdesk_get_newsdesk_article_name($pInfo->newsdesk_id, $languages[$i]['id']);
$pInfo->newsdesk_article_description = newsdesk_get_newsdesk_article_description($pInfo->newsdesk_id, $languages[$i]['id']);
$pInfo->newsdesk_article_shorttext = newsdesk_get_newsdesk_article_shorttext($pInfo->newsdesk_id, $languages[$i]['id']);
$pInfo->newsdesk_article_url = newsdesk_get_newsdesk_article_url($pInfo->newsdesk_id, $languages[$i]['id']);
$pInfo->newsdesk_image_text = newsdesk_get_newsdesk_image_text($pInfo->newsdesk_id, $languages[$i]['id']);
$pInfo->newsdesk_image_text_two = newsdesk_get_newsdesk_image_text_two($pInfo->newsdesk_id, $languages[$i]['id']);
$pInfo->newsdesk_image_text_three = newsdesk_get_newsdesk_image_text_three($pInfo->newsdesk_id, $languages[$i]['id']);
} else {
$pInfo->newsdesk_article_name = tep_db_prepare_input($newsdesk_article_name[$languages[$i]['id']]);
$pInfo->newsdesk_article_description = tep_db_prepare_input($newsdesk_article_description[$languages[$i]['id']]);
$pInfo->newsdesk_article_shorttext = tep_db_prepare_input($newsdesk_article_shorttext[$languages[$i]['id']]);
$pInfo->newsdesk_article_url = tep_db_prepare_input($newsdesk_article_url[$languages[$i]['id']]);
$pInfo->newsdesk_image_text = tep_db_prepare_input($newsdesk_image_text[$languages[$i]['id']]);
$pInfo->newsdesk_image_text_two = tep_db_prepare_input($newsdesk_image_text_two[$languages[$i]['id']]);
$pInfo->newsdesk_image_text_three = tep_db_prepare_input($newsdesk_image_text_three[$languages[$i]['id']]);
}

as you can see this is from the newsdesk contribution and would only serve as a guide

Edited by 241

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P


Support The Project
Documentation/Knowledgebase/Discussions
 

Share this post


Link to post
Share on other sites

I sent the request but have not heard back. I have packaged this whole thing if you are interested, let me know, I can email it to you if you want to play with it. I will keep working with it in the meantime.


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

I put this package on my website for download. Contact me if you are interested and I can provide with a link. :D


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites
I put this package on my website for download. Contact me if you are interested and I can provide with a link. :D

Post it to our contributions as a contribution in development.

 

Thanks! :)

 

Matti

osCommerce Team Member


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites

I have posted it in the contribs, ti no. 2196, in the "other" category since I wasn't sure where else to put it. Thanks for the suggestion Matti, I am new to this and was not sure how to handle things. Let's keep this thread going with it, so we can document the things we are doing. :D


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Anyone who has tried to work with this will have realized that I missed a few things in the "install". I have updated the "install" with a new post in the contrib.

 

Fixes/Updates: 6-20-04

Forgot the links to vendors.php in catalog/admin/catalog.php

 

Add a link to the vendors.php file in your catalog/admin/includes/boxes/catalog.php file

 

//add link to vendors_email

'<a href="' . tep_href_link(FILENAME_VENDORS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_VENDORS . '</a><br>' .

I put mine right under the "manufacterers" link.

 

Missed language definition in catalog/admin/includes/languages/english/catagories.php file

 

//define vendors_email

define('TEXT_PRODUCTS_VENDORS', 'Products Vendors');


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Been working on the e-mail part. I am working from the old contrib "manufacterer_eamil" and Jon used the "orders.php " file to check order status and "manufacterer e-mail" on or off. But it looks to me that the order e-mails are being sent from "checkout_process.php". Can any one shed any light on this for me?

:huh:


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

:huh:

This is the script that I have modified in an attempt to send e-mails to the vendors. Have tested it and I get nothing, no errors, no mail, nothing. I tried to leave it in the orders.php file where the "manufacterers email" contrib had it. Can anyone tell what is wrong? :huh:

 

//vendors_email begin

 

function vendors_email($oID) {

// Get the delivery address

$delivery_address_query = tep_db_query("select distinct customers_company, customers_name, customers_street_address,

customers_postcode, customers_city from orders where orders_id='" . $oID ."'") ;

$delivery_address_list = tep_db_fetch_array($delivery_address_query) ;

 

// Get all the vendors emails to be sent to

// Must have an email address and have vendors_send_email set to 1

$vendors_email_query = tep_db_query("select distinct v.vendors_email, v.vendors_name FROM vendors, orders_products o, products p where p.vendors_id=v.vendors_id and p.products_id=o.products_id and o.orders_id='" . $oID . "' and v.vendors_send_email=1 ORDER BY v.vendors_id");

while ($vendors_email_list= tep_db_fetch_array($vendors_email_query)) {

$the_email=$vendors_email_list['vendors_email'];

$the_name=$vendors_email_list['vendors_name'];

$email_message = '<br>To: <b>' . $the_name . '</b> Email: <b>' . $the_email . '</b><br><br>

From: <b>' . STORE_NAME . '</b><br><br>Please deliver to:<br>' .

$delivery_address_list['customers_company'] .'<br>' .

$delivery_address_list['customers_name'] .'<br>' .

$delivery_address_list['customers_street_address'] .'<br>' .

$delivery_address_list['customers_postcode'] . '<br> ' .

$delivery_address_list['customers_city'] . '<br>' ;

 

 

// Get all the products for a vendor to be included in the email

$vendors_email_products_query = tep_db_query("select o.orders_id, v.vendors_id, v.vendors_name, v.vendors_email, o.products_name, o.products_model, o.products_id, o.products_price, o.products_quantity, 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_email='" . $the_email . "' order by o.products_name");

 

$email_message = $email_message .

'<table width="75%" border=1 cellspacing="0" cellpadding="0">

<tr><td>Qty:</td><td>Productname:</td><td>Productmodel:</td><td>Price:</td></tr>' ;

 

while ($vendors_email_products= tep_db_fetch_array($vendors_email_products_query)) {

$email_message = $email_message . '<tr><td>' . $vendors_email_products['products_quantity'] . '</td><td>' . $vendors_email_products['products_name'] . '</td><td>' . $vendors_email_products['products_model'] .

'</td><td>' . $vendors_email_products['products_price'] . '</td></tr>';

 

$current_products_id=$vendors_email_products['orders_products_id'];

$vendors_email_products_attributes_query = tep_db_query("select distinct opa.products_options_values from orders_products_attributes opa, orders o where opa.orders_id='" . $oID . "' and opa.orders_products_id='" .$current_products_id . "'");

while ($vendors_email_products_attributes= tep_db_fetch_array($vendors_email_products_attributes_query)) {

$email_message = $email_message . '<tr><td> </td><td colspan=3>'. $vendors_email_products_attributes['products_options_values'] .'</td></tr>';

}

$email_message = $email_message . '<br>';

}

$email_message = $email_message . '</table><br><HR><br>';

 

//send the email

tep_mail($the_name, $the_email, 'Customer order', $email_message, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS) ;

}

return true;

}

//vendors_email end


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

I've just installed this contrib, but I get no email when I test it.

 

 

I'm hoping that I WILL get this to work because my store sells CDs by unsigned bands and the reason I installed this contrib is because I'd like artists to receive emails when one of their CDs is sold.

 

 

(Each artist would obviously be a vendor)

Share this post


Link to post
Share on other sites

The e-mail part is one of the things I am working on now. The code is much more complicated than I expected it to be, but with a little help we will get it working. Keep an eye out for it to be posted.


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Yes the order emails are sent from checkout_process.php.

 

You may want to look at the Virtual Mall contribution for examples of how to do it.

 

Hth,

Matt


Always back up before making changes.

Share this post


Link to post
Share on other sites

I thought so Matt, thanks. I searched through the contribs for Virtual Mail but found nothing. Can you provide a link or more info on it? I had already begun working through checkout_process as it is but any extra guidance would be a major plus! This is still quite new to me and I am flying by the seat of my pants, maybe a little too high!

Thanks for the tip, Craig


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Okay, I have realized the reason for using "orders.php" from /admin/. Order status checking. If this file makes the call to the email function then it can be done at the time of payment confirmation. When "order_status" is updated to show "in process" the email flies off to the vendor. All that said, I think I am close, having a little sql syntax trouble calling to the "vendors" db. If any one thinks they might be able help me with this part let me know. Other than the entry fields not filling automatically when trying to "edit", it will functional once I get the sql call right. Wish me luck. :blink:

The deeper I get into this the more I think I bit off a little more than I can chew, but I WILL NOT give up! Not my sryle. Thanks to all who have tried.

 

btw-i took a bit of time to see how difficult the idea of using "vendor pricing" in the add products page and use a standard "markup" that would update all fields just like the update that takes place when you have a "tax class" selcted and I think I will release that in the my next update. Craig :unsure:


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Getting close, worked out the sql problem, will test from my email server tonight and from host if I get results at home.

Thanks for the luck, Mikey, I definitely need it! :blink:

 

btw Has any here configured "sendmail" on Fedora Core 1? I am having trouble with it and would really like to keep testing on my home box. PM me if you can help. Maybe the config file from a running server would fix me up.


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

I have posted the e-mail portion of this today. WOOOHOOOO! This turned out to be much more difficult than I thought it would be, but I got it working on my site. I have not tested the emails to see how well they are picking up "products_options" but it worked with everything else I threw at it. I hope people get some use out of it, I know I will. I still have not worked out the bug where no info populates the fields in the vendors file whe editing. It's weird but I can't figure it out. I am hoping for more help from whoever get's the chance to work with it now that it is fully functional. I have more plans for this but for now, enjoy, and let us all know what you think.

 

Thanks for the help and support, Craig. :rolleyes:


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Hi Craig.

 

Forgive me if I'm asking a stupid question, but am I right in assuming that , when an order is placed, the vendor gets emailed the ACTUAL order receipt...just like the customer does?

 

 

If so it'll be ideal for me as my site sells CDs by unsigned bands and it would be a cool way of letting artists and bands know when a CD of theirs is sold.

(Currently, I have to notify them manually.)

Share this post


Link to post
Share on other sites

:D The email the Vendor gets is a little different from the actual receipt a customer receives. The big difference would be that there is no breakdown of the price, including shipping and taxes in the vendor_email. I have no need for my vendors to know exactly what prices I am getting. Of course they can check my site, but I did not think it was necessary info for them. Set up a test product and test vendor with your own e-mail address and you can see the output. It should do what you are asking for. If you need the price included let me know and I can send you the code mod for it, it was originaly included but I removed it. The next update will describe how to change it as well. I would like to get a little help from someone with more experience working with emails so I can incorporate easier email formatting. But for now, this is all I've got. Hope you can use it! Let me know what you think after you have had the chance to test it. :D


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

ok, I'll test it later.

 

Actually, I don't mind there being no price included in the email.

All I really need is an automated way of letting bands know when they have sold one of their CDs at my site.

 

Thanks for your hard work in developping this feature. :D

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×