Zen Cart Logo
Forums / Addon Templates / Responsive DIY Template Default for v1.5.x

Responsive DIY Template Default for v1.5.x

Views: 48,099

Results 221 to 240 of 332
13 Jun 2015, 6:57 PM
#221
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Responsive DIY Template Default for v1.5.x

Look for this code:

<!-- ******************** EXAMPLE FOR 2.1b********************   --> 
<!-- BOF: Per File, Device Type Javascript  -->
<?php
/**
 * 2.0 utilizes php-mobile-detect, allows us to use different Javascript for different devices.
[B] */ <-----REMOVE THIS[/B]

if ($detect->isMobile() && !$detect->isTablet() && (empty($_SESSION['display_mode'])) or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') { ?>

<script type="text/javascript">
	    document.write('This must be a Mobile phone!')
	  </script>

<?php } else if ($detect->isTablet() && (empty($_SESSION['display_mode'])) or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){ ?>

	  <script type="text/javascript">
	    document.write('This must be a Tablet!')
	  </script>
		
<?php } else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){ ?>

	  <script type="text/javascript">
	    document.write('This must be a Non-Responsive Desktop!')
	  </script>

<?php } else { ?>

	  <script type="text/javascript">
	    document.write('This must be a Desktop!')
	  </script>

<?php } [B] */ <-----ADD THIS[/B]?>
<br />
<!-- EOF: Per File, Device Type Javascript  -->
<!-- ******************** EXAMPLE FOR 2.1b********************  -->

You can remove the "Site View" links by going to:

ADMIN > CONFIGURATION > CONFIGURE ZCA RESPONSIVE TEMPLATE SWITCH

and changing the configurations to "false" or

simply removing the "Link Text" will remove the links

Thanks,
ZCAdditions
rbarbour

marton_1:

Ah, probably my post was not clearly written :(

I reversed my changes so my page is no longer turned off :)

I just would like to stop displaying "This must be a Desktop!" at the top of the pages.
Example code would be nice :) :)

Site is here www[.]simmar[.]ch/catalog

Thanks

14 Jun 2015, 12:24 PM
#222
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

Great that worked fine (of course) and now I understand your original answer :)

thanks again and for your fast reply :)

rbarbour:

Look for this code:

<!-- ******************** EXAMPLE FOR 2.1b******************** --> <!-- BOF: Per File, Device Type Javascript --> <?php /** * 2.0 utilizes php-mobile-detect, allows us to use different Javascript for different devices. [B] */ <-----REMOVE THIS[/B] if ($detect->isMobile() && !$detect->isTablet() && (empty($_SESSION['display_mode'])) or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') { ?> <script type="text/javascript"> document.write('This must be a Mobile phone!') </script> <?php } else if ($detect->isTablet() && (empty($_SESSION['display_mode'])) or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){ ?>
  <script type="text/javascript">
    document.write('This must be a Tablet!')
  </script>
<?php } else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){ ?>
  <script type="text/javascript">
    document.write('This must be a Non-Responsive Desktop!')
  </script>
<?php } else { ?>
  <script type="text/javascript">
    document.write('This must be a Desktop!')
  </script>
<?php } [B] */ <-----ADD THIS[/B]?> <br /> <!-- EOF: Per File, Device Type Javascript --> <!-- ******************** EXAMPLE FOR 2.1b******************** --> ``` > > You can remove the "Site View" links by going to: > > ADMIN > CONFIGURATION > CONFIGURE ZCA RESPONSIVE TEMPLATE SWITCH > > and changing the configurations to "false" or > > simply removing the "Link Text" will remove the links > > Thanks, > ZCAdditions > rbarbour
15 Jun 2015, 5:51 PM
#223
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

Sorry I have a new problem :(

When I click on a product image in my web site that is supposed to be show a bigger image (image_LRG) then in Chrome it comes up the same size; works OK in ie - that is it shows up bigger. I have Chrome Version 43.0.2357.124 m and ie version 11.0.9600.17842.
Actually I checked and the image_LRG is a little larger in Chrome; it should increase from 200px wide to 500 but only reaches 285. :(

When I remove the "max-width:100%;" from line 21 of your stylesheet.css then the image_LRG comes up with the correct larger size in Chrome.

I have left the "max-width:100%;" in the CSS because I do not know what else could be effected if I remove it. My site is simmar[.]ch/catalog.

Hope you can help :)

15 Jun 2015, 7:02 PM
#224
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Responsive DIY Template Default for v1.5.x

Check in this file:

/includes/templates/responsive_template_default/common/html_header.php

All the way to the bottom, look to see if this code exists:

// (BOF - 2.1b) Responsive DIY Template Default for 1.5.x (65)

if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) {

echo '';

} else {

marton_1:

Sorry I have a new problem :(

When I click on a product image in my web site that is supposed to be show a bigger image (image_LRG) then in Chrome it comes up the same size; works OK in ie - that is it shows up bigger. I have Chrome Version 43.0.2357.124 m and ie version 11.0.9600.17842.
Actually I checked and the image_LRG is a little larger in Chrome; it should increase from 200px wide to 500 but only reaches 285. :(

When I remove the "max-width:100%;" from line 21 of your stylesheet.css then the image_LRG comes up with the correct larger size in Chrome.

I have left the "max-width:100%;" in the CSS because I do not know what else could be effected if I remove it. My site is simmar[.]ch/catalog.

Hope you can help :)

15 Jun 2015, 7:52 PM
#225
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

rbarbour:

Check in this file:

/includes/templates/responsive_template_default/common/html_header.php

All the way to the bottom, look to see if this code exists:

// (BOF - 2.1b) Responsive DIY Template Default for 1.5.x (65)

if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) {

echo '';

} else {


Thank you for your quick reply
Looks like I have this code :)
See copy from my file below

// (BOF - 2.1b) Responsive DIY Template Default for 1.5.x (65)

if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) {

echo '';

} else {

If I look at the file on my server it is the same, see;

// (BOF - 2.1b) Responsive DIY Template Default for 1.5.x (65)

if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) {

echo '';

} else {

15 Jun 2015, 9:00 PM
#226
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Responsive DIY Template Default for v1.5.x

I cannot duplicate in any browser

You have an extra closing </div> in your tpl_product_info.php file which is breaking your layout.

I will continue to troubleshoot the image issue

marton_1:


Thank you for your quick reply
Looks like I have this code :)
See copy from my file below

// (BOF - 2.1b) Responsive DIY Template Default for 1.5.x (65)

if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) {

echo '';

} else {

If I look at the file on my server it is the same, see;

// (BOF - 2.1b) Responsive DIY Template Default for 1.5.x (65)

if (COLUMN_WIDTH == '0' || (in_array($current_page_base,explode(",",'popup_image,popup_image_additional')) )) {

echo '';

} else {

15 Jun 2015, 9:07 PM
#227
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Responsive DIY Template Default for v1.5.x

On another note:

This template package comes fully loaded with (NOTHING)!

This template package should only be used as a starting point for designing your own template. There are no added plugins or any bells or whistles included in this template package.

This is Zen Cart's stock Default Template made Responsive.

Please use the Responsive Template Conversion Framework to convert existing templates to responsive ones. (ALSO being uploaded today!) Only requires 2 files to be merged.

3.0FREE is complete and will be upload by days end

Version: 3.0FREE
() Updated Responsive_Template_Default_Installation.htm file
(
) Removes all EXAMPLES from template files
(*) Added a Responsive_Template_Default_Examples.htm file

Major Changes
() Removes my $_SESSION['display_mode'] code and utilizes the php-mobile-detect built in $_SESSION functions. Significantly minimizes (if) statements for serving up correct layouts.
(
) Side-box display is now controlled via jQuery. Allows you to choose which boxes display on both mobile and tablet views now by altering a single define statement. Instructions to convert to Configurations is included in the Responsive_Template_Default_Examples.htm file.
(*) Removes "Template Activation", once selected via admin>tools>template selection, the template is responsive.

Removes the following Admin/Catalog files:
() YOUR_ADMIN_FOLDER / layout_controller.php
(
) YOUR_ADMIN_FOLDER / includes / auto_loaders / config.responsive_default.php
() YOUR_ADMIN_FOLDER / includes / extra_datafiles / admin_config_menu_zca_responsive_template_switch.php
(
) YOUR_ADMIN_FOLDER / includes / init_includes / init_responsive_default.php
() YOUR_ADMIN_FOLDER / includes / installers / responsive_default / 2_1b.php
(
) YOUR_ADMIN_FOLDER / includes / languages / english / extra_definitions / responsive_default.php
() includes / auto_loaders / config.display_mode.php
(
) includes / modules / responsive_template_default / column_left.php
() includes / modules / responsive_template_default / column_right.php
(
) includes / templates / responsive_template_default / common / responsive_default.php
() includes / templates / responsive_template_default / common / responsive_mobile.php
(
) includes / templates / responsive_template_default / common / responsive_tablet.php
() includes / templates / responsive_template_default / common / tpl_box_default_left.php
(
) includes / templates / responsive_template_default / common / tpl_box_default_right.php
() includes / templates / responsive_template_default / common / tpl_footer.php
(
) includes / templates / responsive_template_default / common / tpl_header.php

Reason for changes:
As no one but the Zen Cart team is privileged to knowing what framework will be used in v160, I have minimized my code to limit the merging of core files and template override files as much as possible.

I have done my best to ease the upgrade process!

15 Jun 2015, 10:13 PM
#228
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

rbarbour:

I cannot duplicate in any browser

You have an extra closing </div> in your tpl_product_info.php file which is breaking your layout.

I will continue to troubleshoot the image issue

Great thanks; I appreciate your time and efforts.

I could not find a tpl_product_info.php file to correct the extra /div that you mentioned.

I found the two files below but they are unchanged from my original download of 1.5.1 a couple of years ago.
tpl_product_info_display.php
tpl_product_info_noproduct.php

15 Jun 2015, 10:27 PM
#229
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Responsive DIY Template Default for v1.5.x

My mistake, the file would be tpl_product_info_display.php

If you go to a product page, you will notice the right column sits under the center column

If you right click on page to "view page source" and scroll down you will see the added </div> and where about it is located.

Still unable to duplicate the image issue but haven't given up

marton_1:

Great thanks; I appreciate your time and efforts.

I could not find a tpl_product_info.php file to correct the extra /div that you mentioned.

I found the two files below but they are unchanged from my original download of 1.5.1 a couple of years ago.
tpl_product_info_display.php
tpl_product_info_noproduct.php

15 Jun 2015, 10:57 PM
#230
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Responsive DIY Template Default for v1.5.x

3.0FREE can be seen in action here

I also forgot to mention:
New CSS was added to handle the stock zen cart tables, to see check out the product listing pages and shopping cart page

15 Jun 2015, 11:17 PM
#231
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

rbarbour:

My mistake, the file would be tpl_product_info_display.php

If you go to a product page, you will notice the right column sits under the center column

If you right click on page to "view page source" and scroll down you will see the added </div> and where about it is located.

Still unable to duplicate the image issue but haven't given up

Thanks, I have been working with compuzers for 50 years but I still hate them :)

Not sure what you mean by "you will notice the right column sits under the center column" See screenshot of the Desktop version.

Appreciate your help but it is after 1 am here so I will hit the sack. :(

Cheers

15 Jun 2015, 11:35 PM
#232
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Responsive DIY Template Default for v1.5.x

Doesn't break on all product pages

Look at this page:
index.php?main_page=product_info&cPath=69_115&products_id=1737

I sent you a PM

marton_1:

Thanks, I have been working with compuzers for 50 years but I still hate them :)

Not sure what you mean by "you will notice the right column sits under the center column" See screenshot of the Desktop version.

Appreciate your help but it is after 1 am here so I will hit the sack. :(

Cheers

18 Jun 2015, 8:18 AM
#233
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

Did some more testing!

I only see this problem (Image_LRG not large) on my desktop. If I use a tablet or a mobile it is OK.

If I use the ismobile link on my desktop then the image is still not large

18 Jun 2015, 9:52 AM
#234
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

I thought a screenshot or two would be helpful? :)

23 Jun 2015, 7:41 AM
#235
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

rbarbour:

Doesn't break on all product pages

Look at this page:
index.php?main_page=product_info&cPath=69_115&products_id=1737

I sent you a PM

I checked the tpl_product_info_display.php but no extra /div; I even gave each div and /div a numbered id to double check.
Got excited when I found an extra /div in the tpl_footer.php (copy/paste error!) but I have yet another /div somewhere.

Does anyone know if there is a list somewhere of the PHP files that are unique to this level; I do not see a layout break at higher levels.

23 Jun 2015, 3:03 PM
#236
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Responsive DIY Template Default for v1.5.x

marton_1:

I checked the tpl_product_info_display.php but no extra /div; I even gave each div and /div a numbered id to double check.
Got excited when I found an extra /div in the tpl_footer.php (copy/paste error!) but I have yet another /div somewhere.

Does anyone know if there is a list somewhere of the PHP files that are unique to this level; I do not see a layout break at higher levels.

I would run the page through the w3c validator to see what lines the errors are happening on.

Thanks,

Anne

24 Jun 2015, 10:45 AM
#237
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

picaflor-azul:

I would run the page through the w3c validator to see what lines the errors are happening on.

Thanks,

Anne

Thanks for the idea

The validator showed up an extra /div - because I have given ids to many of my /divs I can see this one is in TPL_MAIN_PAGE_PHP on line 275.
This seems to be in a good place because here is "* prepares and displays right column sideboxes"

However I checked this PHP and it has 13 divs and 13 /divs so no extra /div. Anyway I tried commenting this /div out but it did not fix my right column problem.
The only change I have made to TPL_MAIN_PAGE_PHP is to add the Google analytics tag at the end

<?php if (GOOGLE_ANALYTICS_TRACKING_TYPE != "Asynchronous") { require(DIR_WS_TEMPLATE . 'google_analytics/google_analytics.php'); } ?>

I ran the validator again with this /div commented out and there were no div errors reported.

24 Jun 2015, 12:39 PM
#238
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

I noticed I only have this right column problem on pages that have attributes (like, size, color, etc.) for products that have no attributes the right column is OK.

I checked all the PHP files that have "attribute" in their name but they all seem to the ones I downloaded 2 years ago when I started with Zen cart.

24 Jun 2015, 10:36 PM
#239
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,869
Plugin Contributions:
7

Re: Responsive DIY Template Default for v1.5.x

I made quite a few edits for validation while testing this a few weeks ago and since got sidetracked as usual before I could feedback my changes to the author...but after going back and having a look for ten minutes these seem the only changes necessary to cure the errors.

As always, caveat emptor and BACKUP first...I don't have the moment to check these isolated changes I have just extracted from the file comparison.

tpl_footer.php

<!--bof-navigation display --><?php // (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)    if (COLUMN_WIDTH == '0') { ?><div id="navSuppWrapper"><?php }else{ ?><div id="navSuppWrapper" class="<?php echo $fluidisFixed; ?>"><?php } //(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)--> ?><div id="navSupp">

tpl_header.php

<!--bof-header logo and navigation display--><?phpif (!isset($flag_disable_header) || !$flag_disable_header) {?><?php // (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)    if (COLUMN_WIDTH == '0') {?><div id="headerWrapper"><?php }else{ ?><div id="headerWrapper" class="<?php echo $fluidisFixed; ?>"><?php } // (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)v ?><!--bof-navigation display-->

tpl_main_page.php

  require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');?>
<?php // (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)if (COLUMN_WIDTH == '0'){ ?></div><!--end mainWrapper--><?php } //(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>

and

<!--eof- banner #6 display --><?php //(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)if (COLUMN_WIDTH == '0'){ ?><!--</div>steve removed--><!--really needed? <br class="clearBoth" />--><!--steve was missing closing slash--><?php }else{ ?><?php //do nothing ?><?php } //(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?></body>
25 Jun 2015, 6:54 AM
#240
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Responsive DIY Template Default for v1.5.x

torvista:

I made quite a few edits for validation while testing this a few weeks ago and since got sidetracked as usual before I could feedback my changes to the author...but after going back and having a look for ten minutes these seem the only changes necessary to cure the errors.

As always, caveat emptor and BACKUP first...I don't have the moment to check these isolated changes I have just extracted from the file comparison.

tpl_footer.php

<!--bof-navigation display --><?php // (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65) if (COLUMN_WIDTH == '0') { ?><div id="navSuppWrapper"><?php }else{ ?><div id="navSuppWrapper" class="<?php echo $fluidisFixed; ?>"><?php } //(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)--> ?><div id="navSupp">
> 
> tpl_header.php
> ```php
<!--bof-header logo and navigation display--><?phpif (!isset($flag_disable_header) || !$flag_disable_header) {?><?php // (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)    if (COLUMN_WIDTH == '0') {?><div id="headerWrapper"><?php }else{ ?><div id="headerWrapper" class="<?php echo $fluidisFixed; ?>"><?php } // (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)v ?><!--bof-navigation display-->

tpl_main_page.php

require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');?>

<?php // (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)if (COLUMN_WIDTH == '0'){ ?></div><!--end mainWrapper--><?php } //(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?>
> 
> and
> 
> ```php
<!--eof- banner #6 display --><?php //(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)if (COLUMN_WIDTH == '0'){ ?><!--</div>steve removed--><!--really needed? <br class="clearBoth" />--><!--steve was missing closing slash--><?php }else{ ?><?php //do nothing ?><?php } //(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65) ?></body>

Tried this but the header change crashed my site (no problem I had a backup).
There are two divs versus one in the current code; does the second div need to be closed somehow, I do not see a /div?