Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Which lines of code to use for button?


Guest

Recommended Posts

Hello,

Knowing very little about php code I have got myself in a bit of a muddle.

 

I have added some pages of my own to my oscommerce store and would like them to include the back button as my other pages do. Also some of the standard oscommerce pages are missing it so basically if possible I would like it on all pages.

 

I was wondering if someone could tell me which lines of code I need to use for the button and where I should insert them into my file for them to be in the same place.

 

Here is a selected part of the code from catalog/products_info.php as this page includes the button

<?php
} else {
?>
<?php
}
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<?php
  $back = sizeof($navigation->path)-2;
  if (isset($navigation->path[$back])) {
?>
		   <td class="main" align="left"><?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_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
<?php
  }
?>			  
<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
		  <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>

 

page to where button is on the page: http://www.angelsbodystudioltd.co.uk/onlin...ll-2-p-597.html

 

and one of the pages I would like to put the button on is: http://www.angelsbodystudioltd.co.uk/onlin...re/shipping.php

		</tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>		  
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
</table></td>

 

I think it has to go in here somewhere but not quite sure where.

 

If someone could help me with this I would be very grateful.

Thanks in advance

Link to comment
Share on other sites

		  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>		  
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>

 

Looking at this section of code you could put a button in the first colomn, also using the javascript function is the easiest option, so above would be:

 

		  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo '  <a href="java script:history.go(-1)">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>  '; ?></td>		  
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

		  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>		  
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>

 

Looking at this section of code you could put a button in the first colomn, also using the javascript function is the easiest option, so above would be:

 

		  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo '  <a href="java script:history.go(-1)">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>  '; ?></td>		  
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>

Thank you.

That did place the button in the right place on the page however when the button is clicked the page that comes up says:

Not Found

The requested URL /onlinestore/java script:history.go(-1) was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Link to comment
Share on other sites

Thank you.

That did place the button in the right place on the page however when the button is clicked the page that comes up says:

Not Found

The requested URL /onlinestore/java script:history.go(-1) was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

 

Something has happened to the ode I posted, there should be no gap between java & script, so like 'javascript' , unless that gets messed again.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Something has happened to the ode I posted, there should be no gap between java & script, so like 'javascript' , unless that gets messed again.

That works like a charm. Thank you so so much :)

Link to comment
Share on other sites

Could you help me out with one last thing on that subject please?

 

Adding this button has made the grey background wider.

 

Could you tell me how to make the background that the two buttons are on the same size as the others.

 

please see: http://www.angelsbodystudioltd.co.uk/onlin...re/shipping.php and http://www.angelsbodystudioltd.co.uk/onlin...ll-2-p-597.html

 

I like the thinner one if you could help with that.

 

Many thanks

Link to comment
Share on other sites

Could you help me out with one last thing on that subject please?

 

Adding this button has made the grey background wider.

 

Could you tell me how to make the background that the two buttons are on the same size as the others.

 

please see: http://www.angelsbodystudioltd.co.uk/onlin...re/shipping.php and http://www.angelsbodystudioltd.co.uk/onlin...ll-2-p-597.html

 

I like the thinner one if you could help with that.

 

Many thanks

 

I think you ment taller! It could be other elemnts on the page, you have to check your html, but try removing the width="10" from the td element

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I think you ment taller! It could be other elemnts on the page, you have to check your html, but try removing the width="10" from the td element

Yes, you're right I did mean taller. Thanks for all the help it works great now.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...