Zen Cart Logo
Forums / General Questions / Bringing page with JQuery into store

Bringing page with JQuery into store

Locked

Views: 10,600

Results 41 to 58 of 58
This thread is locked. New replies are disabled.
2 Sep 2010, 10:42 PM
#41
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Bringing page with JQuery into store

Replace this with your desired URL:
HTTP_SERVER . DIR_WS_CATALOG

in each of these places:

Header HOME link:
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>

Logo link:
<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

2 Sep 2010, 11:39 PM
#42
blahblah4949 avatar

blahblah4949

New Zenner

Join Date:
Jul 2010
Location:
London, England
Posts:
58
Plugin Contributions:
0

Re: Bringing page with JQuery into store

Ah, thats what I tried before but didn't get any joy. Just tried again but still points to the store (https://www.url.net/store), I'm looking for https://www.url.net . I tried putting http/https or just www. but no luck.

I dropped the copy of tpl_header.php into the common folder of my custom template - is that correct? When I check the source code nothings changed - I checked permissions and they are 0777.

Here it is with the changes:

<?php
/**
 * Common Template - tpl_header.php
 *
 * this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * make a directory /templates/my_template/privacy<br />
 * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
 * to override the global settings and turn off the footer un-comment the following line:<br />
 * <br />
 * $flag_disable_header = true;<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
 */
?>

<?php
  // Display all header alerts via messageStack:
  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
  if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
  echo htmlspecialchars(urldecode($_GET['error_message']));
  }
  if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
   echo htmlspecialchars($_GET['info_message']);
} else {

}
?>

<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>
<div id="headerWrapper">
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
    <ul class="back">
    


<li><?php echo '<a href="' . http://www.zentest.net . '">'; 


?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if ($_SESSION['customer_id']) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
      } else {
        if (STORE_STATUS == '0') {
?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div>
<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>
<!--eof-navigation display-->

<!--bof-branding display-->
<div id="logoWrapper">
    <div id="logo"><?php echo '<a href="' . http://www.zentest.net . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
    <div id="taglineWrapper">
<?php
              if (HEADER_SALES_TEXT != '') {
?>
      <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php
              }
?>
<?php
              if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                if ($banner->RecordCount() > 0) {
?>
      <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
                }
              }
?>
    </div>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->

<!--eof-header logo and navigation display-->

<!--bof-optional categories tabs navigation display-->
<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
<!--eof-optional categories tabs navigation display-->

<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
<!--eof-header ezpage links-->
</div>
<?php } ?>
3 Sep 2010, 4:17 AM
#43
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Bringing page with JQuery into store

You've created PHP syntax errors by not wrapping the URL in quotes.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Sep 2010, 1:54 PM
#44
blahblah4949 avatar

blahblah4949

New Zenner

Join Date:
Jul 2010
Location:
London, England
Posts:
58
Plugin Contributions:
0

Re: Bringing page with JQuery into store

Thanks Dr, I tried quotes before but no joy. Have added them again now though - still not linking.

Sorry this is a PHP issue and not Zen Cart. I googled for this and have downloaded a PHP tutorial, but can't find the solution. How should the URL be displayed after <a href=" ? Just putting the URL inside quote marks doesn't work for me.

<a href="url">
5 Sep 2010, 2:30 PM
#45
blahblah4949 avatar

blahblah4949

New Zenner

Join Date:
Jul 2010
Location:
London, England
Posts:
58
Plugin Contributions:
0

Re: Bringing page with JQuery into store

Still getting the logo linking to the store page. Is it just this file I should edit, or should anything else need to be fixed?

Here's the tpl_header.php file with the URL put in:

<?php
/**
 * Common Template - tpl_header.php
 *
 * this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * make a directory /templates/my_template/privacy<br />
 * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
 * to override the global settings and turn off the footer un-comment the following line:<br />
 * <br />
 * $flag_disable_header = true;<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
 */
?>

<?php
  // Display all header alerts via messageStack:
  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
  if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
  echo htmlspecialchars(urldecode($_GET['error_message']));
  }
  if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
   echo htmlspecialchars($_GET['info_message']);
} else {

}
?>


<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>

<div id="headerWrapper">
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
    <ul class="back">
    <li><?php echo '<a href="http://www.zentest.net">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if ($_SESSION['customer_id']) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
      } else {
        if (STORE_STATUS == '0') {
?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div>
<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>
<!--eof-navigation display-->

<!--bof-branding display-->
<div id="logoWrapper">
    <div id="logo"><?php echo '<a href="http://www.zentest.net">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
    <div id="taglineWrapper">
<?php
              if (HEADER_SALES_TEXT != '') {
?>
      <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php
              }
?>
<?php
              if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                if ($banner->RecordCount() > 0) {
?>
      <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
                }
              }
?>
    </div>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->

<!--eof-header logo and navigation display-->

<!--bof-optional categories tabs navigation display-->
<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
<!--eof-optional categories tabs navigation display-->

<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
<!--eof-header ezpage links-->
</div>
<?php } ?>

Could someone confirm I have placed the URL in correctly?

5 Sep 2010, 7:20 PM
#46
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Bringing page with JQuery into store

That's the right filename, and those edits should be fine.
If it's not making any difference on your site, then you're putting the file in the wrong place, or you have another override superceding this one.

Where'd you upload it to?
Which template is currently active? (Admin->Tools->Template Selection)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Sep 2010, 1:17 AM
#47
blahblah4949 avatar

blahblah4949

New Zenner

Join Date:
Jul 2010
Location:
London, England
Posts:
58
Plugin Contributions:
0

Re: Bringing page with JQuery into store

DrByte:

That's the right filename, and those edits should be fine.
If it's not making any difference on your site, then you're putting the file in the wrong place, or you have another override superceding this one.

Where'd you upload it to?
Which template is currently active? (Admin->Tools->Template Selection)

Yes you were absolutely right. I dug into my files and found when I moved files into my root, I had some files left over somewhere from the original install. I had ended up with almost two sites in one. :blink:

So, I cleaned everything up and tried again - the logo now links to the main page :smile: It also runs faster (unsurprisingly).

Only in my clean up I seem to have buggered something up :frusty:

Now when you type the URL you get this: testsite. Click on the store link and it takes you into the site.

I'm hoping a simple edit in maybe the header.php or index.php files will do the trick?

6 Sep 2010, 1:39 AM
#48
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Bringing page with JQuery into store

That's a basic web issue. You need to either put back an index.php or index.html file in that folder, or move the entire store folder's contents up a level into the main folder if you don't want visitors to have to click something to get into the store.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Sep 2010, 2:36 PM
#49
blahblah4949 avatar

blahblah4949

New Zenner

Join Date:
Jul 2010
Location:
London, England
Posts:
58
Plugin Contributions:
0

Re: Bringing page with JQuery into store

Hope I'm not testing your patience too much with this now:blush:

I tried to move the site up into the main folder, but got confronted with a plain white screen and a mild heart attack, but managed to get it back.

Now noticed my .htaccess file is empty in the root. I also have the .htaccess files in 'admin' and 'includes' but they are fine.

I had experimented putting an index.php file into the root which when you type the url brings you to the home page. Unfortunately it has index.php?main_page=page&id=20' trailing after it which is not how it was before.

The new file I made was this:

<?php
header('Location: /store/index.php?main_page=page&id=20',true,301);
?>

I'm just learning PHP basics and have removed it server side.

Is the .htaccess file the real cause of the problem?

EDIT: Just read another thread were DrByte states Zen Cart does not require an .htaccess file so I guess that rules that out.

7 Sep 2010, 2:40 PM
#50
blahblah4949 avatar

blahblah4949

New Zenner

Join Date:
Jul 2010
Location:
London, England
Posts:
58
Plugin Contributions:
0

Re: Bringing page with JQuery into store

OK, have managed to move the files up a level so now the site goes straight in with the URL, only it's pointing at the store again.

Is this still a server side issue, or can I just redirect my site via Zen Cart? (I promise not to balz it up this time if so).

I have ensured the two custom files in init_includes are in there.

7 Sep 2010, 2:51 PM
#51
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Bringing page with JQuery into store

blahblah4949:

OK, have managed to move the files up a level so now the site goes straight in with the URL, only it's pointing at the store again.LOL - no you haven't :P

Is this intended to be your live site? Or is this just a staging area?

I suspect it's just a staging area, in which case I'd simply advise you to create an index.html file in that folder to act as a splash page, and if someone arrives there they can click your link and go to the store.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Sep 2010, 3:07 PM
#52
blahblah4949 avatar

blahblah4949

New Zenner

Join Date:
Jul 2010
Location:
London, England
Posts:
58
Plugin Contributions:
0

Re: Bringing page with JQuery into store

I thought I had :blush:

I played around with the folders there and it started working so I thought I'd cracked it :D

Well the idea is to pass this onto a friend (the artist), all he will have to do is purchase a URL and then I would hand it over.

If I play about with the folders on the server should I be able to get it back as it was then - i.e. URL pointing to the slider page? I think he would prefer that to a holding page.

Thanks for your patience with this!

Seems a shame after you got it working perfect to have it with a splash page.

7 Sep 2010, 3:27 PM
#53
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Bringing page with JQuery into store

You're getting hung up on small stuff.

If this is just a staging area, it doesn't matter what folder it's in.
The splash page suggestion was JUST a bridge until you use the site for real someplace.

When you move the whole site to the guy's real server on his real domain, you'll just put it directly into the right folder, and go from there.
There's even a tutorial on how to do such a move.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Sep 2010, 3:33 PM
#54
blahblah4949 avatar

blahblah4949

New Zenner

Join Date:
Jul 2010
Location:
London, England
Posts:
58
Plugin Contributions:
0

Re: Bringing page with JQuery into store

Ah cool.

Yeah had got a bit bogged down with this issue instead of getting on with working on the site itself.

Shall leave it be then for now

:cool:

7 Sep 2010, 4:05 PM
#55
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Bringing page with JQuery into store

k ... but ... you should NOT leave a site left to show folder listings like that. Stuff an index.html file in there at least.

Leaving the file/folder listing there also discloses other information (below it) about your server, which could be abused by those with malicious bones in their fingers hovering over keyboards.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Sep 2010, 4:31 PM
#56
blahblah4949 avatar

blahblah4949

New Zenner

Join Date:
Jul 2010
Location:
London, England
Posts:
58
Plugin Contributions:
0

Re: Bringing page with JQuery into store

Oh I see what you mean now.

In Firefox it was working correctly and going straight to the site. I just checked Chrome and Safari and yeah it's still showing the folder listing.

Guess it was in the cache or something on FF.

I need a lie down.

But point taken. Thanks for the heads up.

16 Oct 2010, 2:50 PM
#57
scrat avatar

scrat

Zen Follower

Join Date:
Dec 2005
Posts:
451
Plugin Contributions:
0

Re: Bringing page with JQuery into store

blahblah4949, have you succeeded with importing the scroll image arrows and dots with this 'jquery' app.
I have it working with the basic .css file but as soon as I add custom settings and custom .css settings the app seems to mis-behave, just not showing these images, or thumb nails !

18 Dec 2010, 2:13 PM
#58
blahblah4949 avatar

blahblah4949

New Zenner

Join Date:
Jul 2010
Location:
London, England
Posts:
58
Plugin Contributions:
0

Re: Bringing page with JQuery into store

Hi Scrat. Sorry for the delay in replying. I've just returned to this after a long break (when I say break, I mean work getting in the way to do anything else). Will be working on upgrading and then moving it over to the clients own url this weekend, so may play around with the dots/scroll arrows soon if you haven't already cracked it.

Let me know if you got it working OK and if you needed to modify things to get it working.

Cheers