Zen Cart Logo
Forums / Addon Templates / ZCA Bootstrap 4 Template [Support Thread]

ZCA Bootstrap 4 Template [Support Thread]

Views: 542,375

Results 261 to 280 of 1,686
28 Oct 2020, 11:26 PM
#262
angie1 avatar

angie1

New Zenner

Join Date:
Oct 2020
Location:
South Yorkshire, UK.
Posts:
28
Plugin Contributions:
0

Re: ZCA Bootstrap 4 Template [Support Thread]

Thank you dbltoe have spent hours over the last few days reading through the docs and missed that somehow, its so long since have used Zencart and had a shopping cart that am lost as it was V1.3.9 when last had one so am a bit lost right now

10 Nov 2020, 2:06 PM
#263
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: ZCA Bootstrap 4 Template [Support Thread]

Looking to customize some of the buttons, i.e. the "previous" "product listing" "next" ones when viewing a product.
Spent lots of time searching for the snip where to add the class, but can't seem to find it.

Appreciate if someone can suggest the file that outputs the following:

<button type="button" class="btn button_prev button_prev"> <button type="button" class="btn button_return_to_product_list button_return_to_product_list"> <button type="button" class="btn button_next button_next">

Which btw repeats the "button_prev", "button_return_to_product_list", and "button_next".

And eventually how to add the extra class.

Thank you

10 Nov 2020, 3:12 PM
#264
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: ZCA Bootstrap 4 Template [Support Thread]

keneso:

Looking to customize some of the buttons, i.e. the "previous" "product listing" "next" ones when viewing a product.
Spent lots of time searching for the snip where to add the class, but can't seem to find it.

Appreciate if someone can suggest the file that outputs the following:

<button type="button" class="btn button_prev button_prev"> <button type="button" class="btn button_return_to_product_list button_return_to_product_list"> <button type="button" class="btn button_next button_next">

Which btw repeats the "button_prev", "button_return_to_product_list", and "button_next".

And eventually how to add the extra class.

Thank you

includes/templates/bootstrap/templates/tpl_products_next_previous.php

line 42:

<a class="p-1" href="<?php echo zen_href_link(FILENAME_DEFAULT, "cPath=$cPath"); ?>"><?php echo zen_image_button(BUTTON_IMAGE_RETURN_TO_PROD_LIST, BUTTON_RETURN_TO_PROD_LIST_ALT); ?></a>

add extra class parm to the zen_image_button function.

you also have to go outside of the template and look here:

includes/modules/product_prev_next.php

10 Nov 2020, 4:01 PM
#265
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: ZCA Bootstrap 4 Template [Support Thread]

Thank you.
Actually to customize it I could use the button_prev class generated, I would like to know how to add the extra param in the files (snip of code) you suggested.

10 Nov 2020, 5:12 PM
#266
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: ZCA Bootstrap 4 Template [Support Thread]

keneso:

Thank you.
Actually to customize it I could use the button_prev class generated, I would like to know how to add the extra param in the files (snip of code) you suggested.

apparently you can not add an additional class element like so:

echo zen_image_button(BUTTON_IMAGE_RETURN_TO_PROD_LIST, BUTTON_RETURN_TO_PROD_LIST_ALT, 'class="myNewClass"');

that class gets filtered out. you can do:

echo zen_image_button(BUTTON_IMAGE_RETURN_TO_PROD_LIST, BUTTON_RETURN_TO_PROD_LIST_ALT, 'crap="myNewClass"');

that crap does not get filtered out; but it provides no help to what you want to do...

in looking at the code, i would build an observer. since you are using bootstrap, i would go on the assumption that IMAGE_USE_CSS_BUTTONS is set to 'yes'. if so, i would look to build an observer that hits this event in functions/html_output.php:

if ($type=='button') {
      // link button
      // -----
      // Give an observer the chance to provide alternate formatting for the button (it's set to an empty string
      // above).  If the value is still empty after the notification, create the standard-format
      // of the button.
      //
      $GLOBALS['zco_notifier']->notify(
            'NOTIFY_ZEN_CSS_BUTTON_BUTTON',
            array(
                'button_name' => $button_name,
                'text' => $text,
                'sec_class' => $sec_class,
                'parameters' => $parameters,
            ),
            $css_button
      );

adding a class to a ZC generated button seems like a lot of work!

here is info on building an observer class:

https://docs.zen-cart.com/dev/code/notifiers/

best.

10 Nov 2020, 5:25 PM
#267
drbyte avatar

drbyte

Sensei

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

Re: ZCA Bootstrap 4 Template [Support Thread]

Since you're customizing this unique for your template, you could just skip the use of the zen_image_button function and put your own HTML code in its place.

11 Nov 2020, 12:41 PM
#268
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: ZCA Bootstrap 4 Template [Support Thread]

Thank you both.

@carlwhat
I'll try to learn, in the meantime I'll use the class generated

@DrByte
Yes, I did think about it as well, but being at the beginning of a new customization I thought to try to learn a different approach in case needed for more.

@both + rbarbour
However I am puzzled by the double output of "button_prev" class, is it a bug, is it on purpose for reasons beyond my comprehension and knowledge?

11 Nov 2020, 4:12 PM
#269
drbyte avatar

drbyte

Sensei

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

Re: ZCA Bootstrap 4 Template [Support Thread]

I believe the duplication may be a bug. Harmless though.

It's always best to try to style the provided classes if possible (in your own self-added stylesheet), rather than adding more classes to the template.

That said, if you wanted to add your own style, carlwhat was nearly correct when proposing adding a 3rd parameter: it should have been the 4th parameter instead, and be only the name of the class you wanted to add.
eg:

echo zen_image_button(BUTTON_IMAGE_RETURN_TO_PROD_LIST, BUTTON_RETURN_TO_PROD_LIST_ALT[B], '', 'myNewClass'[/B]);
11 Nov 2020, 4:38 PM
#270
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,953
Plugin Contributions:
8

Re: ZCA Bootstrap 4 Template [Support Thread]

DrByte:

I believe the duplication may be a bug. Harmless though.

It's always best to try to style the provided classes if possible (in your own self-added stylesheet), rather than adding more classes to the template.

That said, if you wanted to add your own style, carlwhat was nearly correct when proposing adding a 3rd parameter: it should have been the 4th parameter instead, and be only the name of the class you wanted to add.
eg:

echo zen_image_button(BUTTON_IMAGE_RETURN_TO_PROD_LIST, BUTTON_RETURN_TO_PROD_LIST_ALT[B], '', 'myNewClass'[/B]);


holy shismoly!  how did i miss that!  

apologies.

drByte is correct.  adding it to the 4th parameter does indeed add another class.

best.
12 Nov 2020, 12:31 AM
#271
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: ZCA Bootstrap 4 Template [Support Thread]

Thanks, learned something.

25 Nov 2020, 3:03 PM
#272
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: ZCA Bootstrap 4 Template [Support Thread]

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

[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 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.

The way I got around it was by modifying ZCA_split_page_results to test if the query contained "(select".

    //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

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.

25 Nov 2020, 3:58 PM
#273
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: ZCA Bootstrap 4 Template [Support Thread]

badarac:

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

[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 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. 
> 
> The way I got around it was by modifying ZCA_split_page_results to test if the query contained "(select". 
> ```php
    //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

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.

A quick modification to this. I discovered that if you had an order history with multiple orders it would break. My updated fix is ```php
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));
}

25 Nov 2020, 6:19 PM
#274
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: ZCA Bootstrap 4 Template [Support Thread]

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

25 Nov 2020, 7:13 PM
#275
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: ZCA Bootstrap 4 Template [Support Thread]

lat9:

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

Thanks, I'll check it out. I did have a look at the file I updated and it is unchanged in the section that caused the error. I'm going to do a test install with demo data and see if it has the error with all the other changes. Stand by ;-)

25 Nov 2020, 8:13 PM
#276
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: ZCA Bootstrap 4 Template [Support Thread]

badarac:

Thanks, I'll check it out. I did have a look at the file I updated and it is unchanged in the section that caused the error. I'm going to do a test install with demo data and see if it has the error with all the other changes. Stand by ;-)

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.

26 Nov 2020, 12:57 PM
#277
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: ZCA Bootstrap 4 Template [Support Thread]

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!

30 Nov 2020, 12:03 PM
#278
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: ZCA Bootstrap 4 Template [Support Thread]

lat9:

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!
Now available for download.

6 Dec 2020, 10:58 PM
#279
dave224 avatar

dave224

Zen Follower

Join Date:
Jun 2012
Posts:
481
Plugin Contributions:
0

Re: ZCA Bootstrap 4 Template [Support Thread]

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:```
#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%
}


TIA<
Dave
7 Dec 2020, 8:50 AM
#280
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: ZCA Bootstrap 4 Template [Support Thread]

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.