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

Catalog Invoice Support Thread

Views: 18,566

Results 41 to 60 of 77
5 Feb 2023, 3:29 PM
#41
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Catalog Invoice Support Thread

Thanks for this Scott. Been testing for you and here is my feedback.

If I want to turn off images should I hard code the setting in \invoice.php? The new override settings that work with admin\invoice.php won't be pulled through.

The latest version works in PHP 7.4 but fails in PHP 8.0

[05-Feb-2023 14:11:26 Europe/London] PHP Fatal error: Uncaught Error: Undefined constant "TABLE_HEADING_PRICE_EXCLUDING_TAX" in /invoice.php:214
Stack trace:
#0 {main}
thrown in /invoice.php on line 214

[05-Feb-2023 14:11:26 Europe/London] Request URI: /store158/invoice.php?oID=31848, IP address: 77.108.141.0
--> PHP Fatal error: Uncaught Error: Undefined constant "TABLE_HEADING_PRICE_EXCLUDING_TAX" in /invoice.php:214
Stack trace:
#0 {main}
thrown in /invoice.php on line 214.

I fixed this by adding entries to my \includes\languages\english\lang.invoice.php file but don't know if this is the best way or if the error was caused by some other issue I have.

    'TABLE_HEADING_PRICE_EXCLUDING_TAX' => 'Price (excl)',
    'TABLE_HEADING_PRICE_INCLUDING_TAX' => 'Price (incl)',
    'TABLE_HEADING_TOTAL_EXCLUDING_TAX' => 'Total (excl)',
    'TABLE_HEADING_TOTAL_INCLUDING_TAX' => 'Total (incl)',	

You also have two old files in your latest update. I have ported the changes across my end but so this is just for other users.
Firstly

\includes\templates\custom\templates\tpl_account_default.php
This is using > @version $Id: Scott C Wilson 2019 Jan 14 Modified in v1.5.6b $ and the latest version is > @version $Id: lat9 2022 May 26 Modified in v1.5.8-alpha $

Secondly

\includes\templates\custom\templates\tpl_account_history_default.php
Is based on > @version $Id: Author: DrByte Sat Jan 9 13:13:41 2016 -0500 Modified in v1.5.5 $ but the latest version is > @version $Id: lat9 2022 Jul 23 Modified in v1.5.8-alpha2 $

5 Feb 2023, 5:05 PM
#42
swguy avatar

swguy

Administrator

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

Re: Catalog Invoice Support Thread

Language file changes are correct - I'll add on the next update.

The template changes are really just an example - you have to merge the changes into your own template files.

5 Feb 2023, 5:56 PM
#43
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

Re: Catalog Invoice Support Thread

swguy:

The template changes are really just an example - you have to merge the changes into your own template files.

I understand that. It was more a notification for other users as they will see 1.5.8 ready and make assumptions. I got caught out by this when I started on this journey. Hard for someone who reads and writes code to understand :smile:

For anyone trying to remove images changing line 44 in /invoice.php did the trick for me.

$show_product_images = $show_product_images ?? false;
14 Apr 2023, 11:54 AM
#44
swguy avatar

swguy

Administrator

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

Re: Catalog Invoice Support Thread

css was referencing files that weren't included; this has been fixed in the latest update.

4 Nov 2024, 4:44 PM
#45
dirks avatar

dirks

New Zenner

Join Date:
Sep 2024
Location:
Noord Holland
Posts:
24
Plugin Contributions:
4

Re: Catalog Invoice Support Thread

When I click on the invoice button and the customer has purchased 1 item, the invoice is mixed up. If multiple items have been purchased, everything will work fine.
How is this possible, bug?

Using zen cart version 1.5.8a

Dirk

4 Nov 2024, 5:28 PM
#46
swguy avatar

swguy

Administrator

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

Re: Catalog Invoice Support Thread

Can you be more specific about what you mean when you say everything is mixed up? Screenshot perhaps?

4 Nov 2024, 6:32 PM
#47
dirks avatar

dirks

New Zenner

Join Date:
Sep 2024
Location:
Noord Holland
Posts:
24
Plugin Contributions:
4

Re: Catalog Invoice Support Thread

Attachment 20793Attachment 20794
First is one item ordered and second one is two items.

As you can see the layout is different (not everything is mixed up).

4 Nov 2024, 7:07 PM
#48
swguy avatar

swguy

Administrator

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

Re: Catalog Invoice Support Thread

This seems to be related to the order, not the number of items. No idea; does the regular admin orders page have the same layout?

4 Nov 2024, 7:34 PM
#49
dirks avatar

dirks

New Zenner

Join Date:
Sep 2024
Location:
Noord Holland
Posts:
24
Plugin Contributions:
4

Re: Catalog Invoice Support Thread

swguy:

This seems to be related to the order, not the number of items. No idea; does the regular admin orders page have the same layout?

Yes it does.

4 Nov 2024, 7:50 PM
#50
dirks avatar

dirks

New Zenner

Join Date:
Sep 2024
Location:
Noord Holland
Posts:
24
Plugin Contributions:
4

Re: Catalog Invoice Support Thread

I'm not a programmer or anything so I don't know how to solve this. Any help is welcome. I have already restored a backup of invoice.php to the admin folder with no results.

4 Nov 2024, 8:02 PM
#51
swguy avatar

swguy

Administrator

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

Re: Catalog Invoice Support Thread

Yes it does.

Then the issue maybe fixed by upgrading.

4 Nov 2024, 9:31 PM
#52
dirks avatar

dirks

New Zenner

Join Date:
Sep 2024
Location:
Noord Holland
Posts:
24
Plugin Contributions:
4

Re: Catalog Invoice Support Thread

?
Upgrading to version 2.0.x?

6 Jan 2025, 2:17 PM
#53
dirks avatar

dirks

New Zenner

Join Date:
Sep 2024
Location:
Noord Holland
Posts:
24
Plugin Contributions:
4

Re: Catalog Invoice Support Thread

DirkS:

?
Upgrading to version 2.0.x?

Problem solved!

6 Jan 2025, 7:11 PM
#54
dirks avatar

dirks

New Zenner

Join Date:
Sep 2024
Location:
Noord Holland
Posts:
24
Plugin Contributions:
4

Re: Catalog Invoice Support Thread

Hello,

I wanted a print button to print the invoice. There were a number of conditions I wanted to meet. 1) The print button was not allowed to be printed. 2) no header and footer of the (html) page were allowed to be printed.

Below is the solution:

Place the following code in the invoice.php file (under line 89), or just before </head>:

<style type="text/css">
    @media print {
      .noPrint{
        display:none;
      }
}
     @page {
        margin-left: 0.5in;
        margin-right: 0.5in;
        margin-top: 0;
        margin-bottom: 0;
      }
</style>

Then insert on line 118, just before </table> the next line:

<div class"noPrint"><button onclick="window.print();" class="noPrint"><?php echo TEXT_INVOICE_PRINT_BUTTON; ?></button></div>

Save the file and open the file includes\languages\english\lang.meta_tags.php (or your language file) and add:

'TEXT_INVOICE_PRINT_BUTTON' => 'Print invoice',

There is now a button in the invoice that allows you to print the invoice directly.

Dirk

10 Feb 2025, 3:18 PM
#55
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

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

Re: Catalog Invoice Support Thread

HI, just tried installing this in 2.1.0. (bootstrap template) an a Ubuntu 24.04 VM PHP v8.3
I get a blank page when clicking on "My account".
No big deal, although I found this plug-in useful, I can live without it.
Not good enough a programmer to figure out why.

10 Feb 2025, 4:06 PM
#56
balihr avatar

balihr

Totally Zenned

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

Re: Catalog Invoice Support Thread

wyliecoyoteuk:

HI, just tried installing this in 2.1.0. (bootstrap template) an a Ubuntu 24.04 VM PHP v8.3
I get a blank page when clicking on "My account".
No big deal, although I found this plug-in useful, I can live without it.
Not good enough a programmer to figure out why.

Blank page can ALWAYS be resolved quite easily. Follow the tips here and help us guide you on how to resolve it - it's usually a very simple file change needed that you may have missed or skipped.

11 Feb 2025, 11:25 AM
#57
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 quick response!
This is the logfile warning. looks like there is problem in the tpl_account_default.php file could this be because I am using a VM without a domain set?

 [11-Feb-2025 10:49:17 UTC] Request URI: /wsgd.co.uk/index.php?main_page=account, IP address: 192.168.0.153, Language id 1
#0 /var/www/html/wsgd.co.uk/includes/templates/bootstrap/templates/tpl_account_default.php(16): zen_debug_error_handler()
#1 /var/www/html/wsgd.co.uk/includes/templates/bootstrap/common/tpl_main_page.php(233): require('...')
#2 /var/www/html/wsgd.co.uk/index.php(94): require('...')
--> PHP Warning: Undefined variable $detect in /var/www/html/wsgd.co.uk/includes/templates/bootstrap/templates/tpl_account_default.php on line 16.

[11-Feb-2025 10:49:17 UTC] PHP Fatal error:  Uncaught Error: Call to a member function isMobile() on null in /var/www/html/wsgd.co.uk/includes/templates/bootstrap/templates/tpl_account_default.php:16
Stack trace:
#0 /var/www/html/wsgd.co.uk/includes/templates/bootstrap/common/tpl_main_page.php(233): require()
#1 /var/www/html/wsgd.co.uk/index.php(94): require('...')
#2 {main}
  thrown in /var/www/html/wsgd.co.uk/includes/templates/bootstrap/templates/tpl_account_default.php on line 16

[11-Feb-2025 10:49:17 UTC] Request URI: /wsgd.co.uk/index.php?main_page=account, IP address: 192.168.0.153
--> PHP Fatal error: Uncaught Error: Call to a member function isMobile() on null in /var/www/html/wsgd.co.uk/includes/templates/bootstrap/templates/tpl_account_default.php:16
Stack trace:
#0 /var/www/html/wsgd.co.uk/includes/templates/bootstrap/common/tpl_main_page.php(233): require()
#1 /var/www/html/wsgd.co.uk/index.php(94): require('...')
#2 {main}
  thrown in /var/www/html/wsgd.co.uk/includes/templates/bootstrap/templates/tpl_account_default.php on line 16.

[11-Feb-2025 10:49:17 UTC] Request URI: /wsgd.co.uk/index.php?main_page=account, IP address: 192.168.0.153
--> PHP Fatal error: Uncaught Error: Call to a member function isMobile() on null in /var/www/html/wsgd.co.uk/includes/templates/bootstrap/templates/tpl_account_default.php:16
Stack trace:
#0 /var/www/html/wsgd.co.uk/includes/templates/bootstrap/common/tpl_main_page.php(233): require()
#1 /var/www/html/wsgd.co.uk/index.php(94): require('...')
#2 {main}
  thrown in /var/www/html/wsgd.co.uk/includes/templates/bootstrap/templates/tpl_account_default.php on line 16.
11 Feb 2025, 11:31 AM
#58
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

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

Re: Catalog Invoice Support Thread

Removing line 16 in tpl_account_default.php fixes it, but of course that stops it being responsive.

11 Feb 2025, 12:12 PM
#59
balihr avatar

balihr

Totally Zenned

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

Re: Catalog Invoice Support Thread

wyliecoyoteuk:

Removing line 16 in tpl_account_default.php fixes it, but of course that stops it being responsive.

This actually makes perfect sense... You should NEVER simply overwrite the existing files, but should instead merge your files with the ones that are provided by any plugin. You can use WinMerge or BeyondCompare or any other software to highlight the differences if you can't spot them manually.

If you're using the Bootstrap template, line 16 is a closing php tag. My guess is you just added the file that comes with the plugin (which is based on responsive_classic template) and that file killed the page because it's just not compatible with the Bootstrap template.

I haven't tested it, but I believe your file (includes/templates/bootstrap/templates/tpl_account_default.php) should look something like this (new code highlighted in red):

<?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>
11 Feb 2025, 12:47 PM
#60
wyliecoyoteuk avatar

wyliecoyoteuk

New Zenner

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

Re: Catalog Invoice Support Thread

Thanks again..
I didn't realise that the file would be overwritten, should have read the doc more carefully.
I used meld to compare files when upgrading from 1.5.7c after removing any add-ons, but then I decided to do a fresh installation of 2.1.0 in a VM and apply bootstrap before importing data, images and text to the pages I had changed, then apply add-ons one at a time, taking snapshots before each, to see if there were any problems.
I had not actually made many changes, and the only add-ons I wanted to add were invoice payment and catalog invoice. (I had installed edit orders and zx-slideshow but I deemed them no longer needed). These days I tend to avoid coding, as my ageing brain struggles with it.:)