Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

The only problem with this is that if the Vendor assigned to multiple products that are in the cart has a shipping module installed such as flat, item or one that is per product not by weight, the customer will still be charged for shipping the item.

 

I should have posted this last week when I happened across this to fix an issue I was dealing with that ultimately is the same thing you are dealing with. I also have not tested this thoroughly, so it is possible that it will cause other issues. Maybe something to play with.

 

In catalog/includes/classses/shopping_cart.php, find the query in the MVS added code:

 

What this will do is remove the product(with a weight of whatever you set it to, here it is zero) from the array that is built to count and get shipping quotes for. The only problem with this is that it will not show in the shipping selection page along with any other products that are in the cart. Note, all we are doing is adding to the "where" clause in the query, checking for whatever weight limit you want.

 

How this will handle a scenario such as the only product in the cart is a zero weight product or something of that nature, I am not sure.

 

If you play with this, let me know what your results are.

 

Craig :)

 

What you say is probably true, however in my scenario only wholesale customers will ever have zero weight items in their cart, and all those items will be zero weight (something else dawns on me here- I'm using Separate Pricing Per Customer for this, maybe I can use customer groups to skip shipping and payment. It's not really something I'd considered before). There only shipping module assigned to the vendor is "Flat Rate- $0.00" so that's ok as it's true. These items aren't being shipped per se, but they are delivered at no extra charge.

 

Since the check for shipping method selection only applies to retail customers, what I should do is use SPPC to do the check for MVS (ie, if customer group = retail, do the check). I think this will cover me for pretty much anything. For now.

 

My biggest problem with this right now is the order showing up as non-MVS in the backend. I was hoping to use the MVS vendor email send function for wholesale orders, but if the vendor id is never assigned to the products (or whatever it is that isn't happening), then this can't happen as far as I can tell. I actually had a test order go through that had the appearance of being an MVS order, but the product didn't display in the order details table (very, very weird).

 

Thanks for the help

Stew

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.

Link to comment
Share on other sites

This is getting really weird. For zero weight orders I'm getting different results depending on I don't know what- sometimes I get stuck in a loop, sometimes not.

 

Right now on checkout_shipping.php I've got

 

// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
// This section commented out for Zero Weight Skips Shipping
/*
 if ($order->content_type == 'virtual') {
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
$shipping = false;
$sendto = false;
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 }
 */

// IFD MOD_SQUAD BEGIN: zero weight should skip shipping page

$total_weight = $cart->show_weight();
$total_count = $cart->count_contents();

// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
if (($order->content_type == 'virtual') ||
 ($order->content_type == 'virtual_weight') ||
 ($total_weight == 0 )) {
  if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
  //$shipping = false;
  //$sendto = false;
  tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
// IFD MOD_SQUAD END

 

where the stock code is found in that file, and in checkout_payment.php I have

 

//this is stock code
 //but it's duplicated by IFD code below
 //$total_weight = $cart->show_weight();
 //$total_count = $cart->count_contents();

 // IFD MOD_SQUAD BEGIN: zero weight should skip shipping page

$total_weight = $cart->show_weight();
$total_count = $cart->count_contents();

// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
if (($order->content_type == 'virtual') ||
 ($order->content_type == 'virtual_weight') ||
 ($total_weight == 0 )) {
  //if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
  //$shipping = false;
  //$sendto = false;
  tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}
// IFD MOD_SQUAD END

// MVS v4.0
//if no shipping method has been selected, redirect the customer to the shipping method selection page
if (($cart->content_type !== 'virtual') ||
 ($total_weight > 0 )){
if (count($shipping['vendor']) != count($cart->vendor_shipping)) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED_SELECTED . ERROR_NO_SHIPPING_SELECTED_SELECTED_MORE, 'SSL'));
}
} //MVS end

 

directly above

 

// load all enabled payment modules
 require(DIR_WS_CLASSES . 'payment.php');
 $payment_modules = new payment;

 

and it seems to work ok? Although at this point I'm sure of nothing.

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.

Link to comment
Share on other sites

This is getting really weird. For zero weight orders I'm getting different results depending on I don't know what- sometimes I get stuck in a loop, sometimes not.

 

Right now on checkout_shipping.php I've got

 

// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
// This section commented out for Zero Weight Skips Shipping
/*
 if ($order->content_type == 'virtual') {
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
$shipping = false;
$sendto = false;
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 }
 */

// IFD MOD_SQUAD BEGIN: zero weight should skip shipping page

$total_weight = $cart->show_weight();
$total_count = $cart->count_contents();

// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
if (($order->content_type == 'virtual') ||
 ($order->content_type == 'virtual_weight') ||
 ($total_weight == 0 )) {
  if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
  //$shipping = false;
  //$sendto = false;
  tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
// IFD MOD_SQUAD END

 

where the stock code is found in that file, and in checkout_payment.php I have

 

//this is stock code
 //but it's duplicated by IFD code below
 //$total_weight = $cart->show_weight();
 //$total_count = $cart->count_contents();

 // IFD MOD_SQUAD BEGIN: zero weight should skip shipping page

$total_weight = $cart->show_weight();
$total_count = $cart->count_contents();

// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
if (($order->content_type == 'virtual') ||
 ($order->content_type == 'virtual_weight') ||
 ($total_weight == 0 )) {
  //if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
  //$shipping = false;
  //$sendto = false;
  tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}
// IFD MOD_SQUAD END

// MVS v4.0
//if no shipping method has been selected, redirect the customer to the shipping method selection page
if (($cart->content_type !== 'virtual') ||
 ($total_weight > 0 )){
if (count($shipping['vendor']) != count($cart->vendor_shipping)) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED_SELECTED . ERROR_NO_SHIPPING_SELECTED_SELECTED_MORE, 'SSL'));
}
} //MVS end

 

directly above

 

// load all enabled payment modules
 require(DIR_WS_CLASSES . 'payment.php');
 $payment_modules = new payment;

 

and it seems to work ok? Although at this point I'm sure of nothing.

 

Doesn't this code skip payment selection? Your redirect after the first check for "virtual" products is

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

Which would go directly to the confirmation page, no payment screen, not necessarily a bad thing as long as the payment module still loads properly.

 

I have also seen orders not get set in the "orders_shipping" table and have not had the time to hunt down why, something I will need to do soon.

 

If you happen to find it before I do, let me know.

 

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: [email protected]

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!

Link to comment
Share on other sites

Doesn't this code skip payment selection? Your redirect after the first check for "virtual" products is

Which would go directly to the confirmation page, no payment screen, not necessarily a bad thing as long as the payment module still loads properly.

 

I have also seen orders not get set in the "orders_shipping" table and have not had the time to hunt down why, something I will need to do soon.

 

If you happen to find it before I do, let me know.

 

Craig :)

 

Yes- shipping skips to payment, payment skips to confirmation. The way I have it set up, shipping and billing info loads along with the payment module. This is, in fact, what I want to be able to do. Wholesale customers have no reason to see these pages.

 

Information in "orders_shipping" not being set has only happened to me in this environment (skipping shipping). Where is this supposed to happen? For me it might be as simple as re-arranging the code a bit.

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.

Link to comment
Share on other sites

Yes- shipping skips to payment, payment skips to confirmation. The way I have it set up, shipping and billing info loads along with the payment module. This is, in fact, what I want to be able to do. Wholesale customers have no reason to see these pages.

 

Information in "orders_shipping" not being set has only happened to me in this environment (skipping shipping). Where is this supposed to happen? For me it might be as simple as re-arranging the code a bit.

We designed MVS to only skip the db update when MVS was not enbled, which is why I am a bit perplexed. Will have to hunt that down.

 

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: [email protected]

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!

Link to comment
Share on other sites

I am a bit stumped.

 

I have MVS working well enough to use it on my live store, just a few small glitches that I can live with but would like to get fixed soon.

 

My biggest complaint is the products are not even showing up on the order page, invoice or packing slip. This is happening on a random basis, different vendors, different products. I found and fixed the bug for attributes not showing up correctly on the order and packing slip. I did the updated packingslip contrib.

 

I just downloaded my orders_products from my database and all the info is there, it just isn't getting to the order page all the time.

 

My second biggest bug is that, again on a seeming random basis the shipping is being skipped completely.

 

I can live with these problems for a while but I hope that someone else has already fixed them.

Life Is Too Short,

Enjoy Your Coffee!

Pete

Link to comment
Share on other sites

I am a bit stumped.

 

I have MVS working well enough to use it on my live store, just a few small glitches that I can live with but would like to get fixed soon.

 

My biggest complaint is the products are not even showing up on the order page, invoice or packing slip. This is happening on a random basis, different vendors, different products. I found and fixed the bug for attributes not showing up correctly on the order and packing slip. I did the updated packingslip contrib.

 

I just downloaded my orders_products from my database and all the info is there, it just isn't getting to the order page all the time.

 

My second biggest bug is that, again on a seeming random basis the shipping is being skipped completely.

 

I can live with these problems for a while but I hope that someone else has already fixed them.

 

I reset my store to not skip the shipping page for wholesale customers and the order went through no problem.

 

IMHO, "shipping being skipped completely" and "products... not even showing up on the order page, invoice or packing slip" are connected somehow.

 

Pete- how often, if ever, do you see these problems occur on the same order?

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.

Link to comment
Share on other sites

New one- I put the redirect to the payment page at the very bottom of checkout_shipping.php, right below the line that requires the footer, and the order goes through mostly ok, but without a shipping module loaded (which is fine for my purposes, but included for informational purposes).

 

It seems like the code that loads includes/modules/vendor_shipping.php

 

 if (SELECT_VENDOR_SHIPPING == 'true') {
require(DIR_WS_MODULES . 'vendor_shipping.php');
 } else { 
$quotes = $shipping_modules->quote();

 

might be involved here. This is smack in the middle of checkout_shipping.php and if the redirect happens before this code is executed, then everything that module does doesn't happen. I don't know enough about how MVS works to say for sure, but that's my theory.

 

Also, I was re-reading the readme.txt and saw this:

 

Now click on Vendors in the left column. This will bring up the Vendor Manager, which is where you

set the information about your vendors (and shipping methods). *Do Not Delete* the first line.

 

I assume by "first line" you mean the vendor with id #1. So what happens if this vendor is deleted? My top vendor has an id of 3.

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.

Link to comment
Share on other sites

New one- I put the redirect to the payment page at the very bottom of checkout_shipping.php, right below the line that requires the footer, and the order goes through mostly ok, but without a shipping module loaded (which is fine for my purposes, but included for informational purposes).

 

It seems like the code that loads includes/modules/vendor_shipping.php

 

 if (SELECT_VENDOR_SHIPPING == 'true') {
require(DIR_WS_MODULES . 'vendor_shipping.php');
 } else { 
$quotes = $shipping_modules->quote();

 

might be involved here. This is smack in the middle of checkout_shipping.php and if the redirect happens before this code is executed, then everything that module does doesn't happen. I don't know enough about how MVS works to say for sure, but that's my theory.

 

Also, I was re-reading the readme.txt and saw this:

I assume by "first line" you mean the vendor with id #1. So what happens if this vendor is deleted? My top vendor has an id of 3.

Stew:

The "Default Vendor" should be kept because we had to "pre-set" the "$vendors_id" in ALL scripts to deal with various issues from php and posted variables. This also insures that all products have a Vendor assigned to them as the default id is 1 when altering the database. This Vendor should be edited to be your shop, with some default shipping module installed to deal with the case of a product being missed during creation and not getting a proper vendor assigned to them.

 

Coffebarn:

It sounds like you missed some edits in admin/orders.php and may have misssed something in catalog/checkout_process.php(there is code here to add data about the order, particular to the vendor and the products from that particular vendor). Double check your db as well, "orders_shipping" should be populated if your using MVS, if it isn't, you definitely missed something in "checkout_process.php".

 

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: [email protected]

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!

Link to comment
Share on other sites

Stew:

The "Default Vendor" should be kept because we had to "pre-set" the "$vendors_id" in ALL scripts to deal with various issues from php and posted variables. This also insures that all products have a Vendor assigned to them as the default id is 1 when altering the database. This Vendor should be edited to be your shop, with some default shipping module installed to deal with the case of a product being missed during creation and not getting a proper vendor assigned to them.

 

Coffebarn:

It sounds like you missed some edits in admin/orders.php and may have misssed something in catalog/checkout_process.php(there is code here to add data about the order, particular to the vendor and the products from that particular vendor). Double check your db as well, "orders_shipping" should be populated if your using MVS, if it isn't, you definitely missed something in "checkout_process.php".

 

Craig :)

 

I found the line I missed in checkout_proccess merged it and IT WORKS!

 

Winmerge is fast and maybe too easy thats the one I used and missed it. Beyond Compare is a little more methodical and I was able to find it fast and merge the line for a quick fix.

Life Is Too Short,

Enjoy Your Coffee!

Pete

Link to comment
Share on other sites

The only problem with this is that if the Vendor assigned to multiple products that are in the cart has a shipping module installed such as flat, item or one that is per product not by weight, the customer will still be charged for shipping the item.

 

I should have posted this last week when I happened across this to fix an issue I was dealing with that ultimately is the same thing you are dealing with. I also have not tested this thoroughly, so it is possible that it will cause other issues. Maybe something to play with.

 

In catalog/includes/classses/shopping_cart.php, find the query in the MVS added code:

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

and replace it with this:

$excluded_weight = EXCLUDED_WEIGHT;
	if (tep_not_null($excluded_weight))  {
	$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 . "' and products_weight > '" . EXCLUDED_WEIGHT . "'"
								  );
	} else {
	$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 . "'"
								  );
 }

then at the top of the same file below this code:

 function restore_contents() {
  global $customer_id;

add

   //mvs remove prod from shipping array if weight = 'CHANGE TO YOUR NEEDS-DEFAULT IS 0'
  define('EXCLUDED_WEIGHT', '0');

What this will do is remove the product(with a weight of whatever you set it to, here it is zero) from the array that is built to count and get shipping quotes for. The only problem with this is that it will not show in the shipping selection page along with any other products that are in the cart. Note, all we are doing is adding to the "where" clause in the query, checking for whatever weight limit you want.

 

How this will handle a scenario such as the only product in the cart is a zero weight product or something of that nature, I am not sure.

 

If you play with this, let me know what your results are.

 

Craig :)

Help me to understand something. We are adding a definition for EXCLUDED_WEIGHT with a value of zero within the function restore_contents(). Okay. Then we are assigning the value of this variable to the variable $excluded_weight (again with a value of zero). Yet we never use this variable, rather we use the value of EXCLUDED_WEIGHT from the definition. What is the purpose of the second assignment, as I cannot see where it is ever referenced again. Did you intend that $excluded_weight would be used in the SQL query?

Link to comment
Share on other sites

Help me to understand something. We are adding a definition for EXCLUDED_WEIGHT with a value of zero within the function restore_contents(). Okay. Then we are assigning the value of this variable to the variable $excluded_weight (again with a value of zero). Yet we never use this variable, rather we use the value of EXCLUDED_WEIGHT from the definition. What is the purpose of the second assignment, as I cannot see where it is ever referenced again. Did you intend that $excluded_weight would be used in the SQL query?

I did it this way to enable creating an easy setting change from within the admin, set your weigt and click, using the configuration table is about the easiest way to add a global variable to be easily changed by the user.

 

I simply forgot to remove the first test bit of code I was working with, seems a bit redundant doesn't it? LOL :blush:

 

I just haven't written the sql yet, want to get it tested and "broken" as much as possible before we alter the database.

 

Craig :blink:

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: [email protected]

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!

Link to comment
Share on other sites

hey craig, just curious as if you ever got a chance to look at the usps.php issue i talked to you about, with the info not being saved to the db...

thanks

Oh man! I have been soooo busy it's not even funny, no I haven't yet, but need to so I can get this module working as well. I will try to make some time to push USPS to let me in to use the "Production" servers so I can actually test this thing without errors that don't apparently appear on these servers but do on the "Test" servers.

 

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: [email protected]

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!

Link to comment
Share on other sites

Zero Weight Skips Shipping-

 

Despite my previous posted problems, I have had a bit of luck with this particular mod. In order to prevent a loop, I've modified the fix for checkout without paying for shipping to look like this:

 

// MVS v4.0
//if no shipping method has been selected, redirect the customer to the shipping method selection page
if (($cart->content_type !== 'virtual') || ($total_weight > 0 )){
if (count($shipping['vendor']) != count($cart->vendor_shipping)) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED_SELECTED . ERROR_NO_SHIPPING_SELECTED_SELECTED_MORE, 'SSL'));
}
} //MVS end

 

Basically what was added in is the

|| ($total_weight > 0 )

 

Maybe this will help others....

 

Okay. I give up. Which file are you modifying?

Link to comment
Share on other sites

Actually, I don't think this works. Why not, I don't know, but more testing is required.

Never mind. I found in a later post which file you were referencing -- namely checkout_payment.php

 

Quck question: If a vendor has been identified at this point (checkout_payment), then would it not be possible to have a specific vendor_id that is unique to free downloadable products (or products that have no charge) and skip the checkout_payment and progress to checkout_confirmation? It seems like this could also be used to validate downloadable products that do have a charge (either from a positive cost value or from a vendor_id that is not designated as a free download vendor).

Link to comment
Share on other sites

Never mind. I found in a later post which file you were referencing -- namely checkout_payment.php

 

Quck question: If a vendor has been identified at this point (checkout_payment), then would it not be possible to have a specific vendor_id that is unique to free downloadable products (or products that have no charge) and skip the checkout_payment and progress to checkout_confirmation? It seems like this could also be used to validate downloadable products that do have a charge (either from a positive cost value or from a vendor_id that is not designated as a free download vendor).

 

Sure. I don't know how, but you can do it. For me, the simplest way to skip the payment page is to check the total weight of items in the cart.

Edited by djmonkey1

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.

Link to comment
Share on other sites

Here's one for you!

 

I just remembered out why I deleted vendor #1 (I should be keeping notes of everything I do on this site)- because I could never get that vendor to work right.

 

I just re-installed vendor #1 using the SQL command from the contribution, and went about configuring it, no problem (I needed to setup a new vendor anyway). Admittedly, I have some weird things installed, including three FedEx modules and two UPSXML modules, but to me that's beside the point as my other vendors have all worked fine despite the oddities. The biggest problem is that a Flat Rate option with a price of $5.00 is showing up on checkout with this vendor if I set the sort order of my FedEx 3 module to anything other than 0. If both are set to 0, then neither show up. Too bad I don't even have a flat rate module installed for this vendor. Basically I can't do anything with the original Flat Rate module, can't even install it, but only for this vendor (I use the original Flat Rate module with other vendors no problem. True to form, I have two, and the vendor that uses both has no problem). And this was happening even before I started installing clone modules. I should have mentioned it then, but such is life.

 

Anyway, that's what I see with vendor #1. Originally it was my "Dry Goods" vendor, but with all the weirdness I input a Dry Goods 2, deleted the original Dry Goods vendor, and everything worked fine.

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.

Link to comment
Share on other sites

Sure. I don't know how, but you can do it. For me, the simplest way to skip the payment page is to check the total weight of items in the cart.

 

Checking total weight would not work in most cases - only if the product is free. However, if someone is offering downloadable products for sale (i.e. ebooks) then checking only if the weight is zero would skip these products for sale. My thoughts are that both weight and price need to be checked.

 

However, my question is relating to the vendor_id. Does skipping both shipping and payment mean that there will be no vendor_id assigned and written to the database? If not, I suppose it would be possible to 'hardcode' a unique vendor_id for free/no-weight products. I also am assuming not skipping the payment section would apply a vendor_id that would be written to the database.

 

Please correct my misconceptions, if any. Thanks.

Link to comment
Share on other sites

Checking total weight would not work in most cases - only if the product is free. However, if someone is offering downloadable products for sale (i.e. ebooks) then checking only if the weight is zero would skip these products for sale. My thoughts are that both weight and price need to be checked.

 

However, my question is relating to the vendor_id. Does skipping both shipping and payment mean that there will be no vendor_id assigned and written to the database? If not, I suppose it would be possible to 'hardcode' a unique vendor_id for free/no-weight products. I also am assuming not skipping the payment section would apply a vendor_id that would be written to the database.

 

What is it that you're trying to do?

Edited by djmonkey1

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.

Link to comment
Share on other sites

What is it that you're trying to do?

Hmmm. I thought I was clear with the question I asked. Let me try to explain and rephrase the question.

 

Virtual products have no weight. However, virtual products may have a cost (i.e. selling ebooks that are downloaded). Hence, weight is not the only consideration when performing checks for payment options (checkout_payment.php). That is why I stated your solution to only check for zero weight would not satisfy the conditions of selling virtual products. Something else would be needed to satisfy conditions of checking for products being sold virtually and for free virtual products. Is this clearer?

 

Now, as to the question, I want to insure that all virtual products are associated with a vendor and that skipping either shipping or payment sections (or both) does not omit, skip or delete this association of a product with a vendor. Perhaps this, too, is clearer.

 

BTW (ZWSS):

The value of the variable 'content_type' would need to be set from the function get_content_type() - at least I believe this to be true. But, I have yet to find where 'content_type' ever gets set to 'virtual_weight'. From the code on my system, the only values I see ever being set are 'mixed', 'physical' and 'virtual'. Please advise where you have this value being set. If it is never being set, I can see no purpose for this condition of the check.

 

Thanks.

Link to comment
Share on other sites

Hmmm. I thought I was clear with the question I asked. Let me try to explain and rephrase the question.

 

Virtual products have no weight. However, virtual products may have a cost (i.e. selling ebooks that are downloaded). Hence, weight is not the only consideration when performing checks for payment options (checkout_payment.php). That is why I stated your solution to only check for zero weight would not satisfy the conditions of selling virtual products. Something else would be needed to satisfy conditions of checking for products being sold virtually and for free virtual products. Is this clearer?

 

Now, as to the question, I want to insure that all virtual products are associated with a vendor and that skipping either shipping or payment sections (or both) does not omit, skip or delete this association of a product with a vendor. Perhaps this, too, is clearer.

 

BTW (ZWSS):

The value of the variable 'content_type' would need to be set from the function get_content_type() - at least I believe this to be true. But, I have yet to find where 'content_type' ever gets set to 'virtual_weight'. From the code on my system, the only values I see ever being set are 'mixed', 'physical' and 'virtual'. Please advise where you have this value being set. If it is never being set, I can see no purpose for this condition of the check.

 

Thanks.

 

My first question, then, is why have someone go through the checkout process for a free downloadable product? If you want personal information prior to download, couldn't you just have a "free downloads" page where people enter their personal info in a form, then are redirected to a download page? This might sound complicated but it would make this whole osC checkout process thing a lot easier.

 

But, if you must soldier on, the answer, I believe, is near at hand.

 

Set up at least two vendors, Vendor Zorg and Vendor Leeloo.

 

Vendor Leeloo is your "perfect" vendor, for all your "good" items. This requires no further discussion.

 

Vendor Zorg is your "bad" vendor, for all your "evil" virtual products. Shipping is never required for these products, so skipping shipping is easy- just set the weight of these items to be 0, use the code supplied for this purpose, and you're off to the payment page. This is where things get hairy, because you want to have payment for some of these items but not for others (this is where the disconnect between us happened- it didn't occur to me that some items were free and others had cost because my scenario for skipping payment is completely different and has nothing to do with the real cost of the items in question). In other words, if all the items are free, skip to confirmation, if not, go on with the page. Here is what I would try on checkout_payment.php:

 

 // BEGIN: zero cost should skip payment page

// if the order contains only free products, forward the customer to the confirmation page as
// payment is not needed
if ($order->info['sub_total'] == 0) {
 tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}
//  END

 

You might need to play with

($order->info['sub_total'] == 0)

as I think that's correct but I'm not positive.

 

I really don't know how this will behave and make absolutely no guarantees. For me, I also have Seperate Pricing Per Customer installed, and this checkout method (skipping shipping and payment) is only used for a class of goods only a certain class of customers can see and for whom only one payment module, essentially check money order, is enabled. The point being that when someone skips payment on my site, a payment module is still loaded. If you're accepting credit card payments and/or other payment options this might make you get stuck in a loop when checkout_confirmation checks for a payment module, if one hasn't loaded properly (especially if your default is credit card). Sorry I hadn't thought of that before but I've gotten so used to SPPC I forget most people don't use it. But, you should be able to modify that check so everything still works.

 

As for virtual_weight, you've asked the question in the ZWSS thread and I believe Lane would be the best person to answer that question.

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.

Link to comment
Share on other sites

 // BEGIN: zero cost should skip payment page

// if the order contains only free products, forward the customer to the confirmation page as
// payment is not needed
if ($order->info['sub_total'] == 0) {
 tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}
//  END

 

You might need to play with

($order->info['sub_total'] == 0)

as I think that's correct but I'm not positive.

Finally got payments to process correctly, with a valid Billing Address populated. Thanks for getting me on the right track, Stew. Actually, I ended up using a combination of the ZWSS contribution with your payment suggestions and a modification of the above. The following code should be inserted into the checkout_payment.php directly above where it says "// load all enabled payment modules".

 

Stew - Note that I needed to change 'sub_total' to 'subtotal'. I got lazy and included both '$order->info' and '$cart->info' in the check.

 

  if ($order->info['subtotal'] == 0 || $cart->info['subtotal'] == 0) {
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
  $shipping = false;
  $sendto = false;
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
 }

I still need to add 2 more modifications to this (actually, I need the help of the experts here) to update the order status from 'Pending' to 'Updated' (or whatever) and to include some form of Payment text both on the order confirmation screen and on the emailed order. Any help would be appreciated.

Link to comment
Share on other sites

Finally got payments to process correctly, with a valid Billing Address populated. Thanks for getting me on the right track, Stew. Actually, I ended up using a combination of the ZWSS contribution with your payment suggestions and a modification of the above. The following code should be inserted into the checkout_payment.php directly above where it says "// load all enabled payment modules".

 

Stew - Note that I needed to change 'sub_total' to 'subtotal'. I got lazy and included both '$order->info' and '$cart->info' in the check.

 

  if ($order->info['subtotal'] == 0 || $cart->info['subtotal'] == 0) {
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
  $shipping = false;
  $sendto = false;
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
 }

I still need to add 2 more modifications to this (actually, I need the help of the experts here) to update the order status from 'Pending' to 'Updated' (or whatever) and to include some form of Payment text both on the order confirmation screen and on the emailed order. Any help would be appreciated.

 

You guys have really been going to town with this, very nice, I like to see lot's of cool mods going on.

 

The order status is set in catalog/checkout_process.php with this

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

and then added to the data array for insertion into the db, note the actual data is from "$order" which is a call from the order class(catalog/includes/classes/order.php), you should be able to add it to any sql update that is functional.

 

Some simple "if"s should be adequate for the confirmation screen and email, you could create a special "order_status" to use for this type of checkout, and then use an if statement to show the text on checkout_success.php and to include in the email(which gets built and sent from checkout_process.php).

 

You should be able to do this part fairly easily, just a search for the apropriate words in these files will lead you to the areas of interest, and viola!, your there.

 

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: [email protected]

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!

Link to comment
Share on other sites

You guys have really been going to town with this, very nice, I like to see lot's of cool mods going on.

 

The order status is set in catalog/checkout_process.php with this

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

and then added to the data array for insertion into the db, note the actual data is from "$order" which is a call from the order class(catalog/includes/classes/order.php), you should be able to add it to any sql update that is functional.

 

Some simple "if"s should be adequate for the confirmation screen and email, you could create a special "order_status" to use for this type of checkout, and then use an if statement to show the text on checkout_success.php and to include in the email(which gets built and sent from checkout_process.php).

 

You should be able to do this part fairly easily, just a search for the apropriate words in these files will lead you to the areas of interest, and viola!, your there.

 

Good luck, Craig :)

Thanks, Craig, for getting me on the right track for these last few changes. I have been successful in getting the information updated and into the orders database with the following code in checkout_process.php.

  if (($order->content_type == 'virtual') && ($order->info['subtotal'] == 0)) {
$order->info['payment_method'] = "Downloadable Product";
$order->info['order_status'] = 4;
 }

However, for some reason, the download link does not appear. Obviously, I am missing some other information that would enable the link to become visible (clickable). I will need to check into this. Again, the information is in the orders database, as expected, with these values.

 

The other code change (as I mentioned in an earlier post) was to checkout_payment.php, as follows:

 

  if ($order->info['subtotal'] == 0) {
if (!tep_session_is_registered('payment')) tep_session_register('payment');
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
 }

There was no need for the original registration of the 'shipping' session, or the shipping variable assignments.

 

If you have an idea how I can get past this final hurdle, please advise.

 

Thanks.

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