Results 1 to 10 of 1685

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    934
    Plugin Contributions
    9

    Default Re: ZCA Bootstrap 4 Template [Support Thread]

    Quote Originally Posted by lat9 View Post
    In what non-standard Zen Cart file is $currency set to that array? That's what the shipping_estimator is complaining about.
    Aha! That did it. "Currencies/Languages in Header" causes a conflict as its foreach loop also uses $currency. I changed it to $currency_item and all worked out. (I changed it from a for loop to foreach instead... and picked a bad temp name it seems.)
    Last edited by retched; 13 Feb 2025 at 06:29 AM.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,949
    Plugin Contributions
    96

    Default Re: ZCA Bootstrap 4 Template [Support Thread]

    Quote Originally Posted by retched View Post
    Aha! That did it. "Currencies/Languages in Header" causes a conflict as its foreach loop also uses $currency. I changed it to $currency_item and all worked out. (I changed it from a for loop to foreach instead... and picked a bad temp name it seems.)
    Thanks for the follow-up identifying the source of the issue!

  3. #3
    Join Date
    Jun 2012
    Posts
    481
    Plugin Contributions
    0

    Default Re: ZCA Bootstrap 4 Template [Support Thread]

    I'm trying to add a help button inside the OPC shipping card with the bootstrap template for one particular shipping method. The button I want to use is the blue square with the question mark inside it. I've got the button displayed but noting happens when I click it. The code is modeled after similar code for the button on the admin side and for the help link in the shopping cart page. What have I missed?

    Code fragments follow:
    From includes/templates/bootstrap/templates/tpl_modules_checkout_one_shipping.php starting at line 16
    Code:
    ?>
            <fieldset>
              <legend><?php echo $quotes[$i]['module']; ?>&nbsp;<?php echo (!empty($quotes[$i]['icon'])) ? $quotes[$i]['icon'] : '';
                    // bof edit to add help modal icon for international shipping
                    if ($shipping_module_id === 'flatquote') {
                        echo '<div class="pull-right noprint"><a class="btn btn-sm btn-default btn-help" data-toggle="modal" href="#flatquoteHelpModal" title="Help" role="button" rel="noopener"><i class="fa fa-question fa-lg aria-hidden="true"></i></a></div>';
                    }
                    // eof edit to add help modal icon for international shipping
    ?>
              </legend>
    New file: includes/templates/bootstrap/modalboxes/tpl_flatquote_help.php
    Code:
    <?php
    /**
     * Modal for international shipping flatquote help
     *
     * BOOTSTRAP v3.4.0
     *
     * @package templateSystem
     * @copyright Copyright 2003-2016 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     */
    zca_load_language_for_modal('flatquote_help');
    ?>
    <!-- Modal -->
    <div class="modal fade" id="flatquoteHelpModal" tabindex="-1" role="dialog" aria-labelledby="flatquoteHelpModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="flatquoteHelpModalLabel"><?php echo HEADING_TITLE_FLATQUOTE_MODAL; ?></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo TEXT_MODAL_CLOSE; ?>"><span aria-hidden="true">&times;</span></button>
                </div>
                <div class="modal-body">
                    <h2><?php echo SUB_HEADING_TITLE_1; ?></h2>
                    <p><?php echo SUB_HEADING_TEXT_1; ?></p>
                    <h2><?php echo SUB_HEADING_TITLE_2; ?></h2>
                    <p><?php echo SUB_HEADING_TEXT_2; ?></p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo TEXT_MODAL_CLOSE; ?></button>
                </div>
            </div>
        </div>
    </div>
    There's also a new file in includes/languages/english/lang.flatquote_help.php containing defines for the above file.

    For unknown reason(s) the new file for the modal is never called based on trigger_error statements placed inside the file for debugging. So I suspect a problem with the new code I placed in tpl_modules_checkout_one_shipping.php but I'm stumped.

    An image of the shipping card follows as it stands now. Further changes to the card are anticipated as I am trying to refactor the very old "Shipping by Quote" plugin.

    Click image for larger version. 

Name:	Screenshot 2025-02-13 at 12.45.05 PM.jpg 
Views:	85 
Size:	32.7 KB 
ID:	20906

    Thank you for any help!

    Dave
    zc1.5.8a, ZCA-Bootstrap-Template-3.7.5, one_page_checkout-2.5.4

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,949
    Plugin Contributions
    96

    Default Re: ZCA Bootstrap 4 Template [Support Thread]

    Why not just include that button and the associated modal popup as part of the shipping module's quote method?

  5. #5
    Join Date
    Jun 2012
    Posts
    481
    Plugin Contributions
    0

    Default Re: ZCA Bootstrap 4 Template [Support Thread]

    Thanks lat9. I was planning to use $quotes['html_input'] for the actual Request Quote button (but haven't started work on it yet), and initially considered $quotes['icon'] for the help button, but opted not to. But I'll try it.

    By the way, I found an error in the <i>...</i> expression and fixed it, but the modal still doesn't come up.

    Dave

  6. #6
    Join Date
    Jun 2012
    Posts
    481
    Plugin Contributions
    0

    Default Re: ZCA Bootstrap 4 Template [Support Thread]

    Cindy, I discovered I forgot to include the require statement for the modal template file, causing no response when clicking the help button. I have moved the help button html to the shipping module $this->quote[‘icon’] variable and it works as before, but I can’t figure out how to get the php require statement included in the shipping module. Right now it’s in the OPC shipping template file. And the modal is now coming up when the help button is clicked.
    Dave

 

 

Similar Threads

  1. v155 Clone a Template [Support Thread]
    By lat9 in forum Addon Admin Tools
    Replies: 107
    Last Post: 11 Nov 2024, 08:28 PM
  2. v150 aBagon Template Support Thread
    By VJef in forum Addon Templates
    Replies: 54
    Last Post: 5 Sep 2020, 08:44 PM
  3. v155 ZCA Bootstrap Template 1.0 (BETA)
    By rbarbour in forum Addon Templates
    Replies: 74
    Last Post: 25 Apr 2018, 07:05 PM
  4. TB Sempre Template Support Thread
    By brandonturpin in forum Addon Templates
    Replies: 48
    Last Post: 19 Mar 2015, 06:33 PM
  5. Wallet Template - Support Thread
    By zami in forum Addon Templates
    Replies: 45
    Last Post: 25 Mar 2010, 10:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg