Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I need a confirmation to some changes I did


multimixer

Recommended Posts

Posted

Hi to all, maybe somebody who has an experience with osc can confirm the changes I did?

 

The task was: To make the file checkout_success.php to display a different text according to the chosen shipping method

 

Why this (if you are curious to know)? I have the option of a "store pick up" and "express courier" as shipping methods. So I want that if somebody choose "courier" the checkout_process.php displays a link to the courier site, so that people can follow up their order there. If "store pickup" is chosen to display a link to the store site with opening hours etc

 

What I did

 

1) In checkout_success.php I request the shipping module

require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping($shipping);

 

2) In same file I replaced the original code as follows (original code starts after ---}else{---)

<?php 
  if ($spu !=false) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="4" cellpadding="2">
	  <tr>
		<td valign="top" class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?><div align="" class="pageHeading"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_PICKUP;  ?><br><br>

<?php echo TEXT_STORE_INFO . '<br><br>'; ?>
<?php echo TEXT_SEE_ORDERS . '<br><br>' . TEXT_CONTACT_STORE_OWNER; ?>

		<h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td>
	  </tr>
	</table></td>
  </tr>	  
<?php
} else { 
?>	
  <tr>
	<td><table border="0" width="100%" cellspacing="4" cellpadding="2">
	  <tr>
		<td valign="top" class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?><div align="" class="pageHeading"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_SUCCESS;  ?><br><br>
<?php
?>
		<h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td>
	  </tr>
	</table></td>
  </tr>	 
<?php
} 
?>

 

This didn't work, and wondering why I found in checkout_process.php the line

tep_session_unregister('shipping');

 

So, finally I moved this line to checkout_success.php and everything works fine.

 

BUT, I have a concern: If a customer, who is on checkout_success.php don't hit the "continue" button, but just close the window, will the session remain registered?

 

Is there a problem with the solution I created? I hope not, but I also hope to listen to an opinion of smebody who know better about all this.

 

PS. If somebody want to use this, please do not copy paste into your code, I didn't copied carefully for this post and maybe something is missing. PM me or post here and I'll post it again (after confirmed that it is ok of course)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...