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

Bringing page with JQuery into store

Locked

Views: 10,600

Results 21 to 40 of 58
This thread is locked. New replies are disabled.
16 Aug 2010, 6:29 PM
#21
drbyte avatar

drbyte

Sensei

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

Bringing page with JQuery into store

Also, in your EZ-page content, you have this:```
$(window).load(function() {
$('#slider').nivoslider();
});

But, shouldn't that be ".nivoSlider()", as in with a capital 'S'?
17 Aug 2010, 9:47 PM
#22
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:

Also, in your EZ-page content, you have this:```
$(window).load(function() {
$('#slider').nivoslider();
});

> But, shouldn't that be ".nivoSlider()", as in with a capital 'S'?

Nice spot DrByte :smile:

Well that's got things moving with the slider now, although it's not going as it should yet.

Will have a tinker around and see what comes up.


Edit: Is there any chance this particular slider is not compatible with Zen Cart somehow? I notice on the slider homepage there is a specific version for wordpress..
24 Aug 2010, 2:53 AM
#23
ftdc avatar

ftdc

New Zenner

Join Date:
Oct 2009
Location:
Stockholm, Sweden
Posts:
16
Plugin Contributions:
0

Re: Bringing page with JQuery into store

DrByte:

No, it doesn't make sense.
And there is no need to touch html_header.php at all.
what you mean?
you still have to link in the js from the html_header.php ore is their a better way?

24 Aug 2010, 3:21 AM
#24
drbyte avatar

drbyte

Sensei

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

Re: Bringing page with JQuery into store

ftdc:

what you mean?
you still have to link in the js from the html_header.php ore is their a better way?
If you want the ability to just "drop in" your own custom components, then you can do it by following the built-in support for auto-loading javascript and even css files, etc.
No need to edit html_header.php and thus risk breaking your template or making upgrades more difficult than necessary.

The details are documented in your Zen Cart /docs/ folder and also online: http://www.zen-cart.com/wiki/index.php/Customisation_-_Templates_-_Javascript

They're also discussed elsewhere in this thread above, and dozens of other threads on related topics.

28 Aug 2010, 10:17 PM
#25
blahblah4949 avatar

blahblah4949

New Zenner

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

Re: Bringing page with JQuery into store

Can't seem to find the reason for the glitch with the slider. This is how it should work:

Testsite

but how it's working in ZC:

ZCsite

Would this suggest the slider I have chosen is not compatible with ZC? If so, is this a common occurance or have I just been unlucky choosing this particular slider?

Or could their be another reason for this not running smoothly?

29 Aug 2010, 1:53 PM
#26
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,

Following on from this thread: http://www.zen-cart.com/forum/showthread.php?t=161315

I'm looking to solve this glitch that the slider currently has.

http://www.zentest.net/store/index.php?main_page=page&id=20

Could it be the slider is not compatible with Zen Cart going on these results? Or have I screwed up somewhere? Please let me know what other info would be needed to make a better judgment if needed.

Thanks

**** EDITED *** Never ever post in a forum, email, newsletter etc. the zenid or zenAdminID or you will be doomed!!** :eek:

29 Aug 2010, 5:36 PM
#27
blahblah4949 avatar

blahblah4949

New Zenner

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

Re: Bringing page with JQuery into store

:oops:

Thanks for the edit/heads up Ajeh

:smile:

29 Aug 2010, 9:09 PM
#28
drbyte avatar

drbyte

Sensei

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

Re: Bringing page with JQuery into store

So, to troubleshoot I figured I'd use the regular old process of comparing all the components of the two sites to see what's different. And the solution became very obvious almost immediately.

Your style_nivo-slider.css file contains jquery code instead of the appropriate CSS that the nivo-slider.css file from your test site does.
Fixing that will fix the jQuery execution problems you're having.
ie: I copied the nivo-slider.css content and replaced the style_nivo-slider.css file content with it, and it works fine.
I was afraid it was gonna take awhile to copy and recreate the site to figure out what was wrong ... but it took less than 5 min to find that one. :clap:

29 Aug 2010, 11:20 PM
#29
blahblah4949 avatar

blahblah4949

New Zenner

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

Re: Bringing page with JQuery into store

:blush: x 100.

Man, I must of had too much coffee the day I did that! Thanks very much for taking the time to look at this once again DrByte. All fixed now and running fine as you said.

Sometimes you can't see for looking when trying to figure out what's wrong with something.

Cheers

:smile:

30 Aug 2010, 3:41 AM
#30
drbyte avatar

drbyte

Sensei

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

Re: Bringing page with JQuery into store

Been there done that. :blush:

Firebug is a very handy tool :D

30 Aug 2010, 2:35 PM
#31
blahblah4949 avatar

blahblah4949

New Zenner

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

Re: Bringing page with JQuery into store

Yes, I have installed firebug and will be using it in future!

Well, I guess the last thing I need to do is lose the external html files I have in my root folder and point the site URL to the Zen Cart homepage with the slider.

I'm aware I have gone about this the wrong way from the start. I should have put Zen Cart in the root folder and worked on that from the off.

So...If I delete the external stuff, can I just point the url https://www.zentest.net in this case, to the home page in my ZC (which is an EZ page)?

Just wanted to check before I start deleting stuff and ruin the good work up until now.

Hope the above makes sense, please let me know if any more info is required.

31 Aug 2010, 11:55 AM
#33
blahblah4949 avatar

blahblah4949

New Zenner

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

Re: Bringing page with JQuery into store

Great :smile:

Zen Cart is now sitting in my root folder.

Site

Kinda confused with the links though. Is there a simple way to point the 'home' link to the url? At the moment it points to a new store page, but then if you click the 'store' button in the header, it takes you to the proper store page I have been working on.

31 Aug 2010, 5:49 PM
#34
drbyte avatar

drbyte

Sensei

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

Re: Bringing page with JQuery into store

I'm confused by your choice of words.

I'm guessing you're asking whether it's possible to set an EZ-Page as the Home Page? If so, the answer is: that's not a built-in selectable option at the present time.

31 Aug 2010, 6:14 PM
#35
blahblah4949 avatar

blahblah4949

New Zenner

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

Re: Bringing page with JQuery into store

Sorry, yes you guessed right: I wanted to use the EZ page as the home page. That would explain why Kim passed by on my other post asking why I was using an EZ page then!

Hmm. So if that's the case, would there be another way to achieve the effect I want i.e. the slider as the home page with a link to the store?

31 Aug 2010, 7:06 PM
#36
drbyte avatar

drbyte

Sensei

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

Re: Bringing page with JQuery into store

Try this override code.

Create and upload 2 new files, exactly as shown below:

  1. /includes/init_includes/init_ezpage_as_home_page.php```
<?php /** * ezpage_as_home_page * * @package initSystem * @copyright Copyright 2003-2010 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: init_ezpage_as_home_page.php 2010-08-31 14:45:33Z drbyte $ */ if (! defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } if ($this_is_home_page) { // SET THE DESIRED EZ-PAGE NUMBER HERE: $_GET['id'] = 20; // DO NOT TOUCH BELOW: $_GET['main_page'] = 'page'; $current_page_base = 'page'; $code_page_directory = 'includes/modules/pages/page'; } ``` 2. /includes/auto_loaders/config.ezpage_as_home_page.php``` <?php /** * autoloader activation point for ezpage override * * @package initSystem * @copyright Copyright 2003-2010 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: config.ezpage_as_home_page.php 2010-08-31 14:25:33Z drbyte $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } /** * point 190 was selected based on dependencies */ $autoLoadConfig[190][] = array('autoType'=>'init_script', 'loadFile'=> 'init_ezpage_as_home_page.php'); ```
31 Aug 2010, 9:21 PM
#37
blahblah4949 avatar

blahblah4949

New Zenner

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

Re: Bringing page with JQuery into store

Wow that's fantastic! :clap:

Didn't think it could be done but it works perfect.

Thanks very much for your support DrByte. It's been a massive help.

I owe you a beer!
:cheers:

31 Aug 2010, 9:47 PM
#38
drbyte avatar

drbyte

Sensei

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

Re: Bringing page with JQuery into store

I wish you well. If I'm in London sometime I'll look you up. ;)

31 Aug 2010, 10:38 PM
#39
blahblah4949 avatar

blahblah4949

New Zenner

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

Re: Bringing page with JQuery into store

Nice one

:smile:

2 Sep 2010, 9:36 PM
#40
blahblah4949 avatar

blahblah4949

New Zenner

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

Re: Bringing page with JQuery into store

Spent a few hours today trying to figure out a couple things. I think I'm getting close with one but not there yet.

  1. Would like to have the header logo point to the 'home' page and not the store. I have read up and believe I need to add tpl_header.php to my custom folder (which I've done). I've hacked around and inserted the url in various places in the file but it still points to the store. Could someone say where and what edits I need to make please?
<?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_SERVER . DIR_WS_CATALOG . '">'; ?><?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_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>
<?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 } ?>
  1. Is it possible to move the 'Store' link in the footer of the site along so it runs in the same order as the header links? i.e. 'home' 'about' 'store' etc

Thanks for your help