Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

Hi Jim

 

It's been awhile...

I had a good look into the database as you suggested, removed a obsolete vendor with no values for vendor_shipping_installed_x. It does not make a difference...

Copy the values for each vendor here, along with the vendors_id. Have you checked for duplicate entries for each vendor?

 

Regards

Jim

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

Link to comment
Share on other sites

Im trying to add 2nd day, next day etc to table rate, how is this done?

Exactly the same as table rates in stock osCommerce. Check the Knowledge Base, or search the forum for "table rates".

 

Regards

Jim

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

Link to comment
Share on other sites

this is the code I got but how do I convert this to MVS?

 

// class methods

function quote($method = '') {

global $order, $cart, $shipping_weight, $shipping_num_boxes,$order_total;

 

 

if (MODULE_SHIPPING_TABLE_MODE == 'Price') {

$order_total = $cart->show_total();

} else {

$order_total = $cart->show_weight();

}

 

$availableMethods = array();

 

for ($methodNum = 1; $methodNum <= MODULE_SHIPPING_TABLE_NUMBER_OF_METHODS; $methodNum++) {

$table_cost_name = 'MODULE_SHIPPING_TABLE_COST_METHOD_' . $methodNum;

$table_text_name = 'MODULE_SHIPPING_TABLE_TEXT_METHOD_' . $methodNum;

 

$table_cost = split("[:,]", constant($table_cost_name));

for ($i = 0; $i < sizeof($table_cost); $i += 2) {

if (($table_cost[$i] == "infinity") || ($table_cost[$i] >= $order_total)) {

$shipping = $table_cost[$i+1];

break;

}

}

if ($i == sizeof($table_cost)) continue;

 

if (MODULE_SHIPPING_TABLE_MODE == 'Weight') {

$shipping *= $shipping_num_boxes;

}

 

if ( ($method == '') || ($method == $methodNum) )

{

$availableMethods[] = array('id' => $methodNum,

'title' => constant($table_text_name),

'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING);

}

}

 

if (sizeof($availableMethods)) {

$this->quotes = array('id' => $this->code,

'module' => $this->title,

'methods' => $availableMethods);

} else {

return false;

}

 

if ($this->tax_class > 0) {

$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

}

 

if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

 

return $this->quotes;

}

 

function check() {

if (!isset($this->_check)) {

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_TABLE_STATUS'");

$this->_check = tep_db_num_rows($check_query);

}

return $this->_check;

}

 

function install() {

global $language;

require(DIR_FS_CATALOG_LANGUAGES . "$language/modules/shipping/table.php");

 

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Table Method', 'MODULE_SHIPPING_TABLE_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_TABLE_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'Weight\', \'Price\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_TABLE_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_TABLE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_TABLE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_TABLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");

 

if (0) {

 

for ($methodNum = 1; $methodNum <= MODULE_SHIPPING_TABLE_NUMBER_OF_METHODS; $methodNum++) {

$method = 'METHOD_' . $methodNum;

$table_cost_name = 'MODULE_SHIPPING_TABLE_COST_' . $method;

$table_text_name = 'MODULE_SHIPPING_TABLE_TEXT_' . $method;

$sql = "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . constant($table_text_name) . " Shipping Table', '" . $table_cost_name . "', '25:8.50,50:5.50,10000:0.00', 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())";

//echo $sql . '<br>';

tep_db_query($sql);

}

 

} else {

 

$methodNum = 0;

do {

$methodNum++;

$table_cost_name = "MODULE_SHIPPING_TABLE_COST_METHOD_$methodNum";

$table_text_name = "MODULE_SHIPPING_TABLE_TEXT_METHOD_$methodNum";

if (!defined($table_text_name)) {

$methodNum--;

break;

}

$sql = "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . constant($table_text_name) . " Shipping Table', '" . $table_cost_name . "', '25:8.50,50:5.50', 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50. Up to 25 charge 8.50, from there to 50 charge 5.50, past 50 and this option is not allowed. Can also specify \"infinity\" to avoid a cap 25:8.50,50:5.50,infinity:4.75', '6', '0', now())";

tep_db_query($sql);

} while (1);

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Number of Methods', 'MODULE_SHIPPING_TABLE_NUMBER_OF_METHODS', '$methodNum', 'Number of registered shipping methods.', '6', '0', now())");

 

}

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key like 'MODULE_SHIPPING_TABLE%'");

}

 

function keys() {

$retval = array('MODULE_SHIPPING_TABLE_STATUS', 'MODULE_SHIPPING_TABLE_MODE', 'MODULE_SHIPPING_TABLE_HANDLING', 'MODULE_SHIPPING_TABLE_TAX_CLASS', 'MODULE_SHIPPING_TABLE_ZONE', 'MODULE_SHIPPING_TABLE_SORT_ORDER');

 

$result = tep_db_query("select configuration_key from " . TABLE_CONFIGURATION . " where configuration_key like 'MODULE_SHIPPING_TABLE_COST_METHOD%' order by configuration_key");

while ($row = tep_db_fetch_array($result)) {

$retval[] = $row['configuration_key'];

}

 

return $retval;

}

 

}

 

?>

Link to comment
Share on other sites

That looks like the stock osCommerce Table module. That module has already been converted to work with MVS. I don't understand what you are trying to do with this one.

 

Regards

Jim

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

Link to comment
Share on other sites

You don't add table rates by changing the code. That's all done in the shop Admin.

 

If you really want to write your own shipping module based on the Table module, then start with the one in the vendors_shipping directory. That one has already been modded to work with MVS.

 

Regards

Jim

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

Link to comment
Share on other sites

Are you using FedEx or UPS for shipping? If so, it would be better to use the appropriate module for the shipping service you are using. If you really want table rates for this, try the Multi-Table Multi-Zone addon.

 

Regards

Jim

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

Link to comment
Share on other sites

Can you use ups module by price? There must be a way like if (MODULE_SHIPPING_UPS_MODE == 'price') {

$order_total = $cart->show_total();

No, UPS needs to know the weight of a package to calculate the shipping price.

 

Regards

Jim

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

Link to comment
Share on other sites

i searched for the contribution multi table and multi zones it comes up MVS, any idea where its at?

It comes up third on the list for the search term you gave. MVS is way down near the end of the page, so I don't see how you missed it. Look again.

 

Regards

Jim

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

Link to comment
Share on other sites

Hi Jim

 

It's been awhile...

I had a good look into the database as you suggested, removed a obsolete vendor with no values for vendor_shipping_installed_x. It does not make a difference...

 

Don't know if it is a 'real' solution... but I reinstalled MVS 1.2.3. And this did the trick.

 

On a side note: when using /admin/prods_by_vendor.php and admin/orders_by_vendor.php from version 1.2.3 those pages did not select the vendor in the drop-down box. The files from the previous version (1.2.2) did work well.

 

Thanks.

Link to comment
Share on other sites

Please someone, My question is along the lines of Drilllsar's and I have posted it before with no reponse. I have spent hours trying to integrate MVS with paypal website payments standard. I have now got the tables to update with vendor ID but cannot get thet emails to send.

Everything works fine with COD payment module but Paypal bypasses the checkout process.

 

I have tried to merge the MVS contrib with the paypal module but I simply get nothing by way of emails - no errors either.

 

Surly someone is using this contrib with PayPal. If not could you please recommend and payment engine that works with MVS 1.2.3

thanks in advance.

Link to comment
Share on other sites

Hi,

 

I am using Multi Vendor Shipping to allow me to have a flat rate on every product, but then for large heavy items to specify an individual shipping rate. I have only two vendors - one with the flat rate, the other with the individual rate. If someone buys a product that should have the individual rate, they are only being charged for a flat rate.

 

Can anyone help with the piece of coding that will solve this please? (It maybe something I have missed and will check everything now)

 

Is there also a way of choosing the most expensive shipping if someone buys a product that should have individual shipping and a flat rate item?

 

Thank you

 

Ali

Link to comment
Share on other sites

This should work, so you have an error somewhere. Make certain that you have the correct vendor ID in the database for each product that needs the extra shipping charge (products table).

 

I have never heard of any Addon that charges the highest shipping fee. That doesn't mean something doesn't exist, or that it couldn't be coded.

 

Regards

Jim

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

Link to comment
Share on other sites

This should work, so you have an error somewhere. Make certain that you have the correct vendor ID in the database for each product that needs the extra shipping charge (products table).

 

I have never heard of any Addon that charges the highest shipping fee. That doesn't mean something doesn't exist, or that it couldn't be coded.

 

Regards

Jim

 

Thanks for your help, I will double check all my coding again!

 

Ali

Link to comment
Share on other sites

Hi Jim,

 

I have a new question for you.

 

I installed MVS + Order Editor for MVS + Manual Order maker 1.5.7 Full

First from admin panel with Manual Order Maker I select a customer and then I click on [Create order] but always creates a non-mvs order, and I would need it to be an mvs order (to use the vendors email functions).

 

Do you know any trick or some suggestion?

 

Thanks.

Edited by bhbilbao
Link to comment
Share on other sites

Manual Order Maker is not designed to work with MVS. You will need to modify it to recognize the additional data and diabase entries that MVS needs to work.

 

Regards

Jim

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

Link to comment
Share on other sites

The problem is in orders_shipping database.

 

If I modify it manually creating an order_shiping_id and asigning it to the orders_id it begins to work.

Then also working when clicking on Email Sent: no.

 

but the shipping dont work.

Link to comment
Share on other sites

Finally solved:

 

MVS+MANUAL ORDER MAKER

 

In create_order_process.php

 

   $sql_data_array = array('orders_id' => $insert_id,
                           'title' => TEXT_DELIVERY,
                           'text' => $temp_amount,
                           'value' => "0.00", 
                           'class' => "ot_shipping", 
                           'sort_order' => "3");
   tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);

   $sql_data_array = array('orders_id' => $insert_id,
                           'title' => TEXT_TAX,
                           'text' => $temp_amount,
                           'value' => "0.00", 
                           'class' => "ot_tax", 
                           'sort_order' => "4");
   tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);

     $sql_data_array = array('orders_id' => $insert_id,
                           'title' => TEXT_TOTAL,
                           'text' => $temp_amount,
                           'value' => "0.00", 
                           'class' => "ot_total", 
                           'sort_order' => "5");
   tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);

 tep_redirect(tep_href_link(FILENAME_ORDERS_EDIT, 'oID=' . $insert_id, 'SSL'));

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

replacing with:

    $sql_data_array = array('orders_id' => $insert_id,
                           'title' => TEXT_DELIVERY,
                           'text' => $temp_amount,
                           'value' => "0.00", 
                           'class' => "ot_shipping", 
                           'sort_order' => "3");
   tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);

   $sql_data_array = array('orders_id' => $insert_id,
                           'title' => TEXT_TAX,
                           'text' => $temp_amount,
                           'value' => "0.00", 
                           'class' => "ot_tax", 
                           'sort_order' => "4");
   tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);

     $sql_data_array = array('orders_id' => $insert_id,
                           'title' => TEXT_TOTAL,
                           'text' => $temp_amount,
                           'value' => "0.00", 
                           'class' => "ot_total", 
                           'sort_order' => "5");
   tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);

   $sql_data_array = array('orders_id' => $insert_id,
                           'vendors_id' => "1", 
                           'shipping_module' => "indvship",
                           'shipping_method' => "Individual shipping",
                           'shipping_cost' => "12.00", 
                           'shipping_tax' => "0.00", 
                           'vendors_name' => "default",
                           'vendor_order_sent'  => "no"); 
   tep_db_perform(TABLE_ORDERS_SHIPPING, $sql_data_array);

 tep_redirect(tep_href_link(FILENAME_ORDERS_EDIT, 'oID=' . $insert_id, 'SSL'));

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

 

This creates a "type-mvs order" that can be useful to make quotations and administrate orders to vendors/suppliers.

If then we add diferent vendor then we insert the shipping manually for the new vendor.

 

 

 

MVS+RMA RETURNS

 

This for people who had problems before in this thread.

 

In vendor_order_info.php

 

search for:

for ($i = 0, $n = sizeof($order->products[$l]['orders_products']); $i < $n; $i++) {

 

add this after:

 

//BEGIN RMA MODULE
        $returns_check_query = tep_db_query("SELECT r.rma_value, r.returns_id, r.returns_date_finished, rp.products_id FROM " . TABLE_RETURNS . " r, " . TABLE_RETURNS_PRODUCTS_DATA . " rp where r.returns_id = rp.returns_id and r.order_id = '" . $oID . "' and rp.products_id = '" . $order->products[$l]['orders_products'][$i]['id'] . "' ");
       if (!tep_db_num_rows($returns_check_query)){

if ($order->products[$i]['return'] != '1') {
// old  $return_link = '<a href="' . tep_href_link(FILENAME_RETURN, 'order_id=' . $oID . '&products_id=' . ($order->products[$i]['id']), 'NONSSL') . '"><u>' . '<font color="0066ff">RMA- Gestionar Devolución</font>' .'</a></u>';
$return_link = '<a href="' . tep_href_link(FILENAME_RETURN, 'order_id=' . $oID . '&products_id=' . ($order->products[$l]['orders_products'][$i]['id']), 'NONSSL') . '"><u>' . '<font color="#0066ff">RMA- Gestionar Devolución</font>' .'</a></u>';

       }
       // Don't show Return link if order is still pending or processing
       // You can change this or comment it out as best fits your store configuration
       if (($orders_status == '1') OR ($orders_status == '2') ) {
$return_link = '';
         }
       } else {
       $returns = tep_db_fetch_array($returns_check_query);
// old	$return_link = '<a href="' . tep_href_link(FILENAME_RETURN, 'order_id=' . $oID . '&products_id=' . ($order->products[$l]['orders_products'][$i]['id']), 'NONSSL') . '"><u>' . '<font color="#red">RMA - <blink>En devolución</blink></font>' .'</a></u>';
       $return_link = '<a href=' . tep_href_link(FILENAME_RETURNS, 'cID=' . $returns['rma_value']) . '><font color=red><b><i><u>RMA' . $returns['returns_id'] . '</u> - <blink>En devolución</blink></b></i></font></a> - ' . $returns['returns_date_finished'] ;


       }
//END RMA MODULE

 

 

 

 

MVS+PRODUCT SERIAL NUMBERS

Need help with tha contribution!

All working, except when an order has diferent vendors the first line of all products are duplicating when inserting serial numbers:

Example:

 

When inserting serial for product5, it replaces the serial of product1 (..oID=414&serial=0).

The serial link for product5 should be http ://www . myweb.es/admin/orders.php?action=edit&oID=414&serial=4

 

I spent days changing codes but no luck.

 

This is the devil code:

 

orders.php

// BEGIN - Product Serial Numbers
   case 'update_serial':
     $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
     $serial_number = tep_db_prepare_input($HTTP_POST_VARS['serial_number']);
     $serial = tep_db_prepare_input($HTTP_GET_VARS['serial']);

// old tep_db_query("update " . TABLE_ORDERS_PRODUCTS . " set products_serial_number = '" . tep_db_input($serial_number) . "' where orders_id = '" . tep_db_input($oID) . "' and products_id=" . tep_db_input($serial));
       tep_db_query("update " . TABLE_ORDERS_PRODUCTS . " set products_serial_number = '" . tep_db_input($serial_number) . "' where orders_id = '" . tep_db_input($oID) . "'");
       $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');

     tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit&serial_updated=1'));
     break;
// END - Product Serial Numbers

   ////
   // Update Order
     case 'update_order':

 

vendor_order_info.php

//
$serial_number = "ID#" ;
if (tep_not_null($order->products[$l]['orders_products'][$i]['serial_number'])) 
$serial_number = $order->products[$l]['orders_products'][$i]['serial_number'];
echo '<td class="dataTableContent" valign="top"> <a href="' . tep_href_link(FILENAME_ORDERS, 'action=edit&oID=' . $oID . '&serial=' . $i, 'NONSSL') . '">' . $serial_number . '</a> </td>' . "\n" .
// 

 

at the end:

// BEGIN - Product Serial Numbers
	if (tep_not_null($HTTP_GET_VARS['serial']) && ($HTTP_GET_VARS['serial'] == $i) && ($HTTP_GET_VARS['serial_updated'] <> 1)) {
		echo '          <tr class="dataTableRow">' . "\n" .
          		 '            <td class="dataTableContent" colspan="3" valign="middle" align="right">s/n#: </td>' . "\n";

			 echo '            <td class="dataTableContent" colspan="10" valign="middle">' . 
                                                 tep_draw_form('serial_form', FILENAME_ORDERS, 'action=update_serial&oID=' . $oID . '&serial=' . $order->products[$l]['orders_products'][$i]['id'], 'post', '') . 

					tep_draw_input_field('serial_number', $serial_number, '', false, 'text', true) . ' ' .tep_image_submit('button_serial.gif', IMAGE_UPDATE) . '</td>' . "\n" .

			 '          </tr>' . "\n";
	}
// END - Product Serial Numbers

Edited by bhbilbao
Link to comment
Share on other sites

I'm having issues with MVS and the Get 1 Free contribution.

 

Everything seems to work fine from the customer side of things, but where I run into a problem is on the Admin side. The "Free" item that the customer ordered does not show up on the Order, Invoice or Packing slip. The only things that show up are the items the customer would have been required to purchase to get the free item. The free item is in the database as part of that order, but I notice there is no Vendor ID attached to the free item, so I'm assuming that may be part of the issue.

 

I'm assuming that I either need to add something to the shopping cart part of MVS to add the Get1Free item, and/or I need to add something to the admin side of MVS to show the Get1Free item. If anyone could give me some insight into what I should do, I'd appreciate it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...