How to change buttons in header to text links?
#1
Posted 20 November 2010, 23:49
Can anyone help, been trying all night to no avail!
Thanks.
#2
Posted 21 November 2010, 09:01
It is just in the start of the file, the 3 buttons and a few line down you have the logg off button if logged inn.
#3
Posted 21 November 2010, 12:36
echo tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
would be
echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>';
Support is commercially available. The question is whether you value your business
highly enough to spend money on it.
For commercial support from known developers who support osCommerce
ethos, please post at http://forums.oscommerce.com/forum/79-commercial-support/
#4
Posted 21 November 2010, 12:47
It was how to re-arrange the link with the . ( ' and " in the right place that was getting me stuck.
#5
Posted 21 November 2010, 13:04
I've now got this:
'<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>',
'<a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . HEADER_TITLE_CART_CONTENTS . '</a>',
'<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . HEADER_TITLE_CHECKOUT . '</a>',
but it still draws buttons so my guess is it's been created with css. I couldn't find it with a quick glance but will have a better look once he washing up's done!
Edited by pberry4032, 21 November 2010, 13:06.
#6
Posted 21 November 2010, 13:27
<script type="text/javascript">
$("#headerShortcuts").buttonset();
</script>
Or rename the div.
Support is commercially available. The question is whether you value your business
highly enough to spend money on it.
For commercial support from known developers who support osCommerce
ethos, please post at http://forums.oscommerce.com/forum/79-commercial-support/
#7
Posted 21 November 2010, 14:02
Cheers. That would have had me going for ages!
#8
Posted 02 December 2010, 09:44
That solved my button customization confusion.
What's the point with those tep_draw_button thangs when a simple class in the main stylesheet can do it as well?
#9
Posted 02 December 2010, 21:09
<span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span>
How to replace that one with an ordinary text link? (and eventually a GIF icon)
#10
Posted 03 December 2010, 07:39
pberry4032, on 20 November 2010, 23:49, said:
Can anyone help, been trying all night to no avail!
Thanks.
Here is my contribution to the header shortcut block:
<div id="headerShortcuts">
<?php
echo '<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_SHOPPING_CART) . '" alt="" >' .($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : '') . HEADER_TITLE_CART_CONTENTS . '</a>' .
'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" alt="" >' . HEADER_TITLE_CHECKOUT . '</a>' .
'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '" alt="" >' . HEADER_TITLE_MY_ACCOUNT . '</a>';
if (tep_session_is_registered('customer_id')) {
echo '<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '" alt="" >' . HEADER_TITLE_LOGOFF . '</a>';
}
?>
</div>
and some css to begin with:
.headerShortcutLink {
background: #2b5b2b url(icon.gif);
border: 2px solid black;
color:white;
padding: 8px;
margin-right:3px;
}
Don't forget to remove the JavaScript BS too as burt told.
----------------------------------------------------
I'm still trying to solve my previous question to remove tep_draw_hidden_field. Somebody knows how to?
#11
Posted 25 January 2011, 00:21
<div id="header" class="grid_24">
<div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></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_CREATE_ACCOUNT, 'person', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')) .
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>
<script type="text/javascript">
$("#headerShortcuts").buttonset();
</script>
</div>
Class headerShortcuts is still in the stylesheet and it isn't commented out. So am wondering if this has happen to anyone else and what might I have to look at to resolve this issue?
Thanks.
Bennett
Edited by blr044, 25 January 2011, 00:23.
#12
Posted 25 January 2011, 05:16
blr044, on 25 January 2011, 00:21, said:
#13
Posted 08 March 2011, 16:49
When I search for this, the search replies I am using html tags which I'm not.
Thank you for your help.
Carver
#14
Posted 24 March 2011, 03:56
burt, on 21 November 2010, 13:27, said:
<script type="text/javascript">
$("#headerShortcuts").buttonset();
</script>
Or rename the div.
#15
Posted 24 March 2011, 07:09
Juzzyman, on 24 March 2011, 03:56, said:
I suck at coding and I'm barely learning, but this will be what you'll want yours to look like to do what you are describing...
<div class="grid_24 ui-widget infoBoxContainer">
<div class="ui-widget-header infoBoxHeading">
<?php echo ' ' . $breadcrumb->trail(' » '); ?>
<div style="width:50%;float:right;text-align:right;padding-right:10px;">
<?php
echo '<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_SHOPPING_CART) . '" alt="" >' .($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : '') . HEADER_TITLE_CART_CONTENTS . '</a>'. ' '.'»'.' '.
'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" alt="" >' . HEADER_TITLE_CHECKOUT . '</a>' .' '.'»'.' '.
'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '" alt="" >' . HEADER_TITLE_MY_ACCOUNT . '</a>';
if (tep_session_is_registered('customer_id')) {
echo ' '.'»'.' '.'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '" alt="" >' . HEADER_TITLE_LOGOFF . '</a>';
}
?>
</div>
</div>
</div>
#16
Posted 24 March 2011, 13:12
wildvettes, on 24 March 2011, 07:09, said:
<div class="grid_24 ui-widget infoBoxContainer">
<div class="ui-widget-header infoBoxHeading">
<?php echo ' ' . $breadcrumb->trail(' » '); ?>
<div style="width:50%;float:right;text-align:right;padding-right:10px;">
<?php
echo '<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_SHOPPING_CART) . '" alt="" >' .($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : '') . HEADER_TITLE_CART_CONTENTS . '</a>'. ' '.'»'.' '.
'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" alt="" >' . HEADER_TITLE_CHECKOUT . '</a>' .' '.'»'.' '.
'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '" alt="" >' . HEADER_TITLE_MY_ACCOUNT . '</a>';
if (tep_session_is_registered('customer_id')) {
echo ' '.'»'.' '.'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '" alt="" >' . HEADER_TITLE_LOGOFF . '</a>';
}
?>
</div>
</div>
</div>
#18
Posted 24 March 2011, 16:08
My problem is not getting the button's to operate as text but to have them working in the first place.
My Code Snippet
Is as standard
<div id="header" class="grid_24">
<div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></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>
<script type="text/javascript">
$("#headerShortcuts").buttonset();
</script>
</div>
Yet the buttons simply do not function could someone point me in the right direction
I am thinking this is an sql issue.....
Edited by AdamBarker, 24 March 2011, 16:10.
#19
Posted 24 March 2011, 17:17
AdamBarker, on 24 March 2011, 16:08, said:
My problem is not getting the button's to operate as text but to have them working in the first place.
My Code Snippet
Is as standard
<div id="header" class="grid_24">
<div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></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>
<script type="text/javascript">
$("#headerShortcuts").buttonset();
</script>
</div>
Yet the buttons simply do not function could someone point me in the right direction
I am thinking this is an sql issue.....
Having done some further testing it would appear that the header shortcuts work whilst not logged in or whilst the cart is empty, they will not work once thee cart has items in.
Am I alone in these issues?
#20
Posted 24 March 2011, 17:36
AdamBarker, on 24 March 2011, 17:17, said:
Am I alone in these issues?
I am using version 2.3.1,you?
I think click on the "start new topic" button and go and ask in the "General Support" section. You may have more chance of getting the reply you need. Sorry I can't be of more assistance. I'm a newbie!














