Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

I put some test numbers into this, and I'm seeing the Insurance being added to the shipping cost. I have no idea why yours isn't. I can only suggest you put some Print statements in (or file logging or mail if you are on a live site) and try to find the values that are not properly set.

 

Regards

Jim

Jim,

 

How did you put test numbers into it? I'm working on a "sandbox" site until I have everything working. Any suggestions where to put print statements? I have PHP error logging turned on so I can see errors on my sandbox, but I'm not getting any.

 

Thanks,

Rick

Share this post


Link to post
Share on other sites
I put some test numbers into this, and I'm seeing the Insurance being added to the shipping cost. I have no idea why yours isn't. I can only suggest you put some Print statements in (or file logging or mail if you are on a live site) and try to find the values that are not properly set.

 

Regards

Jim

Jim,

 

It's working now. After my last reply, I went back to admin, set insurance to false, updated and then set insurance to true and updated again, now it's working. I'm going to do a bit more testing, but Ithink it's ready for my live store.

 

Thanks for your help,

Rick

Share this post


Link to post
Share on other sites
Jim,

 

How did you put test numbers into it? I'm working on a "sandbox" site until I have everything working. Any suggestions where to put print statements? I have PHP error logging turned on so I can see errors on my sandbox, but I'm not getting any.

 

Thanks,

Rick

I don't have a valid USPS password, so I faked the return quote with a fixed number in the code. Given that the quote without insurance was always $30.00 (my test figure) and the product cost was $489.99, the total came out to $36.40. According to usps.com, the insurance for that value should be $6.40, so the numbers add up.

 

I put in these print statements -- Line 175:

print 'Cost per package: ' . $costperpkg . "<br>\n";

and Line 207

print 'Insurance: ' . $insurance . "<br>\n";

Those values were being set properly, so the output should have been correct. Which it was. You might need to add in some more checkpoints depending on what you see from those two. This is my normal debugging mode (once I get all of the typos that the validator finds.) There's nothing like knowing what all of those constants and variables are really set to.

 

Regards

Jim

 

Edit: Too slow again. Oh well, glad to hear that you got it working.

Edited by kymation

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

Share this post


Link to post
Share on other sites
I put in these print statements -- Line 175:
print 'Cost per package: ' . $costperpkg . "<br>\n";

and Line 207

print 'Insurance: ' . $insurance . "<br>\n";

Those values were being set properly, so the output should have been correct. Which it was. You might need to add in some more checkpoints depending on what you see from those two. This is my normal debugging mode (once I get all of the typos that the validator finds.) There's nothing like knowing what all of those constants and variables are really set to.

 

Regards

Jim

 

Edit: Too slow again. Oh well, glad to hear that you got it working.

Jim,

 

Thanks for the trouble shooting tips, I'm never sure where to put things like print statements. Maybe this will help me learn to better find my errors.

 

It seems the real problem was, insurance was always on/true, not off/false as I thought. I think adding the $vendors_id to line 227 solved the problem and I just didn't see it because I was looking for insurance to come on, not go off. Anyway, thanks again for your help.

 

P.S. Are you working on any new modules at this time?

 

Thanks again,

Rick

Share this post


Link to post
Share on other sites
Rick,

 

Can you possibly send me your usps.php file? Thanks

Drillsar,

 

Don't know if you're following this thread this morning, but I've got it working now.

 

With my usps.php, goto line 177 and fix the typo

if (($maxins == 0) || (constant('MODULE_SHIPPING_USPS_INSURE_' . $vendors_is) == 'False')) {

Should be

if (($maxins == 0) || (constant('MODULE_SHIPPING_USPS_INSURE_' . $vendors_id) == 'False')) {

Then look at line 227. You'll see this

$uspsQuote = $this->_getQuote();

Change it to

$uspsQuote = $this->_getQuote($vendors_id);

Jim spotted that last change and I think that's what made it work for me.

 

Also, if you want the admin sort order to work, apply the fix I posted earlier in this thread. Like Jim says, it shouldn't work, but it does. Go figure.

 

Hope this helps,

Rick

Share this post


Link to post
Share on other sites
what does admin sort order do?

Drillsar,

 

What Sort Order is supposed to do is give you control over the priority of the module at checkout. In other words, if you have 3 shipping modules installed, USPS, UPS & FedEX. You allow all 3 methods but you prefer USPS. Set the Sort Order for USPS to a lower number than UPS or FedEX and USPS will be selected as the default shipping method. That's how it's supposed to work. However, in several places this doesn't work, but I think in the Vendor Shipping modules it does.

 

Rick

Share this post


Link to post
Share on other sites

Rick

 

I'm supposed to be working on the shipping estimator. I've got it doing what I want for the contents of the shopping cart, and am working on getting it to work for individual products from the product_info page. Well, I should be doing all of that, but mostly I'm getting interrupted to fix things my clients have broken, and to booby-trap part of the admin to catch them when they break it again. Grrr.

 

I've also half-started another shipping module (R&L Freight.) That's a low priority, so don't expect it anytime soon. Unless someone waves large amounts of money in my face.

 

The shipping checkout will always highlight the cheapest shipping method, no matter where it is on the list. You can put UPS at the top of the list and FedEx at the bottom, but if FedEx is cheapest, that's what will be selected by default. The customer will then do whatever they want, anyway. So it goes.

 

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
Rick

 

I'm supposed to be working on the shipping estimator. I've got it doing what I want for the contents of the shopping cart, and am working on getting it to work for individual products from the product_info page. Well, I should be doing all of that, but mostly I'm getting interrupted to fix things my clients have broken, and to booby-trap part of the admin to catch them when they break it again. Grrr.

 

I've also half-started another shipping module (R&L Freight.) That's a low priority, so don't expect it anytime soon. Unless someone waves large amounts of money in my face.

 

The shipping checkout will always highlight the cheapest shipping method, no matter where it is on the list. You can put UPS at the top of the list and FedEx at the bottom, but if FedEx is cheapest, that's what will be selected by default. The customer will then do whatever they want, anyway. So it goes.

 

Regards

Jim

 

Jim,

 

I downloaded MVS Shipestimator v1.1b a week or so ago, it's my next project. Is that the one you're working on?

 

Rick

Share this post


Link to post
Share on other sites
Jim,

 

I downloaded MVS Shipestimator v1.1b a week or so ago, it's my next project. Is that the one you're working on?

 

Rick

 

 

I too have tried messing with that contrib.

I have it working well with all shipping modules EXCEPT for UPS XML

Unfortunately, I can not get any type of quotes from that module and without it, the shipping estimator is useless to me.

 

Have you had any luck with the UPS XML shipping module returning quotes Jim?


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites

That's the version I'm working on. I'm currently having problems with getting UPSXML to work at all, under any circumstances. It's giving me an Invalid Document error. Bleah. I gave up on it for a bit to try to get some other things working.

 

There is a security/global variable issue in ship_estimator.php. If you are running this on a live site, I would recommend adding this code to the top:

  switch (true) {
case isset($_GET['action']):
  $action = $_GET['action'];
break;
case isset($_POST['action']):
  $action = $_POST['action'];
break;
default:
  $action = '';
 }
 $action = preg_replace("(\r\n|\n|\r)", "", $action);  // Remove CR &/ LF
 $action = preg_replace("/[^a-z_]/i",'', $action); // Strip anything we don't want

Why the code uses both POST and GET to pass the action is beyond me. Oh well, it works.

 

Actually, the thing that really surprises me is my initials on v1.0. I don't remember doing this. At all. Ever. Either my memory is worse than I thought, or ... I can't think of any other reasonable explanation. Drat.

 

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
Line 129: $colissimo_tables should be $colissimo_table -- that's probably the error that is causing you to not get a price.

 

Line 144: $handling_charge should be $handling -- that will just miss the handling charge in certain cases.

 

Please let us know if this works or not.

 

Regards

Jim

 

OK! you were right! Thank you Jim

 

It finally works... i'll make some tests and add it to contributions.

 

I just wonder... Is there a windows software working with MVS? Something like "Store Manager" for Oscomerce.

Share this post


Link to post
Share on other sites

I have still an error with taxes now...

 

They are not included in chechout_shipping.php

 

While my code seems to be correct:

 

$this->tax_class = constant('MODULE_SHIPPING_COLISSIMO_TAX_CLASS_' . $vendors_id);
  if ($this->tax_class($vendors_id) > 0) {
	   $this->quotes['tax'] = tep_get_tax_rate($this->tax_class($vendors_id), $order->delivery['country']['id'], $order->delivery['zone_id']);
  }

  if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_COLISSIMO_INVALID_ZONE;

  return $this->quotes;
}

 

and in function install:

 

	  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Code TVA', 'MODULE_SHIPPING_COLISSIMO_TAX_CLASS_" . $vendors_id . "', '0', 'Choisir le code TVA en fonction du taux', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now(), '" . $vendors_id . "')");

 

In admin panel, it's ok. I can set Taxes. So what's wrong ?

Share this post


Link to post
Share on other sites
That's the version I'm working on. I'm currently having problems with getting UPSXML to work at all, under any circumstances. It's giving me an Invalid Document error. Bleah. I gave up on it for a bit to try to get some other things working.

 

There is a security/global variable issue in ship_estimator.php. If you are running this on a live site, I would recommend adding this code to the top:

  switch (true) {
case isset($_GET['action']):
  $action = $_GET['action'];
break;
case isset($_POST['action']):
  $action = $_POST['action'];
break;
default:
  $action = '';
 }
 $action = preg_replace("(\r\n|\n|\r)", "", $action);  // Remove CR &/ LF
 $action = preg_replace("/[^a-z_]/i",'', $action); // Strip anything we don't want

Why the code uses both POST and GET to pass the action is beyond me. Oh well, it works.

 

Actually, the thing that really surprises me is my initials on v1.0. I don't remember doing this. At all. Ever. Either my memory is worse than I thought, or ... I can't think of any other reasonable explanation. Drat.

 

Regards

Jim

Jim, Cigarsforless,

 

I just installed this on my test store yesterday, late afternoon and so far it seems to work OK. I use the standard UPS module, not the UPSXML module, tho I'm not sure why. What advantage does the UPSXML module have over the standard/non-XML module?

 

Jim,

 

Thanks for the code, I'll add it to my site today.

 

Thanks,

Rick

Share this post


Link to post
Share on other sites
I have still an error with taxes now...

<snip>

In admin panel, it's ok. I can set Taxes. So what's wrong ?

That code looks correct to me. You'll need to trace the tax value through the code to see where it's getting lost.

 

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
That's the version I'm working on. I'm currently having problems with getting UPSXML to work at all, under any circumstances. It's giving me an Invalid Document error. Bleah. I gave up on it for a bit to try to get some other things working.

Jim,

 

I have this installed now and everything seems to work well except for the [CLOSE WINDOW] button. There is no close windows button in my Ship Estimator window. Do you have the button?

 

Thanks,

Rick

Share this post


Link to post
Share on other sites
Jim, Cigarsforless,

 

I just installed this on my test store yesterday, late afternoon and so far it seems to work OK. I use the standard UPS module, not the UPSXML module, tho I'm not sure why. What advantage does the UPSXML module have over the standard/non-XML module?

 

Jim,

 

Thanks for the code, I'll add it to my site today.

 

Thanks,

Rick

 

the UPSXML module also displays an Estimated Delivery Date after the listed methods

eg:

 

United Parcel Service (XML) (1 pkg x 1.5 lbs total)

UPS Ground, Estimated Delivery Date: Feb 12, 2008 $8.29

UPS 3 Day Select, Estimated Delivery Date: Feb 11, 2008 $16.89

UPS 2nd Day Air, Estimated Delivery Date: Feb 08, 2008 $21.74

UPS Next Day Air Saver, Estimated Delivery Date: Feb 07, 2008 $45.27

UPS Next Day Air Early A.M., Estimated Delivery Date: Feb 07, 2008 $83.31

UPS Next Day Air, Estimated Delivery Date: Feb 07, 2008 $49.53


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites
Jim,

 

I have this installed now and everything seems to work well except for the [CLOSE WINDOW] button. There is no close windows button in my Ship Estimator window. Do you have the button?

 

Thanks,

Rick

 

The close window link is easy enough!

Below is a snip of my code from catalog/ship_estimator.php

 

 

  // if there is nothing in the customers cart, redirect them to the shopping cart page
 if ($cart->count_contents() < 1) {
?>
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
	  </tr>
	 <tr>
		<td colspan="2" align="center" class="pageHeading"><b><?php echo 'There is nothing in your cart for a shipping estimate, please close this window and select a product.'; ?></b>
		</td>
	 </tr>
<?php }
 ?>
	</table></td>
  </tr>
  <tr>
	  <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '10'); ?></td>
  </tr>
	  <tr class="infoBoxContents">
		<td class="main"><p align="center"><?php echo '<a href="java script:window.close()">Close Window</a>'; ?><br /><br /></p>
<br><br>
<?php

if ($debuger == 'yes') {

 

You just need to add the following where you want it to display

 

 

			<p align="center"><?php echo '<a href="java script:window.close()">Close Window</a>'; ?><br /><br /></p>

 

NOTE: in code above is should be javascript NOT java script

Edited by cigarsforless

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites

Rick: The close button is there, it's just in the wrong location -- look in the images folder. You need to move it to catalog/includes/languages/english/images/buttons.

 

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
Rick: The close button is there, it's just in the wrong location -- look in the images folder. You need to move it to catalog/includes/languages/english/images/buttons.

 

Regards

Jim

Jim,

 

I have the button graphic and it's in the right place, now, but I don't have the button in the Ship Estimate window. I've looked at ship_estimate.php

 

Thanks,

Rick

Share this post


Link to post
Share on other sites
Jim,

 

I have the button graphic and it's in the right place, now, but I don't have the button in the Ship Estimate window. I've looked at ship_estimate.php

 

Thanks,

Rick

I think I had to fix that too. Sorry. You need to change the close line to

<?php echo '<a href="java script:window.close()">' . tep_image_button('button_close_window.jpg', IMAGE_BUTTON_CLOSE) . '</a>'; ?>

 

Sorry I can't give you a line number. Eclipse crashed on me (again) and lost its memory, so I'm trying to do a restore. Just look for the java script:window.close() and put the tep_image_button() call after it.

 

Regards

Jim


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

Share this post


Link to post
Share on other sites
Jim,

 

I have the button graphic and it's in the right place, now, but I don't have the button in the Ship Estimate window. I've looked at ship_estimate.php

 

Thanks,

Rick

 

I had the same problerm. If I remember correctly it has nothing to do with ship_estimate.php. You need to add code from the readme in either the box or the shopping_cart.php (I call the estimator from a box only). Did you add the javascrript? You must access the page from the buuton on the shopping_cart.php or your box to have the close button function. Just navigating to the ship_estimate.php page won't allow you to use the close button as you never poped up to get the window.

 

-Kendall


Kendall

Brooklyn, New York USA

Share this post


Link to post
Share on other sites

MVS Shipping V1.1b

 

Interesting - didn't log in and put an Item in the cart....hit the process button was able to get the ship estimator to work fine....hit the estimate shipping button on the page (leaving the page open) and then logged in - went back to the estimator page and re-type in the zip code...it worked all info from logged in customer was transferred. Now if I just log in and add something to the cart and try to get an estimate it still just freezes....any help on this is greatly appreciated!!

 

Pete

Share this post


Link to post
Share on other sites
I had the same problerm. If I remember correctly it has nothing to do with ship_estimate.php. You need to add code from the readme in either the box or the shopping_cart.php (I call the estimator from a box only). Did you add the javascrript? You must access the page from the buuton on the shopping_cart.php or your box to have the close button function. Just navigating to the ship_estimate.php page won't allow you to use the close button as you never poped up to get the window.

 

-Kendall

Kendall,

I am accessing the Ship Estimator from my cart, not by calling the page directly. The pop-up is working. Shipping estimates are good, just no close button.

 

Jim,

When you get Eclipsed fixed maybe you can send me the line number and stuff. The code you posted didn't work. I found 2 close() statement and tried it on both, but no go.

 

Thanks,

Rick

Share this post


Link to post
Share on other sites
MVS Shipping V1.1b

 

Interesting - didn't log in and put an Item in the cart....hit the process button was able to get the ship estimator to work fine....hit the estimate shipping button on the page (leaving the page open) and then logged in - went back to the estimator page and re-type in the zip code...it worked all info from logged in customer was transferred. Now if I just log in and add something to the cart and try to get an estimate it still just freezes....any help on this is greatly appreciated!!

 

Pete

I still can't get UPSXML to cooperate. It's now returning "111510: Unsupported packaging requested." I have no idea what that means. This is working on the live site with a previous version of UPSXML, so I suspect there is something wrong in this version. I'm going back to figuring out the shipping estimator. Sorry I couldn't help.

 

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

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

×