Thanks, learned something.
Thanks, learned something.
I ran into a problem with the current v2.0.0c plugin installed on 1.5.7. When logged in to the shop side and in my account. If you have orders and click on "show all orders it causes an error
The error is the result of the embedded select statement and the missing closing ). I verified that this exists on other sites at the same level.PHP Code:
[25-Nov-2020 14:50:44 UTC] Request URI: /upgrade/index.php?main_page=account_history, IP address: 152.44.114.186
#1 trigger_error() called at [/home//public_html/upgrade/includes/classes/db/mysql/query_factory.php:170]
#2 queryFactory->show_error() called at [/home//public_html/upgrade/includes/classes/db/mysql/query_factory.php:142]
#3 queryFactory->set_error() called at [/home//public_html/upgrade/includes/classes/db/mysql/query_factory.php:269]
#4 queryFactory->Execute() called at [/home//public_html/upgrade/includes/classes/zca/zca_split_page_results.php:86]
#5 zca_splitPageResults->__construct() called at [/home//public_html/upgrade/includes/modules/pages/account_history/header_php_account_history_zca_bootstrap.php:6]
#6 require(/home//public_html/upgrade/includes/modules/pages/account_history/header_php_account_history_zca_bootstrap.php) called at [/home//public_html/upgrade/index.php:35]
--> PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 :: select count(*) as total FROM znc_orders o, znc_orders_total ot, znc_orders_status s WHERE o.customers_id = 15 AND o.orders_id = ot.orders_id AND ot.class = 'ot_total' AND s.orders_status_id = (SELECT orders_status_id FROM znc_orders_status_history osh WHERE osh.orders_id = o.orders_id AND osh.customer_notified >= 0 ==> (as called by) /home//public_html/upgrade/includes/classes/zca/zca_split_page_results.php on line 86 <== in /home//public_html/upgrade/includes/classes/db/mysql/query_factory.php on line 170.
The way I got around it was by modifying ZCA_split_page_results to test if the query contained "(select".
Hope this helps if others run into it. BTW just adding the closing paren breaks the product listing page which is why I needed the if/else.PHP Code:
//bof test for (select and add closing paren if needed
if (strpos($query_lower, "(select", $pos_from)){
$count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from)) . ") ";
} else {
$count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from));
}
//eof test select
A quick modification to this. I discovered that if you had an order history with multiple orders it would break. My updated fix isPHP Code:
if (strpos($query_lower, "(select", $pos_from)){
$count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from)) . " LIMIT 1) ";
} else {
$count_query = "select count(" . $count_string . ") as total " . substr($this->countQuery, $pos_from, ($pos_to - $pos_from));
}
There are oodles and boodles of changes coming up for the Bootstrap-4 template in support of zc157. You can check out the current beta (fairly close to release) here: https://github.com/lat9/ZCA-Bootstrap-Template
I did a quick install with php 7.3, zencart 1.5.7b, and demo data loaded. The problem does not occur with the beta version template code installed. As a result there is no need to make the change unless you receive the error I documented and cannot upgrade beyond 2.0.0c.
I've just submitted v3.0.0 of the ZCA Bootstrap-4 template to the Plugins area: https://www.zen-cart.com/downloads.php?do=file&id=2191.
This version of the template supports Zen Cart 1.5.7 and later installations only and runs best on Zen Cart 1.5.7b.
Don't even think about installing this version on a previous Zen Cart version, there have been database changes and functions added that the template assumes to be present!
Early adopters can get the latest by going to the template's new GitHub home's "Releases" (https://github.com/lat9/ZCA-Bootstrap-Template/releases) page, where the v3.0.0 zip-file can be downloaded. Thanks to @drbyte for collaborating to get this standards-based template released!
I've been trying out ZCA-Bootstrap-Template as part of an upgrade to zc157b. I want to put a multilevel dropdown menu in the header bar. I also want each list item that has a sublevel to have a pointer. I've got the button in the header and the first tier list items listed in the pull down. The list item text occupies the entire width of the container with padding of 24 pixels. There is no text wrap-around. I've used a span for the pointer with the pointer right aligned and changed the container's right padding so the pointer is closer to the edge of the box. Space for the text is 95% and 5% for the pointer. But text still extends to the edge of the box and/or wraps so the pointer is on a different line. How do I get the text to stay in its 95% or get the box large enough to accommodate both text and pointer with some padding on the same line? See screen shot. The problem is most likely CSS so the CSS follows:TIA<Code:#rightPointer, #noPointer { display: inline-block; float:right; text-align:right; color: black; font-size:2rem; line-height: 1rem; padding-bottom:.35rem; padding-top:.15rem; width: 5%; } .dropdown-item { padding-right:.5rem; width:95% }
Dave
Probably because you are confusing the browser with the size of the box.
One portion is 95% and the other is 5%. You would think that, adding up to 100%, this would be fine.
BUT, you add in padding. .5rem (8px) becomes 0.5% on a screen width of 1600. Now our total is 100.5%
On a mobile with 768 width, you're now at ~101.5%. If the entire area is only 30% of the total width..... Well, you can see it just gets worse.
Neither is a huge amount BUT, it does take you "outside the box."
Thinking outside the box might be fine but, displaying outside the box messes things up.
Luckily, CSS can help with that. Take a look at https://www.w3schools.com/css/css3_box-sizing.asp. It will help you better understand the problem and the fix.
Are You Vulnerable for an Accessibility Lawsuit?
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.
Bookmarks