Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Replace header shortcut buttons with text links


sydjeii

Recommended Posts

Posted

hello there.. can somebody teach me how to remove the header shortcut buttons (checkout, account, cart) and replace them with just text links with the same functions as the original shortcut buttons? i already tried editing the jquery-ui css and successfully removed the background so the button text and small icon-like beside it were left..i thought i was good but everytime i click on the text, the shape of the button is showing up.. i couldn't explain it well so i attached a screenshot.. any help will be so much appreciated..thanks in advance.. smile.png

New Picture (8).bmp

-=PINOY AKO=-

Posted

I would modify the file includes/header.php and replace the buttons there by plain links. Examples of a plain links (using tep_href_link) are in almost all files

 

You can also style them individually using css by adding additional rules just for that buttons (in case you want to keep all other button in place), you can read here

Posted

Thanks for the suggestion Mr. multimixer.. I tried it with user account and checkout and it's great..I had trouble with the shopping cart though..the code is quite complicated since there are additional parameters i dont know which one to remove or change.. can you help me with this?.. here's what i want to do: (1) i still want to preserve the parameter that checks if the cart is empty or not (2) replace the shopping cart image with something i made (3) remove the button.. Thanks in advance.. :)

-=PINOY AKO=-

Posted

i tried modifying header.php..i've also solved problem 1 and 3.. here's what i did..

 

originally i have this code..

 

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'));

 

i replaced it with

 

echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '" alt="" >' .($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : '') . HEADER_TITLE_CART_CONTENTS . '</a>' .'<br />'.//replaced line 27

   '<a href="'.tep_href_link(FILENAME_CHECKOUT_SHIPPING,'', 'SSL').'">'."Checkout".'</a>'//code replaced to line 28

 

 

and deleted this part

<script type="text/javascript">
 $("#headerShortcuts").buttonset();
</script>

 

right now i think my links are ok..i got no problem with it anymore.. the cart i was referring to was the small cart within the button..i was able to remove it maybe because i also removed this piece of code..i want to replace it with a different cart image..

 

<script type="text/javascript">

$("#headerShortcuts").buttonset();

</script>

 

So my only problem now is how will i insert a different small cart image beside the "Cart Contents" link.. :)

-=PINOY AKO=-

Posted

try it this way

 

   tep_image(DIR_WS_IMAGES . 'cart.jpg', 'What\'s in your current shopping basket', '25', '20') . ' ' . tep_draw_button(HEADER_TITLE_CART_CONTENTS . '<b>' . ($cart->count_contents() > 0 ? ' - ' . $cart->count_contents() . ' item(s) - ' . $currencies->format($cart->show_total()) : '') . '</b>', null, tep_href_link(FILENAME_SHOPPING_CART)) . '  |  ' .

 

This code may need tinkering with for your needs as I lifted it straight from my header.php

 

Regards

 

Mark

Posted

What you need is something like this

 

'<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '>' . tep_image(DIR_WS_IMAGES . 'your_image.jpg', 'image title tag', '30', '30') . ($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : '') . HEADER_TITLE_CART_CONTENTS . '</a>'

 

+ you need to upload the image to /images/ folder

Posted

Hi - this is exactly what I was looking for. I did as suggested and got text links with no icons and link/cart are working correctly. However, I'm having trouble with the last line to show login id.

 

this is what I have which is working:

echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '" alt="" >' .($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : '') . HEADER_TITLE_CART_CONTENTS . '</a>' . ' - ' .

'<a href="'.tep_href_link(FILENAME_CHECKOUT_SHIPPING,'', 'SSL').'">'."Checkout".'</a>' . ' - ' .

'<a href="'.tep_href_link(FILENAME_ACCOUNT,'', 'SSL').'">'."Login".'</a>'

 

 

 

First three lines work, but when I added in the "if" line I get error message:

Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in

 

 

if (tep_session_is_registered('customer_id')) {

echo '<a href="'.tep_href_link(FILENAME_LOGOFF,'', 'SSL').'">'."Logoff".'</a>'

 

Any suggestions would be appreciated!

Posted

after each of your echo statements, you need to set a

 

;

 

to finish the command ...

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Posted

:-) glad to hear!

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Archived

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

×
×
  • Create New...