Zen Cart Logo
Forums / All Other Contributions/Addons / Catalog Invoice Support Thread

Catalog Invoice Support Thread

Views: 18,566

Results 61 to 77 of 77
11 Feb 2025, 2:05 PM
#61
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Catalog Invoice Support Thread

That change seems to work fine, should I make changes to the tpl_account_history_default.php file as well?
Comparing them in meld they look very different, although the overwritten one seems to work OK.

11 Feb 2025, 3:02 PM
#62
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,792
Plugin Contributions:
22

Re: Catalog Invoice Support Thread

Yes, you should definitely restore the file from the Bootstrap template and add the one line of code for the invoice plugin, just make sure you place it in an appropriate location.

11 Feb 2025, 3:36 PM
#63
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

Thank you so much for your help.
I have added this at line 30, it seems to be working fine.

<!-- Invoice -->
<div class="content forward"><?php echo '<a href="' . FILENAME_INVOICE . '.php?oID=' . $history['orders_id'] . '">' . zen_image_button(BUTTON_IMAGE_INVOICE_SMALL, BUTTON_INVOICE_SMALL_ALT) . '</a>'; ?></div>

A few more minor tweaks to the site and it will be ready to go live.

11 Feb 2025, 3:44 PM
#64
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

oops. line 54

22 Feb 2025, 11:26 AM
#65
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

Set up my new site, but the invoices generated have no products or prices information between the header and the customer details.
Ubuntu server 24.04.2, php8.3, zencart 2.1.0.
Log file shows:
log [22-Feb-2025 11:22:42 UTC] Request URI: /invoice.php?oID=273, IP address: 192.168.0.254, Language id 1
#0 /var/www/html/xxxx.co.uk/invoice.php(72): zen_debug_error_handler()
--> PHP Warning: Trying to access array offset on false in /var/www/html/xxxx/invoice.php on line 72.

22 Feb 2025, 11:39 AM
#66
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

Plus: (xxxx replacing domain id)
[22-Feb-2025 11:11:10 UTC] PHP Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, false given in /var/www/html/xxxx.co.uk/includes/functions/functions_addresses.php:309
Stack trace:
#0 /var/www/html/xxxx.co.uk/includes/functions/functions_addresses.php(309): array_merge()
#1 /var/www/html/xxxx.co.uk/invoice.php(151): zen_address_format()
#2 {main}
thrown in /var/www/html/xxxx.co.uk/includes/functions/functions_addresses.php on line 309

Should I wait until this is updated to 2.1?

22 Feb 2025, 11:46 AM
#67
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,695
Plugin Contributions:
56

Re: Catalog Invoice Support Thread

I reckon so.

22 Feb 2025, 1:42 PM
#68
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

Thanks for the reply.
Sorry that I don't know enough to help.

24 Feb 2025, 11:27 AM
#69
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,695
Plugin Contributions:
56

Re: Catalog Invoice Support Thread

Just tested on Zen Cart 2.1.0; looks fine to me. Not sure what the issue on your site is.

24 Feb 2025, 11:30 AM
#70
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

Thanks for letting me know.
Not sure either, it generates an invoice, but only the header and footer show, the products are not listed.
I will try it again on my test VM.
I am using the bootstrap template, only other add-on is your invoice payment one.

24 Feb 2025, 2:58 PM
#71
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

It seems to be a problem with this statement in invoice.php:

$show_customer = false;
if ($order->billing['name'] != $order->delivery['name']) {
  $show_customer = true;
}

I assume that is comparing billing and shipping addresses
logs show multiple errors in includes/functions/functions_addresses.php
I have store pickup enabled, could that be causing the problem?

24 Feb 2025, 4:45 PM
#72
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,695
Plugin Contributions:
56

Re: Catalog Invoice Support Thread

Could be - I will try that.

24 Feb 2025, 5:09 PM
#73
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,695
Plugin Contributions:
56

Re: Catalog Invoice Support Thread

Fixed. Thanks for providing these details.

24 Feb 2025, 6:21 PM
#74
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

Thank you! now working fine.
I try to keep things simple as my daughter's business is a very small one person enterprise, based in Cornwall and supplying small independent shops in the county.
Zencart makes things a lot easier for her.
I am retired, and at 72, things don't come quite as easily as they used to. Glad I could contribute.

24 Feb 2025, 6:30 PM
#75
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

Actually I inserted that line at line 60.

24 Feb 2025, 6:32 PM
#76
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

wyliecoyoteuk:

Thank you so much for your help.
I have added this at line 30, it seems to be working fine.

<!-- Invoice -->
<div class="content forward"><?php echo '<a href="' . FILENAME_INVOICE . '.php?oID=' . $history['orders_id'] . '">' . zen_image_button(BUTTON_IMAGE_INVOICE_SMALL, BUTTON_INVOICE_SMALL_ALT) . '</a>'; ?></div>

A few more minor tweaks to the site and it will be ready to go live. should be line 60.

25 Feb 2025, 10:43 AM
#77
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

Join Date:
Feb 2019
Location:
Birmingham UK
Posts:
32
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

Summary for anyone else wanting to use this plug-in with 2.1.0 and bootstrap:
(the blank invoice was down to my own misunderstanding, but the new version doesn't throw errors)

edit for includes/templates/bootstrap/templates/tpl_account_default.php

<?php
/**
 * Page Template
 * 
 * BOOTSTRAP v3.7.1
 *
 * Loaded automatically by index.php?main_page=account.<br />
 * Displays previous orders and options to change various Customer Account settings
 *
 * @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
 * @version $Id: Author: DrByte  Fri Jan 8 00:33:36 2016 -0500 Modified in v1.5.5 $
 */
?>
<div id="accountDefault" class="centerColumn">
    <h1 id="accountDefault-pageHeading" class="pageHeading"><?= HEADING_TITLE ?></h1>
<?php
if ($messageStack->size('account') > 0) {
    echo $messageStack->output('account');
}
?>
    <div class="card-deck mb-3">
<!--bof my account card links-->
        <div id="myAccount-card" class="card">
            <h4 id="myAccount-card-header" class="card-header"><?= MY_ACCOUNT_TITLE ?></h4>
            <div id="myAccount-card-body" class="card-body p-3">
                <ul id="myAccount-list-group" class="list-group list-group-flush">
                    <li class="list-group-item">
                        <?= zca_button_link(zen_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), MY_ACCOUNT_INFORMATION) ?>
                    </li>
                    <li class="list-group-item">
                       <?= zca_button_link(zen_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'), MY_ACCOUNT_ADDRESS_BOOK) ?>
                    </li>
                    <li class="list-group-item">
                        <?= zca_button_link(zen_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL'), MY_ACCOUNT_PASSWORD) ?>
                    </li>
                </ul>
            </div>
        </div>
<!--eof my account card links-->
<?php
if ((int)ACCOUNT_NEWSLETTER_STATUS > 0 || CUSTOMERS_PRODUCTS_NOTIFICATION_STATUS !== '0') {
?>
<!--bof email notifications card links-->
        <div id="emailNotifications-card" class="card">
            <h4 id="emailNotifications-card-header" class="card-header"><?= EMAIL_NOTIFICATIONS_TITLE ?></h4>
            <div id="emailNotifications-card-body" class="card-body p-3">
                <ul id="emailNotifications-list-group" class="list-group list-group-flush">
<?php
    if ((int)ACCOUNT_NEWSLETTER_STATUS > 0) {
?>
                    <li class="list-group-item">
                        <?= zca_button_link(zen_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL'), EMAIL_NOTIFICATIONS_NEWSLETTERS) ?>
                    </li>
<?php 
    } //endif newsletter unsubscribe

    if (CUSTOMERS_PRODUCTS_NOTIFICATION_STATUS === '1') {
?>
                    <li class="list-group-item">
                        <?= zca_button_link(zen_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'), EMAIL_NOTIFICATIONS_PRODUCTS) ?>
                    </li>
<?php 
    } //endif product notification
?>
                </ul>
            </div>
        </div>
<!--bof email notifications card links-->
<?php 
} // endif don't show unsubscribe or notification
?>
    </div>
<?php
// only show when there is a GV balance
if ($customer_has_gv_balance) {
    require $template->get_template_dir('tpl_modules_send_or_spend.php', DIR_WS_TEMPLATE, $current_page_base, 'templates') . '/tpl_modules_send_or_spend.php';
}

if (count($ordersArray) !== 0) {
?>
<!--bof previous orders card -->
    <div id="previousOrders-card" class="card mb-3">
        <h4 id="previousOrders-card-header" class="card-header"><?= OVERVIEW_PREVIOUS_ORDERS ?></h4>
        <div id="previousOrders-card-body" class="card-body p-3">
            <div id="previousOrders-helpLink" class="helpLink text-right p-3">
                <a href="<?= zen_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') ?>"><?= OVERVIEW_SHOW_ALL_ORDERS ?></a>
            </div>
            <div class="card-deck">
<?php
    foreach ($ordersArray as $orders) {
        $order_link = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL');
?>
                <div class="card">
                    <div class="card-header text-center">
                        <a class="orderIdCell" href="<?= $order_link ?>"><?= TEXT_NUMBER_SYMBOL . $orders['orders_id'] ?></a>
                    </div>
                    <div class="card-body text-center">
                        <ul class="list-group list-group-flush">
                            <li class="list-group-item dateCell border-0 p-1"><?= zen_date_short($orders['date_purchased']) ?></li>
                            <li class="list-group-item shipToCell border-0 p-1"><?= zen_output_string_protected($orders['order_name']) . '<br>' . $orders['order_country'] ?></li>
                            <li class="list-group-item statusCell border-0 p-1"><?= $orders['orders_status_name'] ?></li>
                            <li class="list-group-item border-0 p-1"><?= $orders['order_total'] ?></li>
                        </ul>
                    </div>
                    <div class="card-footer text-center">
                        <?= zca_button_link($order_link, BUTTON_VIEW_SMALL_ALT, 'button_view') ?>
                       <br>
                        <?= '<a href="' . FILENAME_INVOICE . '.php?oID=' . $orders['orders_id'] . '" target="_blank">' . zen_image_button(BUTTON_IMAGE_INVOICE_SMALL, BUTTON_INVOICE_SMALL_ALT) . '</a>' . '  '; ?>
                    </div>
                </div>
<?php
    }
?>
            </div>
        </div>
    </div>
<!--eof previous orders card -->
<?php
}
?>
</div>

Edit for includes/templates/bootstrap/templates/tpl_account_history_default.php

<?php
/**
 * Page Template
 *
 * BOOTSTRAP v3.5.0
 *
 * Loaded automatically by index.php?main_page=account_history.<br />
 * Displays all customers previous orders
 *
 * @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
 * @version $Id: Author: DrByte  Sat Jan 9 13:13:41 2016 -0500 Modified in v1.5.5 $
 */
?>
<div id="accountHistoryDefault" class="centerColumn">
    <h1 id="accountHistoryDefault-pageHeading" class="pageHeading"><?php echo HEADING_TITLE; ?></h1>
<?php
if ($accountHasHistory === true) {
    $page_parameter = (isset($_GET['page'])) ? ('page=' . (int)$_GET['page'] . '&') : '';
    foreach ($accountHistory as $history) {
?>
<!--bof order history card-->
    <div id="order<?php echo $history['orders_id']; ?>-card" class="card mb-3">
        <h4 id="order<?php echo $history['orders_id']; ?>-card-header" class="card-header"><?php echo TEXT_ORDER_NUMBER . $history['orders_id']; ?></h4>
        <div id="order<?php echo $history['orders_id']; ?>-card-body" class="card-body p-3">
            <div class="row">
                <div class="col-sm text-right">
                    <?php echo TEXT_ORDER_STATUS . $history['orders_status_name']; ?>    
                </div>
            </div>

            <div class="row">
                <div class="col-sm">
                    <?php echo '<strong>' . TEXT_ORDER_DATE . '</strong> ' . zen_date_long($history['date_purchased']); ?>
                </div>
                <div class="col-sm">
                    <?php echo '<strong>' . TEXT_ORDER_PRODUCTS . '</strong> ' . $history['product_count']; ?>
                </div>
            </div>

            <div class="row">
                <div class="col-sm">
                    <?php echo '<strong>' . $history['order_type'] . '</strong> ' . zen_output_string_protected($history['order_name']); ?> 
                </div>
                <div class="col-sm">
                    <?php echo '<strong>' . TEXT_ORDER_COST . '</strong> ' . strip_tags($history['order_total']); ?> 
                </div>
            </div>

            <div id="order<?php echo $history['orders_id']; ?>-btn-toolbar" class="btn-toolbar justify-content-end my-3" role="toolbar">
                <?php echo zca_button_link(zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, $page_parameter . 'order_id=' . $history['orders_id'], 'SSL'), BUTTON_VIEW_SMALL_ALT, 'button_view'); ?>
				
</div>
           
        </div>
    </div>
<!--eof order history card-->
<!-- Invoice --> 
           <div class="content forward"><?php echo '<a href="' . FILENAME_INVOICE . '.php?oID=' . $history['orders_id'] . '">' . zen_image_button(BUTTON_IMAGE_INVOICE_SMALL, BUTTON_INVOICE_SMALL_ALT) . '</a>'; ?></div>
<?php
    }
?>
    <div id="accountHistoryDefault-bottomRow" class="row">
        <div id="accountHistoryDefault-bottomNumber" class="bottomNumber col-sm">
            <?php echo $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?>
        </div>
        <div id="accountHistoryDefault-bottomLinks" class="bottomLinks col-sm">
            <?php echo TEXT_RESULT_PAGE . $history_split->display_links($max_display_page_links, zen_get_all_get_params(['page', 'info', 'x', 'y', 'main_page']), $paginateAsUL); ?>
        </div>
    </div>
<?php
} else {
?>
    <div id="noAccountHistoryDefault" class="centerColumn">
        <div id="noAccountHistoryDefault-content" class="content">
            <?php echo TEXT_NO_PURCHASES; ?>
        </div>
    </div>
<?php
}
?>
    <div id="accountHistoryDefault-btn-toolbar" class="btn-toolbar my-3" role="toolbar">
        <?php echo zca_button_link(zen_href_link(FILENAME_ACCOUNT, '', 'SSL'), BUTTON_BACK_ALT, 'button_back'); ?>
    </div>
</div>