Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

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

 

 

Well I fixed the problem for paypal. Now I got another problem ok in my admin:

 

Fatal error: Call to undefined function: tep_get_vendors_prod_comments() in /home/content/m/t/e/mtechamatest/html/catalog/admin/categories.php on line 592

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
Well I fixed the problem for paypal. Now I got another problem ok in my admin:

 

Fatal error: Call to undefined function: tep_get_vendors_prod_comments() in /home/content/m/t/e/mtechamatest/html/catalog/admin/categories.php on line 592

That function was added to admin/includes/functions/general.php. Did you add the function? If so, check for typos in the function definition.

 

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

Well I have made my first Contribution. I will post it about it next week.


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
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

Sorry Jim, Duno how to check, to see if the vendor ID is returning.

Is debug something that is done with another prog. or is it a case of looking through the code (as shown below)?

 

$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 . "'");

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

$vendor = tep_db_fetch_array($vendor_query);
$free_shipping = $vendor['vendors_phone1'];

$product_info = tep_db_fetch_array($product_info_query);

Sorry to ber a pain, but I'm no programmer, just a copy and paster!

 

Thanks

 

Steve


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites
Sorry Jim, Duno how to check, to see if the vendor ID is returning.

Is debug something that is done with another prog. or is it a case of looking through the code (as shown below)?

 

$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 . "'");

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

$vendor = tep_db_fetch_array($vendor_query);
$free_shipping = $vendor['vendors_phone1'];

$product_info = tep_db_fetch_array($product_info_query);

Sorry to ber a pain, but I'm no programmer, just a copy and paster!

 

Thanks

 

Steve

Try moving:

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

$vendor = tep_db_fetch_array($vendor_query);
$free_shipping = $vendor['vendors_phone1'];

 

so that it is after this line:

$product_info = tep_db_fetch_array($product_info_query);

IF is does not work after that, then change:

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

to:

$vendor_query = tep_db_query("select vendors_phone2 from " . TABLE_VENDORS . " where vendors_id  = '" . (int)$product_info['vendors_id'] . "'");

while($vendor = tep_db_fetch_array($vendor_query)) {
$free_shipping = $vendor['vendors_phone2'];
	}

 

I have seen this before, also it could just be the that you were calling "vendors_phone1" and not "vendors_phone2".

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
Try moving:

 

snip....

 

I have seen this before, also it could just be the that you were calling "vendors_phone1" and not "vendors_phone2".

Good luck, Craig :)

Hi Craig and thanks for your help, which has proved successful in getting my mod to work :D

 

Doing the move cured the problem. For refference, I also tried your final code replacement to see if that worked, which it did :)

 

What I've ended up with is this

$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 . "'");

$product_info = tep_db_fetch_array($product_info_query);

$vendor_query = tep_db_query(" select vendors_phone2 from " . TABLE_VENDORS . " where vendors_id  = '" . (int)$product_info['vendors_id'] . "'");

$vendor = tep_db_fetch_array($vendor_query);
$free_shipping = $vendor['vendors_phone2'];

 

I have now found that I have to limit my 'phone2' text to 20 characters. Just wondering where I could alter this limitation?

 

Thanks

 

Steve


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites
I have now found that I have to limit my 'phone2' text to 20 characters. Just wondering where I could alter this limitation?

 

Thanks

 

Steve

 

Had a thought after making the previous post. Using phpMyAdmin ans searching for the vendor info, I've changed the feild length, saved. I now have a useful 40 character field.

 

Thanks for your help guys

 

Steve


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites

Just trying to make things more tidy..

 

In cat/admin/vendors.php how can I increase the size of the text entry box? As there dosn't seem to be an obvious way to do it!

 

Thanks

 

Steve


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites

Find the text input field in the code:

	echo tep_draw_input_field('vendors_email', $vInfo->vendors_email, 'maxlength="64"');

and change it to this:

	echo tep_draw_input_field('vendors_email', $vInfo->vendors_email, 'size="60" maxlength="64"');

Change the "60" to whatever length you want. Note that this number often does not match the number of characters that you can fit in the space.

 

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
snip....

Change the "60" to whatever length you want. Note that this number often does not match the number of characters that you can fit in the space.

 

Regards

Jim

Thanks for that Jim :) Now sorted.

 

I'm intrigued how the sizes are determined, without forcing it like your suggestion, as I couldn't find anything that seemed to determin the text box size?

 

Thanks

 

Steve


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites
Thanks for that Jim :) Now sorted.

 

I'm intrigued how the sizes are determined, without forcing it like your suggestion, as I couldn't find anything that seemed to determin the text box size?

 

Thanks

 

Steve

If a value is not specified then it is up to the browser to render whatever size fits. I believe that it defaults to 40, although that may vary by browser. If the space available is not large enough to show a box that size, it will be reduced to fit.

 

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

Probably a bit off topic for this thread, but as it was initiated here.....

 

When filling out new (or editing) product details I've found the text entry box for 'Products Name' is far to small, as most of my product descriptions are longer than the text entry box displays, which is time consuming when editing products as you have to scroll along the text to see whats in there, so I'd like to expand it, but have run in to problems

 

The file I've been trying to edit is /catalog/admin/categories.php

 

I've identified the bit of code that seems to be for the text entry box marked up as 'Products Name:'

 . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?>

From modifying the text box size in the vendor file (see previous posts), I've been inserting >>size="60"<< but have failed to expand the size of the text :( Any ideas on how to increase the text box size horizontally (there's loads of space) or vertically?

 

Thanks in advance of any help :)

 

Steve


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites
<snip>

I've identified the bit of code that seems to be for the text entry box marked up as 'Products Name:'

 . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?>

From modifying the text box size in the vendor file (see previous posts), I've been inserting >>size="60"<< but have failed to expand the size of the text :( Any ideas on how to increase the text box size horizontally (there's loads of space) or vertically?

 

Thanks in advance of any help :)

 

Steve

I believe this will work:

. tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id'])), 'size="60"'); ?>

If you want multiple lines of text, you could use the Text Box instead:

. tep_draw_textarea_field('products_name[' . $languages[$i]['id'] . ']', '55', '60', '3', (isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?>

where 55 is the point at which text will try to wrap, 60 is the width, and 3 is the number of lines.

 

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 again,

 

I am trying to add a product weights attribute contribution however it is not working and I believe that it probably has to do with the MVS contribution. I think that the weight is being entered but not sent through to vendors_shipping correctly.

 

The reason for needing this contribution is I have a product available in 3 lengths, the weight of the first length is 5#, second length is 17# and the third length is 33#. Obviously the shipping calculated for each length is significantly different.

 

The contribution is located here http://www.oscommerce.com/community/contributions,1622 and I am using v0.2.

 

Only 3 files are modified. Only 1 file is modified that is used both by this contribution and by MVS.

 

My /includes/classes/shopping_cart.php file now looks like this (including only the lines that have been modified)

 

Starting Line 242

 

// 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
//  New method to provide cost, weight, quantity, and product IDs by vendor
//////
//Output array structure (example):
//shoppingcart Object
//(
//  [vendor_shipping] => array
//	(
//	  [0] => array   //Number is the vendor_id
//		(
//		  [weight] => 22.59
//		  [cost] => 12.95
//		  [qty] => 2
//		  [products_id] => array
//			(
//			  [0] => 12
//			  [1] => 47
//			)
//		)
//	  [12] => array
//		(
//		  [weight] => 32.74
//		  [cost] => 109.59
//		  [qty] => 5
//		  [products_id] => array
//			(
//			  [0] => 2
//			  [1] => 3
//			  [2] => 37
//			  [3] => 49
//			)
//		)
//	)
//)
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
											   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 End00

 

Ending line 364

 

 

admin/product_attributes is modified in the following way :

 

Starting Line 56

 

		  // kumar@farmdev.com modified for add-weight-to-product-attributes:
	$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
	$options_id = tep_db_prepare_input($HTTP_POST_VARS['options_id']);
	$values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']);
	$value_price = tep_db_prepare_input($HTTP_POST_VARS['value_price']);
	$price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']);
	$value_weight = tep_db_prepare_input($HTTP_POST_VARS['value_weight']);

	tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "', '" . tep_db_input($value_weight) . "')");

	if (DOWNLOAD_ENABLED == 'true') {
	  $products_attributes_id = tep_db_insert_id();

	  $products_attributes_filename = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_filename']);
	  $products_attributes_maxdays = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxdays']);
	  $products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']);

	  if (tep_not_null($products_attributes_filename)) {
		tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " values (" . (int)$products_attributes_id . ", '" . tep_db_input($products_attributes_filename) . "', '" . tep_db_input($products_attributes_maxdays) . "', '" . tep_db_input($products_attributes_maxcount) . "')");
	  }
	}

	tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
	break;
  case 'update_option_name':
	$option_name_array = $HTTP_POST_VARS['option_name'];
	$option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']);

	for ($i=0, $n=sizeof($languages); $i<$n; $i ++) {
	  $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]);

	  tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . tep_db_input($option_name) . "' where products_options_id = '" . (int)$option_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
	}

	tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
	break;
  case 'update_value':
	$value_name_array = $HTTP_POST_VARS['value_name'];
	$value_id = tep_db_prepare_input($HTTP_POST_VARS['value_id']);
	$option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']);

	for ($i=0, $n=sizeof($languages); $i<$n; $i ++) {
	  $value_name = tep_db_prepare_input($value_name_array[$languages[$i]['id']]);

	  tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_name = '" . tep_db_input($value_name) . "' where products_options_values_id = '" . tep_db_input($value_id) . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
	}

	tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " set products_options_id = '" . (int)$option_id . "'  where products_options_values_id = '" . (int)$value_id . "'");

	tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
	break;
  case 'update_product_attribute':
	  // kumar@farmdev.com modifed for add-weight-to-product-attributes
00

 

Ending Line 108.

 

If anyone has any idea where I need to make the modification for this to correctly work with MVS, I will be eternally greatful!!!!!

 

Thanks in advance!

Edited by MSP

Share this post


Link to post
Share on other sites

Hi

 

I'm new to this and have just installed MVS, the probem I have is when checking out I recive the following error message:

 

TABLE_HEADING_SHIPPING_METHOD

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/tacticax/public_html/shop/osc/checkout_shipping.php:66) in /usr/home/tacticax/public_html/shop/osc/includes/functions/general.php on line 29

 

Any help in this regard would be greatly appreciated

Share this post


Link to post
Share on other sites
I believe this will work:
snip

If you want multiple lines of text, you could use the Text Box instead:

.snip

where 55 is the point at which text will try to wrap, 60 is the width, and 3 is the number of lines.

 

Regards

Jim

I used your first suggestion which is great as I can now see the whole product name without any problem :D

 

Thank you again Jim :D

 

Best regards

 

Steve :)


____________________________________________________________________

____________________________________________________________________

Share this post


Link to post
Share on other sites

First I would like to say thanks to everyone -- :)

 

Next here's my challenge -- I've integrated MVS into CRE615 -- I got the checkout and admin side working but now I am having trouble with create_account.php and account_info.php.

 

When someone goes to create an account they get a blank page. Then when someone tries to view their account history I'm getting "The page isn't redirecting properly" in the browser.

 

I've just got these last two issues to clear up and I think I can go live and thought someone else might have had something similar or would be able to point me in the right direction. :)

 

Thanks in advance for your help

 

V

Share this post


Link to post
Share on other sites
First I would like to say thanks to everyone -- :)

 

Next here's my challenge -- I've integrated MVS into CRE615 -- I got the checkout and admin side working but now I am having trouble with create_account.php and account_info.php.

 

When someone goes to create an account they get a blank page. Then when someone tries to view their account history I'm getting "The page isn't redirecting properly" in the browser.

 

I've just got these last two issues to clear up and I think I can go live and thought someone else might have had something similar or would be able to point me in the right direction. :)

 

Thanks in advance for your help

 

V

Since MVS doesn't modify either of these files, it's difficult to guess. The error your getting suggests that you have a "redirect" somewhere that is creating yet another "redirect", this can happen when a redirect sends one to a page that does not find(during any error checking in the code) right back to where one came from.

 

The blank screen can be just about any code error, so that could be difficult to find. Considering there aren't that many files being modified with MVS, I would say you have probably added code to a template file that went wrong. Double check your edits in the "content" section in the templates folder and make sure that each file has no code errors, or the wrong portion of the code to be added there.

 

Cre can be difficult to work mostly because of the template system already in place, just back track your installation and you will find it.

 

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
Hi again,

 

I am trying to add a product weights attribute contribution however it is not working and I believe that it probably has to do with the MVS contribution. I think that the weight is being entered but not sent through to vendors_shipping correctly.

[snip...]

Ending Line 108.

 

If anyone has any idea where I need to make the modification for this to correctly work with MVS, I will be eternally greatful!!!!!

 

Thanks in advance!

What you need to do is install the code for the attribute weights into the MVS section of the code that is added to includes/classes/shopping_cart.php. Look for the block that collects the product information and you will see the bits of code that are alike.

 

You must add the same code here as was added to the normal includes/classes/shopping_cart.php file in order for things to work properly.

 

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
Since MVS doesn't modify either of these files, it's difficult to guess. The error your getting suggests that you have a "redirect" somewhere that is creating yet another "redirect", this can happen when a redirect sends one to a page that does not find(during any error checking in the code) right back to where one came from.

 

The blank screen can be just about any code error, so that could be difficult to find. Considering there aren't that many files being modified with MVS, I would say you have probably added code to a template file that went wrong. Double check your edits in the "content" section in the templates folder and make sure that each file has no code errors, or the wrong portion of the code to be added there.

 

Cre can be difficult to work mostly because of the template system already in place, just back track your installation and you will find it.

 

Good luck, Craig :)

 

Thanks for the advice -- I figured I would have to back track (ugh) but wanted to ask before I started just on the off-chance someone else may have had this happen to them. :) I took pretty good notes and know I have to concerned with the catalog files not the admin side since this only started happening when I applied the changes to those files.

Share this post


Link to post
Share on other sites
What you need to do is install the code for the attribute weights into the MVS section of the code that is added to includes/classes/shopping_cart.php. Look for the block that collects the product information and you will see the bits of code that are alike.

 

You must add the same code here as was added to the normal includes/classes/shopping_cart.php file in order for things to work properly.

 

Craig :)

Ok cool, thanks for the info. I see what you mean and I had a go at trying to do this but no luck just yet (close though!)

 

The code in the prod attribute contribution in shopping_cart.php is :

 

// 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'])) {
	  }
	}
  }
}00

 

First I copied all of that to the MVS file at around Line 333 and made it look like this :

 

		// Add/subtract attributes prices (if any)
// 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'])) {
	  }
	}
  }

  return $this->vendor_shipping;
}
//MVS End00

 

Unfortunately that didn't seem to work. I tried a few changes here and there like adding vendor_shipping after $this-> as it is in your code, however that didn't really achieve anything

 

// 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->vendor_shipping[$vendors_id]['cost'] += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
		} else {
		  $this->vendor_shipping[$vendors_id]['cost'] -= $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->vendor_shipping += ($qty * $attribute_price['options_values_weight']);
		} // END if(!empty($attribute_price['options_values_weight'])) {
	  }
	}
  }00
  return $this->vendor_shipping;
}
//MVS End00

 

I was wondering if you might be able to take a look and see where I am going wrong please? I can also give you a login and a test example on my site if you want.

 

Thanks a lot Craig, I really appreciate your time :)

 

- Mark

Edited by MSP

Share this post


Link to post
Share on other sites
First I would like to say thanks to everyone -- :)

 

Next here's my challenge -- I've integrated MVS into CRE615 -- I got the checkout and admin side working but now I am having trouble with create_account.php and account_info.php.

 

When someone goes to create an account they get a blank page. Then when someone tries to view their account history I'm getting "The page isn't redirecting properly" in the browser.

 

I've just got these last two issues to clear up and I think I can go live and thought someone else might have had something similar or would be able to point me in the right direction. :)

 

Thanks in advance for your help

 

V

 

I would just like to follow-up and let everyone know what I did wrong in the hopes it will help someone else in the future.

 

And it was a simple error that anyone could have made -- I over wrote the language files with the wrong file named the same as in the top file -- so while I was doubling checking all the other files they checked out and those were the last files I checked (ugh). But I've got it all working so far and I'm still tweaking but its believe everyone about the backup, backup, backup -- also I've found taking notes as I go along helps if I have to go and backtrack my steps through the code.

 

Additionally something that has been a extremely helpful tool and timesaver is WinMerge -- if you're doing this then getting a good file comparison tool is a MUST HAVE!

 

I hope this helps others in the future.

Share this post


Link to post
Share on other sites

Fedex shipping discrepencies -- I have searched through the shipping thread but wanted to ask while I continue to search for the answer.

 

I proudly say I've got the MVS contribution working with CRELoaded 615 -- whew -- now I've turned my attention to the FedEx shipping module -- it doesn't seem to be giving accurate pricing for the shipping.

 

Does anyone know how to make this more accurate within this module?

 

Thanks in advance,

 

Vanessa

Share this post


Link to post
Share on other sites

I'm pulling out my hair!!!! I thought I was finished -- I thought everything was working until I tried using the credit card payment option. Note, Authorize.net was working before I added the front end of MVS so I'm not sure where the issue was introduced -- I'm going to continue looking through the forums but I'm asking this now in case someone else can give me feedback.

 

Note, I'm using a creLoaded 615 --

 

Thanks in advance for help you can offer.

Share this post


Link to post
Share on other sites
I'm pulling out my hair!!!! I thought I was finished -- I thought everything was working until I tried using the credit card payment option. Note, Authorize.net was working before I added the front end of MVS so I'm not sure where the issue was introduced -- I'm going to continue looking through the forums but I'm asking this now in case someone else can give me feedback.

 

Note, I'm using a creLoaded 615 --

 

Thanks in advance for help you can offer.

 

The+server+cannot+connect+to+Authorize.net.++Please+check+your+cURL+and+server+s

ettings

 

The problem is the setting are the same as they were when working prior to installing MVS -- ack -- I don't know where to look for the answer. Anyone with feedback?

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

×