Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

put a image or text under buttons


Guest

Recommended Posts

Hi

 

Visit www.partycrackershop.co.uk to view the page I want to amend

 

I am trying to put either a image or text under the Basket, Checkout and My Account buttons on the top right of the screen

 

I did it with another website using a table and put it inside the div tag but I did that with this one and its not doing it

 

Notice the text is under the store logo

 

Any Ideas or am I doing the coding abit wrong

 

Below is the coding I am using

 

<div id="headerShortcuts">
<?php
 echo tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) .
   tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .
   tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
 if (tep_session_is_registered('customer_id')) {
   echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
 }
?>
<table border="0" align="right">
 <tr>
  <td align="right">
  <font face="Arial" size="2" color="#000000">FOR ALL YOUR PARTY ACCESSORIES ETC ALL IN ONE PLACE</font>
  </td>
  </tr>
  </table>
 </div>

Link to comment
Share on other sites

I suspect the problem lies within the CSS file, usually with oscommerce it's called stylesheet.css. Find #headerShortcuts within the css and copy and paste its section here for us to have a look at.

 

You might be able to force it to appear on top using the z-index attribute.

Link to comment
Share on other sites

Hi Dominic

 

Your helping me big time tonight

 

I found the #headerShortcuts in the css stylesheet

 

I have pasted it in below

 

#headerShortcuts {
 float: right;
 margin-top: 5px;
}

Link to comment
Share on other sites

add this code where you want your text

 

<div style="text-align: center;"><?php echo TEXT_MAIN_BUTTONS; ?></div>

give it a style or align different.

 

Then go to includes>languages> english.php and put this anywhere handy like after the buttons so you can find it handy

 

define('TEXT_MAIN_BUTTONS', 'this is my button text');

Link to comment
Share on other sites

Hi Lola

 

Thank you for the reply

 

It worked but it displayed the text above the buttons instead of below

 

Any Ideas how to get it below the buttons

 

The coding is below

 

 <div id="headerShortcuts">
<?php
 echo tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) .
   tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .
   tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
 if (tep_session_is_registered('customer_id')) {
   echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
 }
?>
 </div>
 <div style="text-align: center;"><?php echo TEXT_MAIN_BUTTONS; ?></div>

Link to comment
Share on other sites

Just move the code up into the div

 

<div id="headerShortcuts">

<?php

echo tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) .

tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .

tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

 

if (tep_session_is_registered('customer_id')) {

echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));

}

?>

 

<div style="text-align: center;"><?php echo TEXT_MAIN_BUTTONS; ?></div>

</div>

Link to comment
Share on other sites

  • 4 weeks later...

This worked great! Although I would like for the text to be sitting more on the header bar than dangling under the checkout/account buttons. Any tips on that would be appreciated.

 

Also, how do I alter the code to change the font style and size of just this line of text?

 

I'd love to hear from you Lola! Your answers are fantastic!

Link to comment
Share on other sites

Hello StouderHouse!

 

First find this in your header.

 

<div class="grid_24 ui-widget infoBoxContainer">

<div class="ui-widget-header infoBoxHeading"><?php echo '  ' . $breadcrumb->trail(' » '); ?>></div>

</div>

 

and then add this new code

<div class="fl_right"><?php echo TEXT_MAIN_BUTTONS; ?></div

 

inside the grid 24 div like this. Notice the new class from the original code posted prior.

 

<div class="grid_24 ui-widget infoBoxContainer">

<div class="ui-widget-header infoBoxHeading"><?php echo '  ' . $breadcrumb->trail(' » '); ?><div class="fl_right"><?php echo TEXT_MAIN_BUTTONS; ?></div></div>

</div>

 

Then open your style sheet and add this:

 

.fl_right {

text-align : right;

margin-top: -10px;

font-size: 12 px;

}

 

margin-top: -9px; in red can be adjusted up and down by changing the value. This is adjusted for stock code but if you have a custom breadcrumb bar adjustments may need to be made. font size can also be adjusted.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...