Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

My problem comes in when I try to place an order for one of the products that has a vendor which uses this module.

When I get to checkout_shipping.php, it says:

"This is currently the only shipping method available to use on this order."

and it doesn't list any shipping methods.

If I click "continue", it just takes me back to the same page.

<snip>

Regards,

-Lori-

This seems to indicate that your shipping module is not being seen at all, or it is not returning any useful output. I would suggest a few debugging statements in the quote method of your module. Follow the data through from the beginning. Either it is not retrieving anything from the database or the data is getting lost before it is returned. Once this method is returning data you should be able to track down any residual bugs.

 

The 'action' POST variable causes that code to be executed on the second pass through this page, after the customer has clicked the Continue button. If you need to debug in this area, temporarily comment out the redirects in that section, or log your debug messages to a text file or to an email.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
This seems to indicate that your shipping module is not being seen at all, or it is not returning any useful output. I would suggest a few debugging statements in the quote method of your module. Follow the data through from the beginning. Either it is not retrieving anything from the database or the data is getting lost before it is returned. Once this method is returning data you should be able to track down any residual bugs.

 

The 'action' POST variable causes that code to be executed on the second pass through this page, after the customer has clicked the Continue button. If you need to debug in this area, temporarily comment out the redirects in that section, or log your debug messages to a text file or to an email.

 

Regards

Jim

Jim,

Thanks for the info!

I put some debugging statements in the quote method of my module, and it seems that this method is not even getting called. I did a little tracing in includes/classes/vendor_shipping.php. Where it does:

foreach ($modules_array as $module_name) {

it is finding my module: pips2.php.

And, in the quote method in vendor_shipping.php, where it does

foreach ($this->modules[$vendors_id] as $value) {

it is finding pips2.php as $value.

And for

$class = substr($value, 0, strrpos($value, '.'));

it is finding pips2 as $class.

 

Any suggestions on how to track down why the quote method of my module is not getting called?

 

Thanks very much for the help!

Regards,

-Lori-

Share this post


Link to post
Share on other sites
Jim,

Thanks for the info!

I put some debugging statements in the quote method of my module, and it seems that this method is not even getting called. I did a little tracing in includes/classes/vendor_shipping.php. Where it does:

foreach ($modules_array as $module_name) {

it is finding my module: pips2.php.

And, in the quote method in vendor_shipping.php, where it does

foreach ($this->modules[$vendors_id] as $value) {

it is finding pips2.php as $value.

And for

$class = substr($value, 0, strrpos($value, '.'));

it is finding pips2 as $class.

 

Any suggestions on how to track down why the quote method of my module is not getting called?

 

Thanks very much for the help!

Regards,

-Lori-

I would put in a print_r($quotes_array); at line 118 in that file (Just before the return statement for the quote method. I suspect that you'll find that your module is not returning a quote. If so, you need to go back to your module and trace the data there.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I am thinking of installing Fast Easy Checkout -

 

MVS is currently loaded (been for a few months) and working fine.

 

Will there be a conflict ???


26 contributions installed - - And counting ....

 

Just want to take this time to extend my appreciation to everyone who have patiently answered my questions over the months of working on my site. I hope to be able to "pass it forward" and help new folks.

Share this post


Link to post
Share on other sites
I am thinking of installing Fast Easy Checkout -

 

MVS is currently loaded (been for a few months) and working fine.

 

Will there be a conflict ???

FEC can be merged with MVS, but it can be tricky, you will need to take a good look at all the files to work out which ones need what parts of the code. FEC can be tricky to work with so be careful.

 

I have done this on several sites so I guarantee it can work. I have not worked with the latest version of FEC though.

 

Good luck, 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

So, another words - it's out of my field of expertise.... I still don't have a good grasp of php to understand the commands and such.

 

Dang. THanks anyhow.


26 contributions installed - - And counting ....

 

Just want to take this time to extend my appreciation to everyone who have patiently answered my questions over the months of working on my site. I hope to be able to "pass it forward" and help new folks.

Share this post


Link to post
Share on other sites
I would put in a print_r($quotes_array); at line 118 in that file (Just before the return statement for the quote method. I suspect that you'll find that your module is not returning a quote. If so, you need to go back to your module and trace the data there.

 

Regards

Jim

Jim and Craig,

I put a bunch more debugging statements (echo and print_r) into the quote module of the shipping class in vendors_shipping.php. Basically, it's saying that the class is not enabled for this vendor. And, the quotes method for my module is not getting executed. Here is the output of the debugging statements from within the quotes method in the shipping class in vendors_shipping.php--I hope this is clear:

------------------

vendor_shipping, entering quote with these args: method: ; module: ; vendors_id: 1

Printing the array, this->modules[vendors_id]:

Array ( [0] => pips2.php )

vendor_shipping, quote, class = pips2

vendor_shipping, quote, class is NOT enabled for this vendor

Printing the array, include_quotes:

Array ( )

Printing the array, quotes_array:

Array ( )

------------------

 

Is the problem that the class/module is not enabled for this vendor? I did enable the module, and pips2.php is in the array $this->modules[1].

Any help would be greatly appreciated!

Thanks very much.

Regards,

-Lori-

Share this post


Link to post
Share on other sites
Is the problem that the class/module is not enabled for this vendor? I did enable the module, and pips2.php is in the array $this->modules[1].

Any help would be greatly appreciated!

Thanks very much.

Regards,

-Lori-

I managed to track down the problem.

I had started with the code from the pips module.

In the install method, it was inserting into the configuration table, for MODULE_SHIPPING_PIPS_STATUS, a value of 1. I looked at the flat.php shipping module in MVS, and it was inserting a value of 'True' (of course, with $vendor_id tagged onto the end of it).

The enabled method that we were instructed to write for a shipping module for MVS, checked to see if $status == 'True', so it was failing, since $status was '1'.

I changed the install method, uninstalled the module, reinstalled it, and now this part of it works!

Yea!!

Thanks for the help!

-Lori-

Share this post


Link to post
Share on other sites

Hi guys!

 

I have integrated M-S (multi-stores) with MVS if anyone is interested would like to see my files just let me know. I was thinking of posting it, but I am not that confident about offering support. I think the two together are a great setup for a dropshipper (like me) who want to proliferate and create multiple income streams. My store is also heavily modified with many contribs CCGV(Trad), PayPal IPN, and lots of others. So it would be hard for me to post a reasonably clean contribution. There are probably some bugs, but I think i have worked out any major ones.

 

Feedback is appreciated,

Stephanie

Edited by gr8sale

Share this post


Link to post
Share on other sites
Hi guys!

 

I have integrated M-S (multi-stores) with MVS if anyone is interested would like to see my files just let me know. I was thinking of posting it, but I am not that confident about offering support. I think the two together are a great setup for a dropshipper (like me) who want to proliferate and create multiple income streams. My store is also heavily modified with many contribs CCGV(Trad), PayPal IPN, and lots of others. So it would be hard for me to post a reasonably clean contribution. There are probably some bugs, but I think i have worked out any major ones.

 

Feedback is appreciated,

Stephanie

 

I really don't have time do a CCGV and MVS together if someone has a chance to put one together let me know


Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Share this post


Link to post
Share on other sites

Well at this time I am working on a contribution CCGV with MVS1.0 so I am hoping to have it running next week

Edited by mtechama

Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Share this post


Link to post
Share on other sites

So I am doing good install in the Admin area and all and main site I am getting an error

 

1146 - Table 'mgstest.TABLE_COUPON_GV_CUSTOMER' doesn't exist

 

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '2'

 

I have import the ccvg.sql into database and still getting this error

 

can you help Jim or Craig


Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Share this post


Link to post
Share on other sites

On my product info page, I want to display the vendors "Phone 2 #:" field.

 

I've established where to insert the code in the store/product_info.php page, but I'm now up against a brick wall, as I don't know what code to insert. I've tried various things without luck.

 

Can anyone help me with the above field insertion please? Thanks in advance for any help given :)

 

 

 

 

Why insert the "Phone 2 #:" field? Well its a field I'm not using for a phone number, so I want to use it for another task, like adding to the product page 'Free shipping from this vendor'. That way the customer donst have to work through the checkout to find the shipping cost. Yes I could add it to the description, but if I want to change it at short notice, I have to work through loads of products. So the global approach is better for me :D


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites
So I am doing good install in the Admin area and all and main site I am getting an error

 

1146 - Table 'mgstest.TABLE_COUPON_GV_CUSTOMER' doesn't exist

 

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '2'

 

I have import the ccvg.sql into database and still getting this error

 

can you help Jim or Craig

You have not defined TABLE_COUPON_GV_CUSTOMER in catalog/includes/database_tables.php. Any time that you see a database error of "table does not exist" and the error message includes a table name in all caps, starting with TABLE, this is because you have not defined it.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
On my product info page, I want to display the vendors "Phone 2 #:" field.

 

I've established where to insert the code in the store/product_info.php page, but I'm now up against a brick wall, as I don't know what code to insert. I've tried various things without luck.

 

Can anyone help me with the above field insertion please? Thanks in advance for any help given :)

Why insert the "Phone 2 #:" field? Well its a field I'm not using for a phone number, so I want to use it for another task, like adding to the product page 'Free shipping from this vendor'. That way the customer donst have to work through the checkout to find the shipping cost. Yes I could add it to the description, but if I want to change it at short notice, I have to work through loads of products. So the global approach is better for me :D

In catalog/product_info.php find the following code (line 75):

	$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);

and replace the first line with:

	$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.vendors_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

Then insert the following after those two lines:

	$vendor_query = tep_db_query("select vendors_phone1 from " . TABLE_VENDORS . " where vendors_id  = '" . (int)$product_info['vendors_id'] . "'");
$vendor = tep_db_fetch_array($product_info_query);
$free_shipping = $vendor['vendors_phone1'];

Then find the location in the HTML where you want your "Free Shipping to appear and put in:

	<?php echo $free_shipping ?>

I did something similar to this on one store. The Free Shipping is in white on a red background, right below the price. It seems to be working well.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim,

 

Thanks for your help :D

 

I've encountered a problem with this bit of code

	$vendor_query = tep_db_query("select vendors_phone1 from " . TABLE_VENDORS . " where vendors_id  = '" . (int)$product_info['vendors_id'] . "'");
$vendor = tep_db_fetch_array($product_info_query);
$free_shipping = $vendor['vendors_phone1'];

What I find, is that I can see the product in the index list (pickie, title and price), but when I click on it to view the product description, the page comes up, but without any description and pickie, the price is 0.00

 

If I comment out this line

// $vendor = tep_db_fetch_array($product_info_query);

The product description, pickie and correct price display, so is there a mistake in this line, or.....

 

Thanks

 

Steve


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites
<snip>

If I comment out this line

// $vendor = tep_db_fetch_array($product_info_query);

The product description, pickie and correct price display, so is there a mistake in this line, or.....

 

Thanks

 

Steve

Typo -- that should have been

	$vendor = tep_db_fetch_array($vendor_query);

Too early in the morning. That's my excuse and I'm sticking to it....

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
Typo -- that should have been
	$vendor = tep_db_fetch_array($vendor_query);

Too early in the morning. That's my excuse and I'm sticking to it....

 

Regards

Jim

I've made good progress :D I've now got the product descriptions, pickies and price back, but no fresh data from the vendor info..... :(

 

Not sure what to do now :'(

 

Steve


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites
I've made good progress :D I've now got the product descriptions, pickies and price back, but no fresh data from the vendor info..... :(

 

Not sure what to do now :'(

 

Steve

Debug. Is $product_info['vendors_id'] returning the vendors ID number? If it is, there's probably a typo in the part that returns the vendor info.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Craig or Jim,

 

everything works good till I hit confirm order at checkout_process.php

 

Parse error: parse error, unexpected '}' in /home/content/m/t/e/mtechamatest/html/catalog/checkout_process.php on line 390

 

here is my checkout_process.php

 

<?php

/*

$Id: checkout_process.php,v 1.2.37.2 2004/01/01 14:00:29 Strider Exp $

$Id: checkout_process.php,v 1.128 2003/07/24 18:00:29 Strider Exp $

$Id: checkout_process.php,v 1.128 2003/05/28 18:00:29 hpdl Exp $

$Id: checkout_process.php,v 1.6.2.1 2003/05/03 23:41:23 wilt Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright (c) 2003 osCommerce

 

Released under the GNU General Public License

*/

 

include('includes/application_top.php');

 

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

 

if (!tep_session_is_registered('sendto')) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

}

 

if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

}

 

// avoid hack attempts during the checkout procedure by checking the internal cartID

if (isset($cart->cartID) && tep_session_is_registered('cartID')) {

if ($cart->cartID != $cartID) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

}

}

 

include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);

 

// load selected payment module

require(DIR_WS_CLASSES . 'payment.php');

// #################### Added CCGV ######################

if ($credit_covers) $payment=''; //ICW added for CREDIT CLASS

// #################### End Added CGV ######################

$payment_modules = new payment($payment);

 

//MVS start

// load the selected shipping module

if (($total_weight > 0 ) || (SELECT_VENDOR_SHIPPING == 'true')){

include(DIR_WS_CLASSES . 'vendor_shipping.php');

} elseif (($total_weight > 0 ) || (SELECT_VENDOR_SHIPPING == 'false')){

include(DIR_WS_CLASSES . 'shipping.php');

}

$shipping_modules = new shipping($shipping);

//MVS End

 

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

 

// load the before_process function from the payment modules

$payment_modules->before_process();

 

require(DIR_WS_CLASSES . 'order_total.php');

$order_total_modules = new order_total;

 

$order_totals = $order_total_modules->process();

 

$sql_data_array = array('customers_id' => $customer_id,

'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],

'customers_company' => $order->customer['company'],

'customers_street_address' => $order->customer['street_address'],

'customers_suburb' => $order->customer['suburb'],

'customers_city' => $order->customer['city'],

'customers_postcode' => $order->customer['postcode'],

'customers_state' => $order->customer['state'],

'customers_country' => $order->customer['country']['title'],

'customers_telephone' => $order->customer['telephone'],

'customers_email_address' => $order->customer['email_address'],

'customers_address_format_id' => $order->customer['format_id'],

'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],

'delivery_company' => $order->delivery['company'],

'delivery_street_address' => $order->delivery['street_address'],

'delivery_suburb' => $order->delivery['suburb'],

'delivery_city' => $order->delivery['city'],

'delivery_postcode' => $order->delivery['postcode'],

'delivery_state' => $order->delivery['state'],

'delivery_country' => $order->delivery['country']['title'],

'delivery_address_format_id' => $order->delivery['format_id'],

'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],

'billing_company' => $order->billing['company'],

'billing_street_address' => $order->billing['street_address'],

'billing_suburb' => $order->billing['suburb'],

'billing_city' => $order->billing['city'],

'billing_postcode' => $order->billing['postcode'],

'billing_state' => $order->billing['state'],

'billing_country' => $order->billing['country']['title'],

'billing_address_format_id' => $order->billing['format_id'],

'payment_method' => $order->info['payment_method'],

'cc_type' => $order->info['cc_type'],

'cc_owner' => $order->info['cc_owner'],

'cc_number' => $order->info['cc_number'],

'cc_expires' => $order->info['cc_expires'],

'date_purchased' => 'now()',

'orders_status' => $order->info['order_status'],

'currency' => $order->info['currency'],

'currency_value' => $order->info['currency_value']);

tep_db_perform(TABLE_ORDERS, $sql_data_array);

$insert_id = tep_db_insert_id();

for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {

$sql_data_array = array('orders_id' => $insert_id,

'title' => $order_totals[$i]['title'],

'text' => $order_totals[$i]['text'],

'value' => $order_totals[$i]['value'],

'class' => $order_totals[$i]['code'],

'sort_order' => $order_totals[$i]['sort_order']);

tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);

}

 

$customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';

$sql_data_array = array('orders_id' => $insert_id,

'orders_status_id' => $order->info['order_status'],

'date_added' => 'now()',

'customer_notified' => $customer_notification,

'comments' => $order->info['comments']);

//MVS - added insert for new orders_shipping table

$shipping_array = $shipping['vendor'];

foreach ($shipping_array as $vendors_id => $shipping_data) {

$vendors_query = tep_db_query("select vendors_name

from " . TABLE_VENDORS . "

where vendors_id = '" . (int)$vendors_id . "'"

);

$vendors_name = 'Unknown';

if ($vendors = tep_db_fetch_array($vendors_query)) {

$vendors_name = $vendors['vendors_name'];

}

$shipping_method_array = explode ('_', $shipping_data['id']);

if ($shipping_method_array[0] == 'fedex1') {

$shipping_method = 'Federal Express';

} elseif ($shipping_method_array[0] == 'upsxml') {

$shipping_method = 'UPS';

} elseif ($shipping_method_array[0] == 'usps') {

$shipping_method = 'USPS';

} else {

$shipping_method = $shipping_method_array[0];

}

$sql_data_array = array('orders_id' => $insert_id,

'vendors_id' => $vendors_id,

'shipping_module' => $shipping_method,

'shipping_method' => $shipping_data['title'],

'shipping_cost' => $shipping_data['cost'],

'shipping_tax' => $shipping_data['ship_tax'],

'vendors_name' => $vendors_name,

'vendor_order_sent' => 'no'

);

tep_db_perform(TABLE_ORDERS_SHIPPING, $sql_data_array);

}

//MVS End

// initialized for the email confirmation

$products_ordered = '';

$subtotal = 0;

$total_tax = 0;

 

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

// Stock Update - Joao Correia

if (STOCK_LIMITED == 'true') {

if (DOWNLOAD_ENABLED == 'true') {

$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename

FROM " . TABLE_PRODUCTS . " p

LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa

ON p.products_id=pa.products_id

LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad

ON pa.products_attributes_id=pad.products_attributes_id

WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";

// Will work with only one option for downloadable products

// otherwise, we have to build the query dynamically with a loop

$products_attributes = $order->products[$i]['attributes'];

if (is_array($products_attributes)) {

$stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";

}

$stock_query = tep_db_query($stock_query_raw);

} else {

$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

}

if (tep_db_num_rows($stock_query) > 0) {

$stock_values = tep_db_fetch_array($stock_query);

// do not decrement quantities if products_attributes_filename exists

if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {

$stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];

} else {

$stock_left = $stock_values['products_quantity'];

}

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {

tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

}

}

}

 

// Update products_ordered (for bestsellers list)

tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

 

//MVS start - added 'vendors_id' => ...

$sql_data_array = array('orders_id' => $insert_id,

'products_id' => tep_get_prid($order->products[$i]['id']),

'products_model' => $order->products[$i]['model'],

'products_name' => $order->products[$i]['name'],

'products_price' => $order->products[$i]['price'],

'final_price' => $order->products[$i]['final_price'],

'products_tax' => $order->products[$i]['tax'],

'products_quantity' => $order->products[$i]['qty'],

'vendors_id' => $order->products[$i]['vendors_id']

); //MVS end tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

$order_products_id = tep_db_insert_id();

// #################### Added CCGV ######################

$order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM

// #################### End Added CCGV ######################

//------insert customer choosen option to order--------

$attributes_exist = '0';

$products_ordered_attributes = '';

if (isset($order->products[$i]['attributes'])) {

$attributes_exist = '1';

for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {

if (DOWNLOAD_ENABLED == 'true') {

$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename

from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa

left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad

on pa.products_attributes_id=pad.products_attributes_id

where pa.products_id = '" . $order->products[$i]['id'] . "'

and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'

and pa.options_id = popt.products_options_id

and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'

and pa.options_values_id = poval.products_options_values_id

and popt.language_id = '" . $languages_id . "'

and poval.language_id = '" . $languages_id . "'";

$attributes = tep_db_query($attributes_query);

} else {

$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");

}

$attributes_values = tep_db_fetch_array($attributes);

 

$sql_data_array = array('orders_id' => $insert_id,

'orders_products_id' => $order_products_id,

'products_options' => $attributes_values['products_options_name'],

'products_options_values' => $attributes_values['products_options_values_name'],

'options_values_price' => $attributes_values['options_values_price'],

'price_prefix' => $attributes_values['price_prefix']);

tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

 

if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {

$sql_data_array = array('orders_id' => $insert_id,

'orders_products_id' => $order_products_id,

'orders_products_filename' => $attributes_values['products_attributes_filename'],

'download_maxdays' => $attributes_values['products_attributes_maxdays'],

'download_count' => $attributes_values['products_attributes_maxcount']);

tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);

}

$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];

}

}

//------insert customer choosen option eof ----

$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);

$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];

$total_cost += $total_products_price;

 

//MVS begin

if (SELECT_VENDOR_EMAIL_OPTION == 'false') {

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";

}

}

if (SELECT_VENDOR_EMAIL_OPTION == 'true') {

$order_id = $insert_id;

require(DIR_WS_INCLUDES . 'vendor_order_data.php');

}

function vendors_email($vendors_id, $oID, $status, $vendor_order_sent) {

$vendor_order_sent = false;

$debug='no';

$vendor_order_sent = 'no';

$index2 = 0;

//let's get the Vendors

$vendor_data_query = tep_db_query("select 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, v.vendors_status_send, os.shipping_module, os.shipping_method, os.shipping_cost, os.shipping_tax, os.vendor_order_sent from " . TABLE_VENDORS . " v, " . TABLE_ORDERS_SHIPPING . " os where v.vendors_id=os.vendors_id and v.vendors_id='" . $vendors_id . "' and os.orders_id='" . (int)$oID . "' and v.vendors_status_send='" . $status . "'");

while ($vendor_order = tep_db_fetch_array($vendor_data_query)) {

$vendor_products[$index2] = array('Vid' => $vendor_order['vendors_id'],

'Vname' => $vendor_order['vendors_name'],

'Vemail' => $vendor_order['vendors_email'],

'Vcontact' => $vendor_order['vendors_contact'],

'Vaccount' => $vendor_order['account_number'],

'Vstreet' => $vendor_order['vendor_street'],

'Vcity' => $vendor_order['vendor_city'],

'Vstate' => $vendor_order['vendor_state'],

'Vzipcode' => $vendor_order['vendors_zipcode'],

'Vcountry' => $vendor_order['vendor_country'],

'Vaccount' => $vendor_order['account_number'], 'Vinstructions' => $vendor_order['vendor_add_info'],

'Vmodule' => $vendor_order['shipping_module'], 'Vmethod' => $vendor_order['shipping_method']);

if ($debug == 'yes') {

echo 'The vendor query: ' . $vendor_order['vendors_id'] . '<br>';

}

$index = 0;

$vendor_orders_products_query = tep_db_query("select o.orders_id, o.orders_products_id, o.products_model, o.products_id, o.products_quantity, o.products_name, p.vendors_id, p.vendors_prod_comments, p.vendors_prod_id, p.vendors_product_price from " . TABLE_ORDERS_PRODUCTS . " o, " . TABLE_PRODUCTS . " p where p.vendors_id='" . (int)$vendor_order['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' order by o.products_name");

while ($vendor_orders_products = tep_db_fetch_array($vendor_orders_products_query)) {

$vendor_products[$index2]['vendor_orders_products'][$index] = array(

'Pqty' => $vendor_orders_products['products_quantity'],

'Pname' => $vendor_orders_products['products_name'],

'Pmodel' => $vendor_orders_products['products_model'],

'Pprice' => $vendor_orders_products['products_price'],

'Pvendor_name' => $vendor_orders_products['vendors_name'],

'Pcomments' => $vendor_orders_products['vendors_prod_comments'],

'PVprod_id' => $vendor_orders_products['vendors_prod_id'],

'PVprod_price' => $vendor_orders_products['vendors_product_price'],

'spacer' => '-');

//MVS end

if ($debug == 'yes') {

echo 'The products query: ' . $vendor_orders_products['products_name'] . '<br>';

}

$subindex = 0;

$vendor_attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "' and orders_products_id = '" . (int)$vendor_orders_products['orders_products_id'] . "'");

if (tep_db_num_rows($vendor_attributes_query)) {

while ($vendor_attributes = tep_db_fetch_array($vendor_attributes_query)) {

$vendor_products[$index2]['vendor_orders_products'][$index]['vendor_attributes'][$subindex] = array('option' => $vendor_attributes['products_options'],

'value' => $vendor_attributes['products_options_values'],

'prefix' => $vendor_attributes['price_prefix'],

'price' => $vendor_attributes['options_values_price']);

 

$subindex++;

}

}

$index++;

}

$index2++;

// let's build the email

// 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 " . TABLE_ORDERS . " where orders_id='" . $oID ."'");

$vendor_delivery_address_list = tep_db_fetch_array($delivery_address_query);

 

if ($debug == 'yes') {

echo 'The number of vendors: ' . sizeof($vendor_products) . '<br>';

}

$email='';

for ($l=0, $m=sizeof($vendor_products); $l<$m; $l++) {

 

$vendor_country = tep_get_country_name($vendor_products[$l]['Vcountry']);

$order_number= $oID;

$vendors_id=$vendor_products[$l]['Vid'];

$the_email=$vendor_products[$l]['Vemail'];

$the_name=$vendor_products[$l]['Vname'];

$the_contact=$vendor_products[$l]['Vcontact'];

$email= '<b>To: ' . $the_contact . ' <br>' . $the_name . '<br>' . $the_email . '<br>' .

$vendor_products[$l]['Vstreet'] .'<br>' .

$vendor_products[$l]['Vcity'] .', ' .

$vendor_products[$l]['Vstate'] .' ' .

$vendor_products[$l]['Vzipcode'] . ' ' . $vendor_country . '<br>' . '<br>' . EMAIL_SEPARATOR . '<br>' . 'Special Comments or Instructions: ' . $vendor_products[$l]['Vinstructions'] .'<br>' . '<br>' . EMAIL_SEPARATOR . '<br>' . 'From: ' . STORE_OWNER . '<br>' . STORE_NAME_ADDRESS . '<br>' . 'Accnt #: ' . $vendor_products[$l]['Vaccount'] . '<br>' . EMAIL_SEPARATOR . '<br>' . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . '<br>' . EMAIL_SEPARATOR . '<br>' . '<br> Shipping Method: ' . $vendor_products[$l]['Vmodule'] . ' -- ' . $vendor_products[$l]['Vmethod'] . '<br>' . EMAIL_SEPARATOR . '<br>' . '<br>Dropship deliver to:<br>' .

$vendor_delivery_address_list['delivery_company'] .'<br>' .

$vendor_delivery_address_list['delivery_name'] .'<br>' .

$vendor_delivery_address_list['delivery_street_address'] .'<br>' .

$vendor_delivery_address_list['delivery_city'] .', ' .

$vendor_delivery_address_list['delivery_state'] . ' ' . $vendor_delivery_address_list['delivery_postcode'] . '<br><br>';

$email = $email . '<table width="75%" border=1 cellspacing="0" cellpadding="3">

<tr><td>Qty:</td><td>Product Name:</td><td>Item Code/Number:</td><td>Product Model:</td><td>Per Unit Price:</td><td>Item Comments: </td></tr>';

for ($i=0, $n=sizeof($vendor_products[$l]['vendor_orders_products']); $i<$n; $i++) {

$product_attribs ='';

if (isset($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']) && (sizeof($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']) > 0)) {

 

for ($j = 0, $k = sizeof($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']); $j < $k; $j++) {

$product_attribs .= '  ' . $vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes'][$j]['option'] . ': ' . $vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes'][$j]['value'] . '<br>';

}

}

$email = $email . '<tr><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['Pqty'] .

'</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['Pname'] . '<br>  <i>Option<br> ' . $product_attribs .

'</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_id'] .

'</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['Pmodel'] .

'</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price'] . '</td><td>' .

$vendor_products[$l]['vendor_orders_products'][$i]['Pcomments'] . '</b></td></tr>';

 

}

}

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

 

tep_mail($the_name, $the_email, EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID , $email . '<br>', STORE_NAME, STORE_OWNER_EMAIL_ADDRESS) ;

$vendor_order_sent = 'yes';

 

tep_db_query("update " . TABLE_ORDERS_SHIPPING . " set vendor_order_sent = '" . tep_db_input($vendor_order_sent) . "' where orders_id = '" . (int)$oID . "' and vendors_id = '" . (int)$vendors_id . "'");

 

if ($debug == 'yes') {

echo 'The $email(including headers:<br>Vendor Email Addy' . $the_email . '<br>Vendor Name' . $the_name . '<br>Vendor Contact' . $the_contact . '<br>Body--<br>' . $email . '<br>';

}

}

 

return true;

} //MVS end

}

// #################### Added CCGV ######################

$order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM

// #################### End Added CCGV ######################

// lets start with the email confirmation

$email_order = STORE_NAME . "\n" .

EMAIL_SEPARATOR . "\n" .

EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .

EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .

EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

if ($order->info['comments']) {

$email_order .= tep_db_output($order->info['comments']


Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Share this post


Link to post
Share on other sites
Craig or Jim,

 

everything works good till I hit confirm order at checkout_process.php

 

Parse error: parse error, unexpected '}' in /home/content/m/t/e/mtechamatest/html/catalog/checkout_process.php on line 390

<code snipped>

What the error message says -- delete the unneeded } on line 390 and it should work.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
What the error message says -- delete the unneeded } on line 390 and it should work.

 

Regards

Jim

 

 

checkout_sucess.php

 

Warning: before_process(includes/modules/payment/paypal/classes/osC/osC.class.php): failed to open stream: No such file or directory in /home/content/m/t/e/mtechamatest/html/catalog/includes/modules/payment/paypal.php on line 141

 

Warning: before_process(): Failed opening 'includes/modules/payment/paypal/classes/osC/osC.class.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/m/t/e/mtechamatest/html/catalog/includes/modules/payment/paypal.php on line 141

 

Fatal error: Undefined class name 'paypal_osc' in /home/content/m/t/e/mtechamatest/html/catalog/includes/modules/payment/paypal.php on line 142


Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

Share this post


Link to post
Share on other sites
checkout_sucess.php

 

Warning: before_process(includes/modules/payment/paypal/classes/osC/osC.class.php): failed to open stream: No such file or directory in /home/content/m/t/e/mtechamatest/html/catalog/includes/modules/payment/paypal.php on line 141

 

Warning: before_process(): Failed opening 'includes/modules/payment/paypal/classes/osC/osC.class.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/m/t/e/mtechamatest/html/catalog/includes/modules/payment/paypal.php on line 141

 

Fatal error: Undefined class name 'paypal_osc' in /home/content/m/t/e/mtechamatest/html/catalog/includes/modules/payment/paypal.php on line 142

Does the file includes/modules/payment/paypal/classes/osC/osC.class.php exist? If it does, is the file size larger than 0?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
Does the file includes/modules/payment/paypal/classes/osC/osC.class.php exist? If it does, is the file size larger than 0?

 

Regards

Jim

 

 

well as fars it goes is includes/modules/payment/paypal.php


Wade Morris

Amarillo, Texas

 

Before you do any changes on your site you need to do BACKUP! BACKUP!

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

×