Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Estimated Shipping Costs


Recommended Posts

has anybody been able to get the total to refresh if the user changes a country? it has come to my attention many people that visit my site can't count....

Link to comment
Share on other sites

  • Replies 388
  • Created
  • Last Reply

Top Posters In This Topic

has anybody been able to get the total to refresh if the user changes a country? it has come to my attention many people that visit my site can't count....

It does that from the beginning (don't know for the popup version).

Link to comment
Share on other sites

thanks for checking it out wheeloftime :)

 

in the pop up version (from my website, i made no extra modifications):

rates are different in canada/usa than any other country.... the TOTAL rate never refreshes when i go from canada to say, argentina. (the estimated rate does, but total remains the same)

Link to comment
Share on other sites

Hi. The popup shouldn't have any effects on the continue shopping button. The code above looks just like mine, except for the <td class="main"> and the closing </td>. Here is the exact code I have in my shopping_cart.php. Change the above with this and see if the button comes back.

 

<?php
$back = sizeof($navigation->path)-2;
if (isset($navigation->path[$back])) {
?>
			<?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?>
<?php
}
?>

 

Hi, thanks for your reply. I've tried your code, but that puts the 'continue shopping' button above the update button. The other buttons are also placed in <td>'s, which is the original code I think. But anyway, when I replaced it again with the old code, the problem was not there anymore. I don't know why, but maybe something went wrong with uploading the code to the server yesterday.

So it works alright now.

Thanks again.

Link to comment
Share on other sites

Hi, thanks for your reply. I've tried your code, but that puts the 'continue shopping' button above the update button. The other buttons are also placed in <td>'s, which is the original code I think. But anyway, when I replaced it again with the old code, the problem was not there anymore. I don't know why, but maybe something went wrong with uploading the code to the server yesterday.

So it works alright now.

Thanks again.

 

 

Something else is causing this. After some time the button disappears, maybe it has to do with the session (just a guess) and with the "if-statement" in this part of the code in shopping_cart.php??

I'm sorry that I just don't understand enough of php and all the variables to solve this ....... maybe someone else can...

$back = sizeof($navigation->path)-2;
if (isset($navigation->path[$back])) {

Link to comment
Share on other sites

Hi, thanks for great contribution! I just installed the lates popup version but I'm unable to change the layout of the popup window - I updated css, double check the /includes/classes/boxes.php and still no matter what I do in stylesheet, outcome is the same... any ideas?

Absinthe Original Liquor Store

Link to comment
Share on other sites

Hi,

I have installed this great contribution, but after a while It has developed a small problem.

The problem is that the pop-up window is not resizing.

I was wondering if any one had the same problem or know how to fix the problem.

 

Here is the link to my stores:

http://www.bargaincollection.com/shop

and

http://www.bargaincollection.com/tech

 

Thanks in advance.

Regards,

Link to comment
Share on other sites

Hi,

I have installed this great contribution, but after a while It has developed a small problem.

The problem is that the pop-up window is not resizing.

I was wondering if any one had the same problem or know how to fix the problem.

 

Here is the link to my stores:

http://www.bargaincollection.com/shop

and

http://www.bargaincollection.com/tech

 

Thanks in advance.

 

Hi. If you look at your source code, there seems to be several instances where you call javascript. I found at least one other script for a popup window. They might be conflicting with each other and that's why it's not resizing properly. You might need to do some organization of your scripts to make sure they don't conflict.

Link to comment
Share on other sites

Hi. If you look at your source code, there seems to be several instances where you call javascript. I found at least one other script for a popup window. They might be conflicting with each other and that's why it's not resizing properly. You might need to do some organization of your scripts to make sure they don't conflict.

potikyan,

Thank you for your support. I think that you mean the shopping_cart.php file. If this is true, I just checked that file and that file only has the javascript for this module.

Here are the javascript codes that I have on that file:

 

Following is in the head tag:

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=no,copyhistory=no,width=450,height=300,screenX=150,screenY=250')
}
//--></script>

 

Following is for the link:

<!-- BEGIN estimated shipping -->
<tr><td align=right cellpadding="2" height=2 colspan="2" class="smallText"><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_SHIPPING) . '\')">' . '<img src="images/icons/shipcost.gif" border="0"> ' . TEXT_SHIPPING_COST . '</a>'; ?></td></tr>
<!-- END estimated shipping -->

Those are the only javascript codes I have on my shopping_cart.php.

 

Please correct me if I'm wrong.

Thanks

Regards,

Link to comment
Share on other sites

My script code reads like this:

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=no,copyhistory=no,width=350,height=300,screenX=150,screenY=250')

}

//--></script>

 

What is the & #39; in yours for? Did you customize it for something or is it an error?

cdickson

Link to comment
Share on other sites

potikyan,

Thank you for your support. I think that you mean the shopping_cart.php file. If this is true, I just checked that file and that file only has the javascript for this module.

Here are the javascript codes that I have on that file:

 

Following is in the head tag:

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=no,copyhistory=no,width=450,height=300,screenX=150,screenY=250')
}
//--></script>

 

Following is for the link:

<!-- BEGIN estimated shipping -->
<tr><td align=right cellpadding="2" height=2 colspan="2" class="smallText"><?php echo '<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_SHIPPING) . '\')">' . '<img src="images/icons/shipcost.gif" border="0"> ' . TEXT_SHIPPING_COST . '</a>'; ?></td></tr>
<!-- END estimated shipping -->

Those are the only javascript codes I have on my shopping_cart.php.

 

Please correct me if I'm wrong.

Thanks

 

Hi. Your shopping_cart.php only contains one javascript instance, but when the page is loaded in your browser, your shopping cart page calls other pages to load, such as header, footer, etc... These files also contain script code that may be conflicting with your popup window script for the shipping estimator. The one that's actually doing this is a command in your shopping cart php file that calls for the file: /shop/includes/sts_templates/white_red/sts_osc_javascript.js. The first script in this file contains the same function popupWindow(url) command which conflicts with your script. To fix, do the following:

 

in shopping_cart.php change

<script language="javascript"><!--
function popupWindow(url) {
window.open(url,'popupWindow'

 

To the following

<script language="javascript"><!--
function popupWindow2(url) {
window.open(url,'popupWindow2'

 

AND change

href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_SHIPPING)

 

to the following

href="javascript:popupWindow2(\'' . tep_href_link(FILENAME_POPUP_SHIPPING)

 

This will basically change the popup window name from popupWindow to popupWindow2. You can also name it anything else you want, as long as all required windows are named the same.

 

This should work.

 

Gary

Link to comment
Share on other sites

Hi. Your shopping_cart.php only contains one javascript instance, but when the page is loaded in your browser, your shopping cart page calls other pages to load, such as header, footer, etc... These files also contain script code that may be conflicting with your popup window script for the shipping estimator. The one that's actually doing this is a command in your shopping cart php file that calls for the file: /shop/includes/sts_templates/white_red/sts_osc_javascript.js. The first script in this file contains the same function popupWindow(url) command which conflicts with your script. To fix, do the following:

 

in shopping_cart.php change

<script language="javascript"><!--
function popupWindow(url) {
window.open(url,'popupWindow'

 

To the following

<script language="javascript"><!--
function popupWindow2(url) {
window.open(url,'popupWindow2'

 

AND change

href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_SHIPPING)

 

to the following

href="javascript:popupWindow2(\'' . tep_href_link(FILENAME_POPUP_SHIPPING)

 

This will basically change the popup window name from popupWindow to popupWindow2. You can also name it anything else you want, as long as all required windows are named the same.

 

This should work.

 

Gary

Thank you so much

that solved the problem.

Regards,

Link to comment
Share on other sites

  • 3 weeks later...

I am trying to add the est. shipping cost contrib to STS plus and am having a small problem. Since it doesn't really use a box I can't figure out how to add it to the template. I've added the code to call the module but when I add a product to the cart, est shipping appears at the top of the screen above the entire site. Any suggestions?

 

Thanks,

Chuck

Link to comment
Share on other sites

I am trying to add the est. shipping cost contrib to STS plus and am having a small problem. Since it doesn't really use a box I can't figure out how to add it to the template. I've added the code to call the module but when I add a product to the cart, est shipping appears at the top of the screen above the entire site. Any suggestions?

I had the same problem trying to use this with STS. Instead of re-hacking I opted to use the popup version written by Gary (potikyan) which you can find at http://www.oscommerce.com/community/contributions,3072.

 

It works great with STS.

cdickson

Link to comment
Share on other sites

is it possible to display a message to the customer if the shipping rate is greater than a certain amount (like 10000)?

 

for overseas shipments, i set the final table rate to an extremely high number to detour any checkouts. due to the high rate of fraud ANYWHERE for extremely large packages, i just can't be bothered to process a $1,000 order for petty merchandise... cause 9x outta 10 it's fraudulent!

 

i have had only ONE customer so far complain about this, but i would like to detour anymore for obvious reasons. i initially thought the high rate would clue them in, but of course there's always somebody out there that doesn't get it..

 

if this isn't possible, does anyone know of a max. $ order amount contribution that can be separated between usa/canada and overseas shipments?

Edited by eww
Link to comment
Share on other sites

Hi, just installed this contribution and love it! The only thing I'm having a problem with is graphic wise... how can I get rid of the grey box that says "estimated shipping costs"? I've fiddled with it for awhile and everytime I just get a fatal error, including pic so you can see what I'm trying to do here...

 

Image5.jpg

 

I tried removing the text part out of this part of the code in the includes/modules

 

if ($cart->count_contents() > 0 && (((substr(basename($PHP_SELF), 0, 8) != 'checkout') && substr(basename($PHP_SELF), 0, 7) != 'account'))) {
	$info_box_contents = array();
	$info_box_contents[] = array('align' => 'left',
								 'text'  => TABLE_HEADING_ESTIMATED_SHIPPING);
	new estimatedshippingBoxHeading($info_box_contents, true, false);

 

but just received fatal error, I really don't know php though and pretty much have had wonderfully blind dumb luck in modifying everything so far lol. But scratching my head on this one, any help would be wonderful. Thank you! :)

Link to comment
Share on other sites

Hi, just installed this contribution and love it! The only thing I'm having a problem with is graphic wise... how can I get rid of the grey box that says "estimated shipping costs"? I've fiddled with it for awhile and everytime I just get a fatal error, including pic so you can see what I'm trying to do here...

 

Image5.jpg

 

I tried removing the text part out of this part of the code in the includes/modules

 

if ($cart->count_contents() > 0 && (((substr(basename($PHP_SELF), 0, 8) != 'checkout') && substr(basename($PHP_SELF), 0, 7) != 'account'))) {
	$info_box_contents = array();
	$info_box_contents[] = array('align' => 'left',
								 'text'  => TABLE_HEADING_ESTIMATED_SHIPPING);
	new estimatedshippingBoxHeading($info_box_contents, true, false);

 

but just received fatal error, I really don't know php though and pretty much have had wonderfully blind dumb luck in modifying everything so far lol. But scratching my head on this one, any help would be wonderful. Thank you! :)

You can't get rid of the if-statement as that is part of more but you can comment out/remove the line with

   new estimatedshippingBoxHeading($info_box_contents, true, false);

like

//   new estimatedshippingBoxHeading($info_box_contents, true, false);

That will remove the header for the estimated shipping box.

Link to comment
Share on other sites

Wow! That was so easy! Thank you so much! And for the quick reply :-)

I would have never known to do that, I was just trying to edit out everything lol. Thank you again. This contribution was the final last thing I was looking for my site.

 

You can't get rid of the if-statement as that is part of more but you can comment out/remove the line with

   new estimatedshippingBoxHeading($info_box_contents, true, false);

like

//   new estimatedshippingBoxHeading($info_box_contents, true, false);

That will remove the header for the estimated shipping box.

Link to comment
Share on other sites

Hi,

 

Great contribution. I've just installed the pop up version and seems to do what it's suppose to.

 

However... my shop is Canadian and I'm using multiple shipping table rates with zones and a different rates for each province.

 

How hard to modify this contribution to show a province drop down (when county Canada is selected) instead of the zip code box. Once the proper province is selected, shipping cost would be displayed for that zone.

 

Make any sense? Anyways, I'm just wondering how hard it might be to modify this contrib to do this.

 

Thanks for any advise / help on this.

 

Shayne!

Link to comment
Share on other sites

  • 3 weeks later...

I installed this contribution today, and it seems to be working great. Thanks!

 

I also have Drop_Shadow_v1.1 installed, and thought I would share the modified code in case anyone else wants to use both contributions together.

 

By the way, I'm a total noob, so I was really proud of myself for figuring this out....LOL :lol: I'm not sure that I did everything right, but it works.

 

Cathi

 

This is in the catalog/includes/classes/boxes.php file

 

 /* bof estimated shipping box contribution */
 //New estimatedshippingBox Class
 class estimatedshippingBox extends tableBox {
function estimatedshippingBox($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->estimatedshippingBoxContents($contents));
  $this->table_cellpadding = '0';  /* drop shadow mod-necessary to change cellpading in contentbox to 0 from 1 */
  $this->table_parameters = 'class="infoBox"';  /* changed class to infobox for drop shadow mod */
  $this->tableBox($info_box_contents, true);
}

function estimatedshippingBoxContents($contents) {
  $this->table_cellpadding = '1';
  $this->table_parameters = 'class="estimatedshippingBoxContents"';
  $info_box_contents = array();
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
	$info_box_contents[] = array(array('align' => $contents[$i]['align'],
									   'form' => $contents[$i]['form'],
									   'params' => 'class="TextBox"',
									   'text' => $contents[$i]['text']));
  }
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  return $this->tableBox($info_box_contents);
}
 }


 class estimatedshippingBoxHeading extends tableBox {
function estimatedshippingBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
  $this->table_cellpadding = '0';

  if ($right_arrow == true) $this->table_row_parameters = 'onclick="window.location=\''.$right_arrow.'\'"' . ' onmouseover="this.style.cursor=\'pointer\'"';

  if ($left_corner == true) {
	$left_corner = tep_image(DIR_WS_IMAGES . 'estimatedshippingBox/corner_left.gif');
  } else {
	$left_corner = tep_image(DIR_WS_IMAGES . 'estimatedshippingBox/corner_right_left.gif');
  }
  if ($right_arrow == true) {
	$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'estimatedshippingBox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
  } else {
	$right_arrow = '';
  }
  if ($right_corner == true) {
	$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'estimatedshippingBox/corner_right.gif');
  } else {
	$right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
  }

  $info_box_contents = array();  /*changed the three classes to infoBoxHeading for drop shadow mod */
  $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
									 'text' => $left_corner),
							   array('params' => 'width="100%" height="14" class="infoBoxHeading"',
									 'text' => $contents[0]['text']),
							   array('params' => 'height="14" class="infoBoxHeading" nowrap',
									 'text' => $right_corner));
/* drop shadow mod */
  $this->table_parameters = 'class="infoBoxHeading"';
  /* end drop shadow mod */

  $this->tableBox($info_box_contents, true);
}
 }
 /* eof estimated shipping box contribution */

Link to comment
Share on other sites

Hello,

 

Right now, it is giving me this in the popup window:

UPS Ground, 2006-05-31 $27.18

UPS 3 Day Select, 2006-05-30 $56.14

UPS 2nd Day Air, 2006-05-26 $83.48

UPS Next Day Air Saver, 2006-05-25 $108.96

UPS Next Day Air Early A.M., 2006-05-25 $146.36

UPS Next Day Air, 2006-05-25 $114.30

 

I have two questions:

How do I get rid of the date, and how do I select different shipping (e.g. get rid of Next Day Air Early or add other ones in)?

 

Thanks!

Andrew

Link to comment
Share on other sites

Hello,

 

Right now, it is giving me this in the popup window:

I have two questions:

How do I get rid of the date, and how do I select different shipping (e.g. get rid of Next Day Air Early or add other ones in)?

 

Thanks!

Andrew

About the date you have to wait for an answer from the popup makers and about the shipping options it is what your shipping provider returns.

You probably don't have very much influence on it but maybe you can try a little with the code you find in the (catalog)/includes/modules/shipping/ups.php

	function _upsAction($action) {
  /* 3 - Single Quote
	 4 - All Available Quotes */

  $this->_upsActionCode = $action;
}

function _upsGetQuote() {
  if (!isset($this->_upsActionCode)) $this->_upsActionCode = '4';
  ....
  ....

The _upsAction function isn't actually used right now and there is always all available quotes retrieved. But as the choice seems to be a single quote or all available quotes it won't help for getting only specific quotes.

 

You could change

		for ($i=0; $i<$qsize; $i++) {
	  list($type, $cost) = each($upsQuote[$i]);
	  $methods[] = array('id' => $type,
						 'title' => $this->types[$type],
						 'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
	}

to surpress unwanted quotes.

 

HTH

Link to comment
Share on other sites

Hello,

 

Right now, it is giving me this in the popup window:

I have two questions:

How do I get rid of the date, and how do I select different shipping (e.g. get rid of Next Day Air Early or add other ones in)?

 

Thanks!

Andrew

 

Hi. I'm not sure why you're getting a date stamp in your estimates. This was not coded into the popup feature of this contribution. It might be something that comes with your UPS shipping module.

 

As for which UPS method you want to show in your estimated shipping box, you should use the contribution below. You can select which ones to show from your admin panel. This might also fix the date stamp problem you're having.

 

http://www.oscommerce.com/community/contributions,528

 

Good luck!

Gary

Link to comment
Share on other sites

Thanks for all the help wheeloftime and potikyan.

I installed the contribution that you linked. I enabled all the shipping rates I need. However, I have one concern, and that is how does it know where to base the rates off of? I don't specify my address anywhere in the module, so how does it know where I will be shipping from?

 

Thanks!

Andrew

 

 

Hi. I'm not sure why you're getting a date stamp in your estimates. This was not coded into the popup feature of this contribution. It might be something that comes with your UPS shipping module.

 

As for which UPS method you want to show in your estimated shipping box, you should use the contribution below. You can select which ones to show from your admin panel. This might also fix the date stamp problem you're having.

 

http://www.oscommerce.com/community/contributions,528

 

Good luck!

Gary

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