Post by mchaggis » Thu Jun 11, 2009 6:31 am

I have been trying to find a way to change the "Special Offers" button to say something else and then (ideally) when clicked, pop up some static html. It would be nice if it popped up in a neat concise box like the picture enlarge feature does.

I am sure this is pretty simple, but it seems to be escaping me.

Any help would be much appreciated
Bryce

"to trifle away their time, scald their Chops, and spend their Money, all for a little base, black, thick, nasty, bitter, stinking, nauseous Puddle-water"


User avatar
Newbie

Posts

Joined
Thu Jun 11, 2009 3:05 am

Post by mchaggis » Thu Jun 11, 2009 7:32 am

I am probably letting my ignorance show here. This is as far as I got. I edited the header.tpl file as such:

Code: Select all

<div class="div1">
  <div class="div2"><a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $store; ?>" alt="<?php echo $store; ?>" /></a></div>
  <div class="div3"><?php echo $search; ?></div>
</div>
<div class="div4">
  <div class="div5"><a href="<?php echo $home; ?>"><img src="catalog/view/theme/default_brown/image/icon_home.png" alt="" /><?php echo $text_home; ?></a><a href="javascript:PopupMe()"><img src="catalog/view/theme/default_brown/image/icon_special.png" alt="" />Conversion Chart</a>
    <?php if (!$logged) { ?>
    <a href="<?php echo $login; ?>"><img src="catalog/view/theme/default_brown/image/icon_login.png" alt="" /><?php echo $text_login; ?></a>
    <?php } else { ?>
    <a href="<?php echo $logout; ?>"><img src="catalog/view/theme/default_brown/image/icon_logout.png" alt="" /><?php echo $text_logout; ?></a>
    <?php } ?>
    <a href="<?php echo $account; ?>"><img src="catalog/view/theme/default_brown/image/icon_account.png" alt="" /><?php echo $text_account; ?></a></div>
  <div class="div6"><a href="<?php echo $checkout; ?>"><img src="catalog/view/theme/default_brown/image/icon_checkout.png" alt="" /><?php echo $text_checkout; ?></a><a href="<?php echo $cart; ?>"><img src="catalog/view/theme/default_brown/image/icon_basket.png" alt="" /><?php echo $text_cart; ?></a></div>
</div>
So far so good.
However, I am thinking I need to place

Code: Select all

<script language="JavaScript">
function  PopupMe(){
myleft=150;mytop=150;
settings='top=' + mytop + ',left=' + myleft + ',width=400,height=550,location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,fullscreen=no'
Conversion Charts=window.open('http://needleworkparadise.com/conversion.htm','Conversion Charts', settings);
Conversion Charts.focus();}
</script>
somewhere in the page header. And I have no clue how to do that.

"to trifle away their time, scald their Chops, and spend their Money, all for a little base, black, thick, nasty, bitter, stinking, nauseous Puddle-water"


User avatar
Newbie

Posts

Joined
Thu Jun 11, 2009 3:05 am

Post by readyman » Thu Jun 11, 2009 10:41 am

Hey cool, it's good to see the template being put to good use...

Add that code into the layout.tpl file instead.. in the <head> tags.

http://www.alreadymade.com
Follow me on twitter.com/alreadymade


User avatar
Global Moderator

Posts

Joined
Wed May 20, 2009 5:16 am
Location - Sydney

Post by mchaggis » Fri Jun 12, 2009 2:16 am

works perfectly, thank you so much. I've been very impressed with OpenCart so far =]]

Just in case anyone comes across this thread looking to do the same thing, my previously posted code was very sloppy. Final version looks like:
in header.tpl, this is the button

Code: Select all

<a href="javascript:popper('http://needleworkparadise.com/conversion.htm')"><img src="catalog/view/theme/default_brown/image/icon_special.png" alt="" />Conversion Chart</a>
and in layout.tpl

Code: Select all

<script type="text/javascript">
function popper(popurl){
var winpops=window.open(popurl,"","width=350,height='screen.height',scrollbars,top=20,left=5");
}
</script>

"to trifle away their time, scald their Chops, and spend their Money, all for a little base, black, thick, nasty, bitter, stinking, nauseous Puddle-water"


User avatar
Newbie

Posts

Joined
Thu Jun 11, 2009 3:05 am
Who is online

Users browsing this forum: No registered users and 13 guests