Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

I am testing one shipping method at a time started with table. 25:8.50,50:5.50,10000:0.00

porblem I am having is shipping is not changed when price changes.

 

Surely that is because table rate is weight based? :)

Edited by Maggilove

Share this post


Link to post
Share on other sites

No there is an option to change to price and I use my other table shipping module, not the one with vendor, based on price

Edited by crashwave

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Share this post


Link to post
Share on other sites

ok I got it

in table.php

function quote($method = '', $module = '', $vendors_id = '1') {
global $HTTP_POST_VARS, $shipping_weight, $order, $cart, $shipping_num_boxes;

  if (@constant('MODULE_SHIPPING_TABLE_MODE_' . $vendors_id) == 'price') {
	$order_total = $shipping_cost;
  } else {
	$order_total = $shipping_weight;
  }

 

$cost needs to be a global ( $shipping_cost is nothing in vendor_shipping)

 

	function quote($method = '', $module = '', $vendors_id = '1') {
  global $HTTP_POST_VARS, $shipping_weight, $order, $cart, $shipping_num_boxes, $cost;

  if (@constant('MODULE_SHIPPING_TABLE_MODE_' . $vendors_id) == 'price') {
	$order_total = $cost;
  } else {
	$order_total = $shipping_weight;
  }

Edited by crashwave

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Share this post


Link to post
Share on other sites
No there is an option to change to price

 

Oops, sorry, I wasn't aware... :blush: ...the modded version of zones I have always used for table rates doesn't have that option... thanks for pointing it out... :thumbsup:

Share this post


Link to post
Share on other sites

I've just install MVS on a site, but I'm a little unsure about how to actually use it.

 

Basically, my client doesn't actually have multiple vendors - just multiple goods classes ("light" and "heavy" - doesn't want to track actual weights). Additionally, she needs different rates the the US, Canada, and Internationally.

 

How can I combine simple "vendor" categories with zone-based shipping to achieve what I want?

Share this post


Link to post
Share on other sites
First, I have installed MVS on a heavily modded Live store....works great.....

 

Though, I dont know if this a bug or I missed something. But in Admin when I am going back to change the vendors and edit products the Products Price (Net):

Products Price (Gross): are not being saved.

 

 

Vendors Price(Base): is being saved though

 

Any ideas? I did a search but did not find anything on this....so I am thinking I missed something.

 

 

Any help with this? What part of the code controls saving the price in the product edit page? It get annoying, that everytime I edit a product I have re-enter the price. Need some help...

 

thanks

Share this post


Link to post
Share on other sites
I've just install MVS on a site, but I'm a little unsure about how to actually use it.

 

Basically, my client doesn't actually have multiple vendors - just multiple goods classes ("light" and "heavy" - doesn't want to track actual weights). Additionally, she needs different rates the the US, Canada, and Internationally.

 

How can I combine simple "vendor" categories with zone-based shipping to achieve what I want?

 

It sounds to me like you've answered your own question.

 

Set up two vendor categories, one for light and one for heavy. Set up the zones module for each class with three zones for each.

 

 

 

 

First, I have installed MVS on a heavily modded Live store....work great.....

 

Though, I dont know if this a bug or I missed something. But in Admin when I am going back to change the vendors for certain products the Products Price (Net):

Products Price (Gross): are not being saved.

 

 

Vendors Price(Base): is being saved though

 

Any ideas? I did a search but did not find anything on this....so I am thinking I missed something.

 

This is a tough one. Have you verified all the changes you made to admin/categories.php? And is the proper price showing up in the product listings?

 

"[H]eavily modded Live store" might be an issue here too.

 

 

 

How do I get the orders page to show as a normal orders page, instead of the table with all the vendors?

I dont need that info on the invoices I just want the order page and invoice to look normal.

 

Any ideas?

Can't you just undo the changes made to admin/orders.php?

 

Is there a bug fix page/site somewhere for this.

Having to read through 48 pages for a bug fix is a little much.

If not can there be something simple, a page with something like

Date Bug Fix

I am willing to host it :D

Thanks

 

You shouldn't have to look through all 48 pages- just go back to the date of the release your'e using and sift through from there. A simple listing of bug fixes is a good idea though.


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
I get this error when I try and duplicate a product....

 

1136 - Column count doesn't match value count at row 1

 

That's also admin/categories.php. I'd say that you definitely have issues with that page. How many contributions have you installed that modify that page?


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites

OK, I've got this working pretty good so far, and now I am trying to integrate Group Discount 1.4 http://www.oscommerce.com/community/contributions,1671 into it. I have been successful so far with one exception:

 

When I add a product with attributes, the prices are calculated correctly all through the checkout. However, when the confirmation e-mail goes out, the individual attribute prices show up as the NON-discounted price. They also show up this way in Admin-->Orders on the invoice.

 

When I look in the ORDERS_PRODUCTS_ATTRIBUTES table, the OPTIONS_VALUE_PRICE for the individual attributes still shows the original non-discounted price. This is obviously (or not :blush: ) why the e-mail and invoice are showing those values. What I have been unsuccessful in locating is where the values in this table are inserted. I have tried various different places in catalog/includes/classes/shopping_cart.php (that is where all the other values seem to be calculated for checking out), but no luck.

 

If anyone has an idea where these values get shoved into the table from, it would really help me try to make these two contributions coexist.

 

Thanks,

 

John

Share this post


Link to post
Share on other sites

All of the database updates for an order occur in checkout_process.php. The ORDERS_PRODUCTS_ATTRIBUTES updates start around line 239. MVS doesn't modify the Attributes data, so this is likely related to your discount mod.

 

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

While I am on the subject of integrating contributions, I still haven't been able to find (through many hours of troubleshooting >_< ) the problem with the manual order editor that I am having. When I click on the button to update an order using the order editor 1.6 http://www.oscommerce.com/community/contributions,1435, I get the following error:

 

Warning: Cannot modify header information - headers already sent by (output started at xxxx.com/admin/includes/classes/vendor_order_data.php:11) in xxxx.com/admin/includes/functions/general.php on line 110

 

Not sure what this is telling me about the headers already being sent by vendor_order_data.php.

 

Has anyone been successful in integrating a manual order editor with MVS? Any ideas what the error might be pointing to?

 

As always, the phenomenal help from this group is greatly appreciated.

 

John

Share this post


Link to post
Share on other sites

That error message usually occurs when you try to redirect to another page after you have already sent part of a page to the requesting browser. In this case it's the comments in vendor_order_data.php. Change the top of that file from this:

<!-- MVS
 $Id: vendor_order_data.php
By Craig Garrison Sr. (craig@blucollarsales.com) for Multi-Vendor Shipping
  osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2005 osCommerce

 Released under the GNU General Public License
							 -->
<?php

to this:

<?php
/* MVS
 $Id: vendor_order_data.php
By Craig Garrison Sr. (craig@blucollarsales.com) for Multi-Vendor Shipping
  osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2005 osCommerce

 Released under the GNU General Public License
*/

 

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
All of the database updates for an order occur in checkout_process.php. The ORDERS_PRODUCTS_ATTRIBUTES updates start around line 239. MVS doesn't modify the Attributes data, so this is likely related to your discount mod.

 

Regards

Jim

 

 

Thanks Jim, that looks promising. Will continue the attempt starting there tomorrow (too many hours today :blink: so far!)

 

John

Share this post


Link to post
Share on other sites
That error message usually occurs when you try to redirect to another page after you have already sent part of a page to the requesting browser. In this case it's the comments in vendor_order_data.php. Change the top of that file from this:

 

<SNIP>

 

to this:

<?php
/* MVS
 $Id: vendor_order_data.php
By Craig Garrison Sr. (craig@blucollarsales.com) for Multi-Vendor Shipping
  osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2005 osCommerce

 Released under the GNU General Public License
*/

 

Regards

Jim

 

Genius, sheer genius. :thumbsup: That fixed that problem (after changing the header in admin/includes/classes instead of catalog/includes - which was already correct - my bad :blush: ), but of course exposed a new one that I will have to work on! :angry: Tomorrow is another day.

 

Thanks for your help Jim! This really is a great contribution!

 

John

Share this post


Link to post
Share on other sites

It's an unfortunate fact of life that fixing one bug usually just exposes another one. The only advantage is in lessons learned for the next time.

 

It's not a matter of genius; I've just made all of these mistakes often enough that I have the error messages memorized. Sad, really.

 

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

First, I would like thank Craig and Jim for this wonderful contribution!

 

I have got most of the MVS working. However, the USPS shipping module in vendors_shipping seems to be not working. I could install the USPS vendor shipping module but the USPS shipping option doesn't show up on the checkout_shipping.php page when the vendor_shipping option is enabled. Has anyone encountered the same thing?

 

Regards,

Ste

Share this post


Link to post
Share on other sites

Does anyone have MVS working with "Add Weight To Product Attributes"? MVS is only adding the weight of the main product, not the weight of additional products using product attributes....

 

any ideas?

Share this post


Link to post
Share on other sites

Weight (per vendor) is calculated in the vendor_shipping method in the shoppingCart class -- includes/classes/shopping_cart.php, line 247-346. You'll need to modify that method to add the weights. I'd start with the Attributes section (adds or subtracts incremental attributes costs) at lines 323-341. It shouldn't be too hard to add weights to that section.

 

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 still cannot get it to work, in the catalog install.txt for shopping_cart.php it does not show the code for add_weight....Add_weight and UPSXML work fine if I disable MVS... here is my code starting from line 230 to the end of UPSXML fix...can someone compare it to theirs or tell me what is wrong...I am out of ideas...

 

 

// attributes price

// kumar@farmdev.com

// add-weight-to-product-attributes mod:

// added weight to db query

if (isset($this->contents[$products_id]['attributes'])) {

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

$attribute_price_query = tep_db_query("select options_values_price, price_prefix, options_values_weight from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");

$attribute_price = tep_db_fetch_array($attribute_price_query);

if ($attribute_price['price_prefix'] == '+') {

$this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);

} else {

$this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);

}

if(!empty($attribute_price['options_values_weight'])) {

// kumar@farmdev.com

// add-weight-to-product-attributes mod:

$this->weight += ($qty * $attribute_price['options_values_weight']);

} // END if(!empty($attribute_price['options_values_weight'])) {

}

}

}

}

 

 

 

//MVS Start

function vendor_shipping() {

 

 

 

if (!is_array($this->contents)) return 0; //Cart is empty

 

 

 

$this->vendor_shipping = array(); //Initialize the output array

 

reset($this->contents); // and reset the input array

 

foreach ($this->contents as $products_id => $value) { //$value is never used

 

$quantity = $this->contents[$products_id]['qty'];

 

 

 

$products_query = tep_db_query("select products_id,

 

products_price,

 

products_tax_class_id,

 

products_weight,

 

vendors_id

 

from " . TABLE_PRODUCTS . "

 

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

 

);

 

if ($products = tep_db_fetch_array($products_query)) {

 

$products_price = $products['products_price'];

 

$products_weight = $products['products_weight'];

 

$vendors_id = ($products['vendors_id'] <= 0) ? 1 : $products['vendors_id'];

 

$products_tax = tep_get_tax_rate($products['products_tax_class_id']);

 

 

 

//Find special prices (if any)

 

$specials_query = tep_db_query("select specials_new_products_price

 

from " . TABLE_SPECIALS . "

 

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

 

and status = '1'"

 

);

 

if (tep_db_num_rows ($specials_query)) {

 

$specials = tep_db_fetch_array($specials_query);

 

$products_price = $specials['specials_new_products_price'];

 

}

 

 

 

//Add values to the output array

 

$this->vendor_shipping[$vendors_id]['weight'] += ($quantity * $products_weight);

 

$this->vendor_shipping[$vendors_id]['cost'] += tep_add_tax($products_price, $products_tax) * $quantity;

 

$this->vendor_shipping[$vendors_id]['qty'] += $quantity;

 

$this->vendor_shipping[$vendors_id]['products_id'][] = $products_id; //There can be more than one product

 

}

 

 

 

// Add/subtract attributes prices (if any)

 

if (isset($this->contents[$products_id]['attributes'])) {

 

reset($this->contents[$products_id]['attributes']);

 

foreach ($this->contents[$products_id]['attributes'] as $option => $value) {

 

$attribute_price_query = tep_db_query("select options_values_price, price_prefix, options_values_weight from " . TABLE_PRODUCTS_ATTRIBUTES . "

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

and options_id = '" . (int)$option . "'

and options_values_id = '" . (int)$value . "'"

 

);

 

$attribute_price = tep_db_fetch_array($attribute_price_query);

 

if ($attribute_price['price_prefix'] == '+') {

 

$this->vendor_shipping[$vendors_id]['cost'] += $quantity * tep_add_tax($attribute_price['options_values_price'], $products_tax);

 

} else {

 

$this->vendor_shipping[$vendors_id]['cost'] -= $quantity * tep_add_tax($attribute_price['options_values_price'], $products_tax);

 

 

}

 

 

 

}

 

}

 

}

 

 

 

return $this->vendor_shipping;

 

}

 

//MVS End

 

 

 

 

function attributes_price($products_id) {

$attributes_price = 0;

 

if (isset($this->contents[$products_id]['attributes'])) {

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");

$attribute_price = tep_db_fetch_array($attribute_price_query);

if ($attribute_price['price_prefix'] == '+') {

$attributes_price += $attribute_price['options_values_price'];

} else {

$attributes_price -= $attribute_price['options_values_price'];

}

}

}

 

return $attributes_price;

}

 

function get_products() {

global $languages_id;

 

if (!is_array($this->contents)) return false;

 

$products_array = array();

reset($this->contents);

while (list($products_id, ) = each($this->contents)) {

//MVS Start - added v.vendors_id, v.vendors_name, and v.vendors_id = p.vendors_id

 

$products_query = tep_db_query("select p.products_id,

 

pd.products_name,

 

p.products_model,

 

p.products_image,

 

p.products_price,

 

p.products_weight,

 

p.products_tax_class_id,

 

v.vendors_id,

 

v.vendors_name

 

from " . TABLE_PRODUCTS . " p,

 

" . TABLE_PRODUCTS_DESCRIPTION . " pd,

 

" . TABLE_VENDORS . " v

 

where p.products_id = '" . (int)$products_id . "'

 

and pd.products_id = p.products_id

 

and v.vendors_id = p.vendors_id

 

and pd.language_id = '" . (int)$languages_id . "'"

 

);

 

//MVS End

 

 

 

if ($products = tep_db_fetch_array($products_query)) {

 

$prid = $products['products_id'];

 

$products_price = $products['products_price'];

 

$specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");

if (tep_db_num_rows($specials_query)) {

$specials = tep_db_fetch_array($specials_query);

$products_price = $specials['specials_new_products_price'];

}

 

// BOF add-weight-to-product-attributes with UPSxml mod

 

 

// determine total weight of attributes to add to weight of product

$attributes_total_weight = 0;

if (isset($this->contents[$products_id]['attributes'])) {

reset($this->contents[$products_id]['attributes']);

$where = ' AND ((';

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

$where .= 'options_id=' . $option . ' AND options_values_id=' . $value . ') OR (';

}

$where=substr($where, 0, -5) . ')';

 

$attribute_weight_query = tep_db_query('SELECT options_values_weight FROM ' . TABLE_PRODUCTS_ATTRIBUTES . ' WHERE products_id=' . (int)$prid . $where);

 

if (tep_db_num_rows($attribute_weight_query)) {

while ($attributes_weight_array = tep_db_fetch_array($attribute_weight_query)) {

$attributes_total_weight += $attributes_weight_array['options_values_weight'];

 

}

 

 

}

 

}

// EOF add-weight-to-product-attributes mod

 

//MVS Start - added 'vendors_name' => ..., 'vendors_id' => ...

 

$products_array[] = array('id' => $products_id,

 

'name' => $products['products_name'],

 

'model' => $products['products_model'],

 

'image' => $products['products_image'],

 

'price' => $products_price,

 

'quantity' => $this->contents[$products_id]['qty'],

 

'weight' => $products['products_weight'] + $attributes_total_weight,

 

'final_price' => ($products_price + $this->attributes_price($products_id)),

 

'tax_class_id' => $products['products_tax_class_id'],

 

'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''),

 

'vendors_id' => $products['vendors_id'],

 

'vendors_name' => $products['vendors_name']

 

);

 

//MVS End

Share this post


Link to post
Share on other sites
My sales tax is still showing 3 decimal places on the customer e-mails (sent from checkout_processing), and I can't track down why. It seems to be adding an additional zero after the second decimal place. I have set the Admin->Configuration->Tax Decimal Places to 2, but it does not have any effect. Any ideas where to start looking?

 

Thank you,

John

 

:blush: My apologies, I have too many bugs at once I am trying to clear up! When I said "sales tax", I meant "Shipping Sales Tax" and also "Shipping Cost" are showing the 3 decimal places. Don't know if that helps anyone with an idea of what it might be, but any help would be appreciated. I'll be glad when I get this store up and running! :wacko:

 

Thanks,

 

John

Share this post


Link to post
Share on other sites

I am just installing the Multi_Vendor_Shipping module in a new and unmodified osCommerce store. I copied all the files into the /catalog directory and executed the mvs.sql query to create and populate the database tables. Everyting seems to have gone OK. I changed the value for "Enable Vendor Shipping" in the Shipping/Packaging section of the admin to "true" but I do not get the "Vendors" option in the left hand column to allow me to set up the Vendors. I am sure it is something very simple but if someone can help me out here I would be most grateful. Thanks.

Share this post


Link to post
Share on other sites
I am just installing the Multi_Vendor_Shipping module in a new and unmodified osCommerce store. I copied all the files into the /catalog directory and executed the mvs.sql query to create and populate the database tables. Everyting seems to have gone OK. I changed the value for "Enable Vendor Shipping" in the Shipping/Packaging section of the admin to "true" but I do not get the "Vendors" option in the left hand column to allow me to set up the Vendors. I am sure it is something very simple but if someone can help me out here I would be most grateful. Thanks.

 

Check the changes to the admin folder:

 

admin/includes/column_left.php (changed file)

admin/includes/boxes/vendors.php (new file)

 

etc.


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
:blush: My apologies, I have too many bugs at once I am trying to clear up! When I said "sales tax", I meant "Shipping Sales Tax" and also "Shipping Cost" are showing the 3 decimal places. Don't know if that helps anyone with an idea of what it might be, but any help would be appreciated. I'll be glad when I get this store up and running! :wacko:

 

Thanks,

 

John

 

Not sure if there might be a better way to do it in the code somewhere, but I solved the problem by changing the Length/Value in ORDERS_SHIPPING for both SHIPPING _COST and SHIPPING_TAX from 15,3 to 15,2. Only shows 2 decimal points now. :D

Share this post


Link to post
Share on other sites
Check the changes to the admin folder:

 

admin/includes/column_left.php (changed file)

admin/includes/boxes/vendors.php (new file)

 

etc.

 

 

Thank you very much for the help. I checked the files you suggested and you are right. There was some problem in the FTP to the admin folder. It is working now.

 

But I have another small problem.

 

I am now installing Page Cache v1.5 for osCommerce-ms2 and I have already installed Ultimate SEO URLs by Chemo so when I come to modifying the includes/functions/html_output.php file I can no longer find the lines I am supposed to replace to install the Page Cache module in this file as they seem to have been replaced by the SEO module. What to do?

 

Thanks for your help and patience...

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

×