> Yes it does.
Then the issue maybe fixed by upgrading.
Printable View
> Yes it does.
Then the issue maybe fixed by upgrading.
?
Upgrading to version 2.0.x?
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>:
Then insert on line 118, just before </table> the next line:Code:<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>
Save the file and open the file includes\languages\english\lang.meta_tags.php (or your language file) and add:Code:<div class"noPrint"><button onclick="window.print();" class="noPrint"><?php echo TEXT_INVOICE_PRINT_BUTTON; ?></button></div>
There is now a button in the invoice that allows you to print the invoice directly.Code:'TEXT_INVOICE_PRINT_BUTTON' => 'Print invoice',
Dirk
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.
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):
Code:<?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>
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.:)
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.