Making v154 DIY/Picaflor-Azul templates work with v1.5.5
Making them work with v1.5.5
This is for those upgrading their picaflor-azul or DIY Responsive templates.
A few major changes to the responsive components.
1 - /includes/classes/Mobile_Detect.php
This was updated to the latest version.
2 - /includes/functions/extra_functions/zca_responsive_functions.php
This was added in v1.5.5
3 - /includes/auto_loaders/config.display_mode.php
This file was removed in v1.5.5 and replaced with config.zca_layout.php
4 - /includes/init_includes/init.display_mode.php
This file was removed in v1.5.5 and replaced with init.zca_layout.php
5 - /includes/templates/responsive_classic/common/html_header.php
The call to include the Mobile_Detect class has changed from:
PHP Code:
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
$detect = new Mobile_Detect;
}
to:
PHP Code:
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
}
$detect = new Mobile_Detect;
$isMobile = $detect->isMobile();
$isTablet = $detect->isTablet();
if (!isset($layoutType)) $layoutType = ($isMobile ? ($isTablet ? 'tablet' : 'mobile') : 'default');
the device specific if statements have changed from:
PHP Code:
if ($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') {
echo $responsive_mobile;
} else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){
echo $responsive_tablet;
} else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){
echo '';
} else {
echo $responsive_default;
}
to:
PHP Code:
if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' ) {
echo $responsive_mobile;
} else if ( $detect->isTablet() || $_SESSION['layoutType'] == 'tablet' ){
echo $responsive_tablet;
} else if ( $_SESSION['layoutType'] == 'full' ) {
echo '';
} else {
echo $responsive_default;
}
6 - the DIY changes for /admin/layout_controller.php were never ported to v1.5.5
You can download the v1.5.5 layout_controller.php from the GIT link in my signature.
Cheers!
Re: Making v154 Picaflor-Azul templates work with v1.5.5
And to work in v155 if your template has an /includes/templates/YOUR_TEMPLATE/jscript/jscript_framework.php file , it needs to be replaced by copying the one from /includes/template_default/jscript/jscript_framework.php in v155
Re: Making v154 DIY/Picaflor-Azul templates work with v1.5.5
Quote:
Originally Posted by
rbarbour
Making them work with v1.5.5
5 - /includes/templates/responsive_classic/common/html_header.php
The call to include the Mobile_Detect class has changed from:
PHP Code:
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
$detect = new Mobile_Detect;
}
to:
PHP Code:
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
}
$detect = new Mobile_Detect;
$isMobile = $detect->isMobile();
$isTablet = $detect->isTablet();
if (!isset($layoutType)) $layoutType = ($isMobile ? ($isTablet ? 'tablet' : 'mobile') : 'default');
the device specific if statements have changed from:
PHP Code:
if ($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') {
echo $responsive_mobile;
} else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){
echo $responsive_tablet;
} else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){
echo '';
} else {
echo $responsive_default;
}
to:
PHP Code:
if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' ) {
echo $responsive_mobile;
} else if ( $detect->isTablet() || $_SESSION['layoutType'] == 'tablet' ){
echo $responsive_tablet;
} else if ( $_SESSION['layoutType'] == 'full' ) {
echo '';
} else {
echo $responsive_default;
}
This file as in Responsive Sheffield Blue has other differences besides the two above. Should I merge in those two changes only, or substitute the entire file, or?
Thanks for these tips.
zc 1.5.5 clean install test site with Responsive Sheffiled Blue, imported database from livesite zc 1.5.4 with Responsive Westminster Black.
Re: Making v154 DIY/Picaflor-Azul templates work with v1.5.5
Merge all the differences but when merging these 2, they have changed in v1.5.5 to what I have posted.
Quote:
Originally Posted by
soxophoneplayer
This file as in Responsive Sheffield Blue has other differences besides the two above. Should I merge in those two changes only, or substitute the entire file, or?
Thanks for these tips.
zc 1.5.5 clean install test site with Responsive Sheffiled Blue, imported database from livesite zc 1.5.4 with Responsive Westminster Black.
Re: Making v154 DIY/Picaflor-Azul templates work with v1.5.5
Quote:
Originally Posted by
rbarbour
...
6 - the DIY changes for /admin/layout_controller.php were never ported to v1.5.5
You can download the v1.5.5 layout_controller.php from the GIT link in my signature...
I had success with all these edits for using Sheffield Blue Responsive template on zc 1.5.5.
But I ran into trouble when I tried to add WP4Zen mod on top of that. (posted on that forum). Trying to access the layout controller in the admin panel led to white blank page/error message.
In the end I tried taking two zero's out of the layoutcontroller.php around line #66 so it now looks like this:
PHP Code:
// (BOF - EDIT) ZCA Responsive Components for 1.5.5
$db->Execute("insert into " . TABLE_LAYOUT_BOXES . "
(layout_template, layout_box_name, layout_box_status, layout_box_location, layout_box_sort_order, layout_box_sort_order_single, layout_box_status_single, show_box_min_width)
values ('" . zen_db_input($template_dir) . "', '" . zen_db_input($file) . "', 0, 0, 0, 0, 0, 0)");
// (EOF - EDIT) ZCA Responsive Components for 1.5.5
I'm just fumbling in the dark but that change seems to work - I can access/use the tools/layout controller. I hope I didn't cause other problems that I've yet to see.
Does anything jump out?
Re: Making v154 DIY/Picaflor-Azul templates work with v1.5.5
Quote:
Originally Posted by
soxophoneplayer
I had success with all these edits for using Sheffield Blue Responsive template on zc 1.5.5.
But I ran into trouble when I tried to add WP4Zen mod on top of that. (posted on that forum). Trying to access the layout controller in the admin panel led to white blank page/error message.
In the end I tried taking two zero's out of the layoutcontroller.php around line #66 so it now looks like this:
PHP Code:
// (BOF - EDIT) ZCA Responsive Components for 1.5.5
$db->Execute("insert into " . TABLE_LAYOUT_BOXES . "
(layout_template, layout_box_name, layout_box_status, layout_box_location, layout_box_sort_order, layout_box_sort_order_single, layout_box_status_single, show_box_min_width)
values ('" . zen_db_input($template_dir) . "', '" . zen_db_input($file) . "', 0, 0, 0, 0, 0, 0)");
// (EOF - EDIT) ZCA Responsive Components for 1.5.5
I'm just fumbling in the dark but that change seems to work - I can access/use the tools/layout controller. I hope I didn't cause other problems that I've yet to see.
Does anything jump out?
Wanted to jump in and add this..
The last two values you removed don't appear to have a corresponding column for those values in this SQL statement. (hence why you got the column count errors when activating the WP4Zen sideboxes) Without your edit the SQL statement has only 8 table columns named, but TEN values to insert. (So this SQL statement is either missing two table columns, or has too many values to insert)
Re: Making v154 DIY/Picaflor-Azul templates work with v1.5.5
@DivaVocals
Great explanation! :bigups:
I would assume the errors were there even before the WP4Zen side-boxes were installed.
@soxophoneplayer
As Crystal (@DivaVocals) pointed out, the query tried to insert 10 values into 8 columns.
Removing , 0, 0 was the right option. I must have made one of my most common mistakes (copy and paste), the 10 values are actually used for my commercial templates which allows one to control the display on (Desktop, Tablet and Mobile) devices from the ADMIN Layout Boxes Controller.
I will update the GIT files to reflect.
Quote:
Originally Posted by
soxophoneplayer
I had success with all these edits for using Sheffield Blue Responsive template on zc 1.5.5.
But I ran into trouble when I tried to add WP4Zen mod on top of that. (posted on that forum). Trying to access the layout controller in the admin panel led to white blank page/error message.
In the end I tried taking two zero's out of the layoutcontroller.php around line #66 so it now looks like this:
PHP Code:
// (BOF - EDIT) ZCA Responsive Components for 1.5.5
$db->Execute("insert into " . TABLE_LAYOUT_BOXES . "
(layout_template, layout_box_name, layout_box_status, layout_box_location, layout_box_sort_order, layout_box_sort_order_single, layout_box_status_single, show_box_min_width)
values ('" . zen_db_input($template_dir) . "', '" . zen_db_input($file) . "', 0, 0, 0, 0, 0, 0)");
// (EOF - EDIT) ZCA Responsive Components for 1.5.5
I'm just fumbling in the dark but that change seems to work - I can access/use the tools/layout controller. I hope I didn't cause other problems that I've yet to see.
Does anything jump out?
Quote:
Originally Posted by
DivaVocals
Wanted to jump in and add this..
The last two values you removed don't appear to have a corresponding column for those values in this SQL statement. (hence why you got the column count errors when activating the WP4Zen sideboxes) Without your edit the SQL statement has only 8 table columns named, but TEN values to insert. (So this SQL statement is either missing two table columns, or has too many values to insert)
Re: Making v154 DIY/Picaflor-Azul templates work with v1.5.5
OK, so I guess I didn't thoroughly explain.
1 - /includes/classes/Mobile_Detect.php
This was updated to the latest version and IS NOW INCLUDED in v1.5.5, so DO NOT UPLOAD the version included in your template package.
2 - /includes/functions/extra_functions/zca_responsive_functions.php
This was added in v1.5.5, I'm listing this because it's a NEW file that will cause CONFLICT to your template's device specific (mobileDetect) layout.
3 - /includes/auto_loaders/config.display_mode.php
This file was removed in v1.5.5 and replaced with config.zca_layout.php, so DO NOT UPLOAD the version included in your template package.
4 - /includes/init_includes/init.display_mode.php
This file was removed in v1.5.5 and replaced with init.zca_layout.php, so DO NOT UPLOAD the version included in your template package.
5 - /includes/templates/YOUR_TEMPLATE/common/html_header.php
This file needs to be replaced with the v1.5.5 equivalent and the (mobileDetect, javascript) additions from your templates html_header.php should be merged into the v1.5.5 file.
I cannot list all of the templates additions but the following REQUIRED changes need to be made to your existing templates html_header.php code before merging to correctly work in v1.5.5.
find:
PHP Code:
// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
$detect = new Mobile_Detect;
}
// (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
change to:
PHP Code:
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
}
$detect = new Mobile_Detect;
$isMobile = $detect->isMobile();
$isTablet = $detect->isTablet();
if (!isset($layoutType)) $layoutType = ($isMobile ? ($isTablet ? 'tablet' : 'mobile') : 'default');
the device specific if statements have changed from:
PHP Code:
if ($detect->isMobile() && !$detect->isTablet() or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') {
echo $responsive_mobile;
} else if ($detect->isTablet() or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){
echo $responsive_tablet;
} else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){
echo '';
} else {
echo $responsive_default;
}
to:
PHP Code:
if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' ) {
echo $responsive_mobile;
} else if ( $detect->isTablet() || $_SESSION['layoutType'] == 'tablet' ){
echo $responsive_tablet;
} else if ( $_SESSION['layoutType'] == 'full' ) {
echo '';
} else {
echo $responsive_default;
}
6 - the DIY changes for /admin/layout_controller.php were never ported to v1.5.5 but this file was changed in v1.5.5, so DO NOT UPLOAD the version included in your template package. I provide a download for v1.5.5 via the GIT link in my signature.
7 - As DrByte pointed out
And to work in v155 if your template has an /includes/templates/YOUR_TEMPLATE/jscript/jscript_framework.php file , it needs to be replaced by copying the one from /includes/template_default/jscript/jscript_framework.php in v155
Cheers!
As stated elsewhere, all these templates are getting upgraded, if your still not sure or don't understand. Ask through the respective templates support thread. Someone will help you.
Re: Making v154 DIY/Picaflor-Azul templates work with v1.5.5
Hey guys,
Hopefully one of you can help me. I'm currently using the newest Responsive Sheffield Blue template with the newest version of Zen Cart. Everything was working perfectly until I tried to create a new column/field for user registration. As soon as I did that I couldn't login, create new users or anything and the error code "An unknown response null: :text/html; charset=utf-8: :SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data was received while processing an ajax call. The action you requested could not be completed." popped up.
I removed the two random rows I inserted by accident when trying to create a column in the "zen_customers" part of my database. After I did that I could then login again and create new users but that same error message still pops up which is weird.
I click login, error message pops up, click okay, proceeds to login page and I can login as normal. Help please.
I'd link you to my site but it's all local as I'm learning Zen Cart and I haven't really coded anything for about 6 years.
Gif of what's happening - https://gyazo.com/15b3a8802a00353ca009a1b291bbf78c
Thanks in advance.
Ash.
Re: Making v154 DIY/Picaflor-Azul templates work with v1.5.5
Quote:
Originally Posted by
CSGODeimos
Hey guys,
Hopefully one of you can help me. I'm currently using the newest Responsive Sheffield Blue template with the newest version of Zen Cart. Everything was working perfectly until I tried to create a new column/field for user registration. As soon as I did that I couldn't login, create new users or anything and the error code "An unknown response null: :text/html; charset=utf-8: :SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data was received while processing an ajax call. The action you requested could not be completed." popped up.
I removed the two random rows I inserted by accident when trying to create a column in the "zen_customers" part of my database. After I did that I could then login again and create new users but that same error message still pops up which is weird.
I click login, error message pops up, click okay, proceeds to login page and I can login as normal. Help please.
I'd link you to my site but it's all local as I'm learning Zen Cart and I haven't really coded anything for about 6 years.
Gif of what's happening -
https://gyazo.com/15b3a8802a00353ca009a1b291bbf78c
Thanks in advance.
Ash.
See the second post of this thread for the answer.
Thanks,
Anne