first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><?php echo esc_html( $this->get_title() ); ?></title>
<style type="text/css"><?php $this->template_styles(); ?></style>
<style type="text/css"><?php do_action( 'wpo_wcpdf_custom_styles', $this->get_type(), $this ); ?></style>
</head>
<body class="<?php echo apply_filters( 'wpo_wcpdf_body_class', $this->get_type(), $this ); ?>">
<?php echo $content; ?>
</body>
</html>

View File

@@ -0,0 +1,175 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
<?php do_action( 'wpo_wcpdf_before_document', $this->get_type(), $this->order ); ?>
<table class="head container">
<tr>
<td class="header">
<?php
if ( $this->has_header_logo() ) {
do_action( 'wpo_wcpdf_before_shop_logo', $this->get_type(), $this->order );
$this->header_logo();
do_action( 'wpo_wcpdf_after_shop_logo', $this->get_type(), $this->order );
} else {
$this->title();
}
?>
</td>
<td class="shop-info">
<?php do_action( 'wpo_wcpdf_before_shop_name', $this->get_type(), $this->order ); ?>
<div class="shop-name"><h3><?php $this->shop_name(); ?></h3></div>
<?php do_action( 'wpo_wcpdf_after_shop_name', $this->get_type(), $this->order ); ?>
<?php do_action( 'wpo_wcpdf_before_shop_address', $this->get_type(), $this->order ); ?>
<div class="shop-address"><?php $this->shop_address(); ?></div>
<?php do_action( 'wpo_wcpdf_after_shop_address', $this->get_type(), $this->order ); ?>
</td>
</tr>
</table>
<?php do_action( 'wpo_wcpdf_before_document_label', $this->get_type(), $this->order ); ?>
<h1 class="document-type-label">
<?php if ( $this->has_header_logo() ) $this->title(); ?>
</h1>
<?php do_action( 'wpo_wcpdf_after_document_label', $this->get_type(), $this->order ); ?>
<table class="order-data-addresses">
<tr>
<td class="address billing-address">
<!-- <h3><?php _e( 'Billing Address:', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3> -->
<?php do_action( 'wpo_wcpdf_before_billing_address', $this->get_type(), $this->order ); ?>
<?php $this->billing_address(); ?>
<?php do_action( 'wpo_wcpdf_after_billing_address', $this->get_type(), $this->order ); ?>
<?php if ( isset( $this->settings['display_email'] ) ) : ?>
<div class="billing-email"><?php $this->billing_email(); ?></div>
<?php endif; ?>
<?php if ( isset( $this->settings['display_phone'] ) ) : ?>
<div class="billing-phone"><?php $this->billing_phone(); ?></div>
<?php endif; ?>
</td>
<td class="address shipping-address">
<?php if ( $this->show_shipping_address() ) : ?>
<h3><?php _e( 'Ship To:', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
<?php do_action( 'wpo_wcpdf_before_shipping_address', $this->get_type(), $this->order ); ?>
<?php $this->shipping_address(); ?>
<?php do_action( 'wpo_wcpdf_after_shipping_address', $this->get_type(), $this->order ); ?>
<?php if ( isset( $this->settings['display_phone'] ) ) : ?>
<div class="shipping-phone"><?php $this->shipping_phone(); ?></div>
<?php endif; ?>
<?php endif; ?>
</td>
<td class="order-data">
<table>
<?php do_action( 'wpo_wcpdf_before_order_data', $this->get_type(), $this->order ); ?>
<?php if ( isset( $this->settings['display_number'] ) ) : ?>
<tr class="invoice-number">
<th><?php echo $this->get_number_title(); ?></th>
<td><?php $this->invoice_number(); ?></td>
</tr>
<?php endif; ?>
<?php if ( isset( $this->settings['display_date'] ) ) : ?>
<tr class="invoice-date">
<th><?php echo $this->get_date_title(); ?></th>
<td><?php $this->invoice_date(); ?></td>
</tr>
<?php endif; ?>
<tr class="order-number">
<th><?php _e( 'Order Number:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<td><?php $this->order_number(); ?></td>
</tr>
<tr class="order-date">
<th><?php _e( 'Order Date:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<td><?php $this->order_date(); ?></td>
</tr>
<?php if ( $payment_method = $this->get_payment_method() ) : ?>
<tr class="payment-method">
<th><?php _e( 'Payment Method:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<td><?php echo $payment_method; ?></td>
</tr>
<?php endif; ?>
<?php do_action( 'wpo_wcpdf_after_order_data', $this->get_type(), $this->order ); ?>
</table>
</td>
</tr>
</table>
<?php do_action( 'wpo_wcpdf_before_order_details', $this->get_type(), $this->order ); ?>
<table class="order-details">
<thead>
<tr>
<th class="product"><?php _e( 'Product', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<th class="quantity"><?php _e( 'Quantity', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<th class="price"><?php _e( 'Price', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ( $this->get_order_items() as $item_id => $item ) : ?>
<tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', 'item-'.$item_id, esc_attr( $this->get_type() ), $this->order, $item_id ); ?>">
<td class="product">
<?php $description_label = __( 'Description', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
<span class="item-name"><?php echo $item['name']; ?></span>
<?php do_action( 'wpo_wcpdf_before_item_meta', $this->get_type(), $item, $this->order ); ?>
<span class="item-meta"><?php echo $item['meta']; ?></span>
<dl class="meta">
<?php $description_label = __( 'SKU', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
<?php if ( ! empty( $item['sku'] ) ) : ?><dt class="sku"><?php _e( 'SKU:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="sku"><?php echo esc_attr( $item['sku'] ); ?></dd><?php endif; ?>
<?php if ( ! empty( $item['weight'] ) ) : ?><dt class="weight"><?php _e( 'Weight:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="weight"><?php echo esc_attr( $item['weight'] ); ?><?php echo esc_attr( get_option( 'woocommerce_weight_unit' ) ); ?></dd><?php endif; ?>
</dl>
<?php do_action( 'wpo_wcpdf_after_item_meta', $this->get_type(), $item, $this->order ); ?>
</td>
<td class="quantity"><?php echo $item['quantity']; ?></td>
<td class="price"><?php echo $item['order_price']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr class="no-borders">
<td class="no-borders">
<div class="document-notes">
<?php do_action( 'wpo_wcpdf_before_document_notes', $this->get_type(), $this->order ); ?>
<?php if ( $this->get_document_notes() ) : ?>
<h3><?php _e( 'Notes', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
<?php $this->document_notes(); ?>
<?php endif; ?>
<?php do_action( 'wpo_wcpdf_after_document_notes', $this->get_type(), $this->order ); ?>
</div>
<div class="customer-notes">
<?php do_action( 'wpo_wcpdf_before_customer_notes', $this->get_type(), $this->order ); ?>
<?php if ( $this->get_shipping_notes() ) : ?>
<h3><?php _e( 'Customer Notes', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
<?php $this->shipping_notes(); ?>
<?php endif; ?>
<?php do_action( 'wpo_wcpdf_after_customer_notes', $this->get_type(), $this->order ); ?>
</div>
</td>
<td class="no-borders" colspan="2">
<table class="totals">
<tfoot>
<?php foreach ( $this->get_woocommerce_totals() as $key => $total ) : ?>
<tr class="<?php echo esc_attr( $key ); ?>">
<th class="description"><?php echo $total['label']; ?></th>
<td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td>
</tr>
<?php endforeach; ?>
</tfoot>
</table>
</td>
</tr>
</tfoot>
</table>
<div class="bottom-spacer"></div>
<?php do_action( 'wpo_wcpdf_after_order_details', $this->get_type(), $this->order ); ?>
<?php if ( $this->get_footer() ) : ?>
<div id="footer">
<!-- hook available: wpo_wcpdf_before_footer -->
<?php $this->footer(); ?>
<!-- hook available: wpo_wcpdf_after_footer -->
</div><!-- #letter-footer -->
<?php endif; ?>
<?php do_action( 'wpo_wcpdf_after_document', $this->get_type(), $this->order ); ?>

View File

@@ -0,0 +1,138 @@
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
<?php do_action( 'wpo_wcpdf_before_document', $this->get_type(), $this->order ); ?>
<table class="head container">
<tr>
<td class="header">
<?php
if ( $this->has_header_logo() ) {
do_action( 'wpo_wcpdf_before_shop_logo', $this->get_type(), $this->order );
$this->header_logo();
do_action( 'wpo_wcpdf_after_shop_logo', $this->get_type(), $this->order );
} else {
$this->title();
}
?>
</td>
<td class="shop-info">
<?php do_action( 'wpo_wcpdf_before_shop_name', $this->get_type(), $this->order ); ?>
<div class="shop-name"><h3><?php $this->shop_name(); ?></h3></div>
<?php do_action( 'wpo_wcpdf_after_shop_name', $this->get_type(), $this->order ); ?>
<?php do_action( 'wpo_wcpdf_before_shop_address', $this->get_type(), $this->order ); ?>
<div class="shop-address"><?php $this->shop_address(); ?></div>
<?php do_action( 'wpo_wcpdf_after_shop_address', $this->get_type(), $this->order ); ?>
</td>
</tr>
</table>
<?php do_action( 'wpo_wcpdf_before_document_label', $this->get_type(), $this->order ); ?>
<h1 class="document-type-label">
<?php if ( $this->has_header_logo() ) $this->title(); ?>
</h1>
<?php do_action( 'wpo_wcpdf_after_document_label', $this->get_type(), $this->order ); ?>
<table class="order-data-addresses">
<tr>
<td class="address shipping-address">
<!-- <h3><?php _e( 'Shipping Address:', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3> -->
<?php do_action( 'wpo_wcpdf_before_shipping_address', $this->get_type(), $this->order ); ?>
<?php $this->shipping_address(); ?>
<?php do_action( 'wpo_wcpdf_after_shipping_address', $this->get_type(), $this->order ); ?>
<?php if ( isset( $this->settings['display_email'] ) ) : ?>
<div class="billing-email"><?php $this->billing_email(); ?></div>
<?php endif; ?>
<?php if ( isset( $this->settings['display_phone'] ) ) : ?>
<div class="shipping-phone"><?php $this->shipping_phone( ! $this->show_billing_address() ); ?></div>
<?php endif; ?>
</td>
<td class="address billing-address">
<?php if ( $this->show_billing_address() ) : ?>
<h3><?php _e( 'Billing Address:', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
<?php do_action( 'wpo_wcpdf_before_billing_address', $this->get_type(), $this->order ); ?>
<?php $this->billing_address(); ?>
<?php do_action( 'wpo_wcpdf_after_billing_address', $this->get_type(), $this->order ); ?>
<?php if ( isset( $this->settings['display_phone'] ) && ! empty( $this->get_billing_phone() ) ) : ?>
<div class="billing-phone"><?php $this->billing_phone(); ?></div>
<?php endif; ?>
<?php endif; ?>
</td>
<td class="order-data">
<table>
<?php do_action( 'wpo_wcpdf_before_order_data', $this->get_type(), $this->order ); ?>
<tr class="order-number">
<th><?php _e( 'Order Number:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<td><?php $this->order_number(); ?></td>
</tr>
<tr class="order-date">
<th><?php _e( 'Order Date:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<td><?php $this->order_date(); ?></td>
</tr>
<?php if ( $shipping_method = $this->get_shipping_method() ) : ?>
<tr class="shipping-method">
<th><?php _e( 'Shipping Method:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<td><?php echo $shipping_method; ?></td>
</tr>
<?php endif; ?>
<?php do_action( 'wpo_wcpdf_after_order_data', $this->get_type(), $this->order ); ?>
</table>
</td>
</tr>
</table>
<?php do_action( 'wpo_wcpdf_before_order_details', $this->get_type(), $this->order ); ?>
<table class="order-details">
<thead>
<tr>
<th class="product"><?php _e( 'Product', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<th class="quantity"><?php _e( 'Quantity', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ( $this->get_order_items() as $item_id => $item ) : ?>
<tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', 'item-'.$item_id, esc_attr( $this->get_type() ), $this->order, $item_id ); ?>">
<td class="product">
<?php $description_label = __( 'Description', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
<span class="item-name"><?php echo $item['name']; ?></span>
<?php do_action( 'wpo_wcpdf_before_item_meta', $this->get_type(), $item, $this->order ); ?>
<span class="item-meta"><?php echo $item['meta']; ?></span>
<dl class="meta">
<?php $description_label = __( 'SKU', 'woocommerce-pdf-invoices-packing-slips' ); // registering alternate label translation ?>
<?php if ( ! empty( $item['sku'] ) ) : ?><dt class="sku"><?php _e( 'SKU:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="sku"><?php echo esc_attr( $item['sku'] ); ?></dd><?php endif; ?>
<?php if ( ! empty( $item['weight'] ) ) : ?><dt class="weight"><?php _e( 'Weight:', 'woocommerce-pdf-invoices-packing-slips' ); ?></dt><dd class="weight"><?php echo esc_attr( $item['weight'] ); ?><?php echo esc_attr( get_option( 'woocommerce_weight_unit' ) ); ?></dd><?php endif; ?>
</dl>
<?php do_action( 'wpo_wcpdf_after_item_meta', $this->get_type(), $item, $this->order ); ?>
</td>
<td class="quantity"><?php echo $item['quantity']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="bottom-spacer"></div>
<?php do_action( 'wpo_wcpdf_after_order_details', $this->get_type(), $this->order ); ?>
<?php do_action( 'wpo_wcpdf_before_customer_notes', $this->get_type(), $this->order ); ?>
<div class="customer-notes">
<?php if ( $this->get_shipping_notes() ) : ?>
<h3><?php _e( 'Customer Notes', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
<?php $this->shipping_notes(); ?>
<?php endif; ?>
</div>
<?php do_action( 'wpo_wcpdf_after_customer_notes', $this->get_type(), $this->order ); ?>
<?php if ( $this->get_footer() ) : ?>
<div id="footer">
<!-- hook available: wpo_wcpdf_before_footer -->
<?php $this->footer(); ?>
<!-- hook available: wpo_wcpdf_after_footer -->
</div><!-- #letter-footer -->
<?php endif; ?>
<?php do_action( 'wpo_wcpdf_after_document', $this->get_type(), $this->order ); ?>

View File

@@ -0,0 +1,292 @@
/* Main Body */
@page {
margin-top: 1cm;
margin-bottom: 3cm;
margin-left: 2cm;
margin-right: 2cm;
}
body {
background: #fff;
color: #000;
margin: 0cm;
font-family: 'Open Sans', sans-serif;
/* want to use custom fonts? http://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-custom-fonts/ */
font-size: 9pt;
line-height: 100%; /* fixes inherit dompdf bug */
overflow-wrap: anywhere;
}
h1, h2, h3, h4 {
font-weight: bold;
margin: 0;
}
h1 {
font-size: 16pt;
margin: 5mm 0;
}
h2 {
font-size: 14pt;
}
h3, h4 {
font-size: 9pt;
}
ol,
ul {
list-style: none;
margin: 0;
padding: 0;
}
li,
ul {
margin-bottom: 0.75em;
}
p {
margin: 0;
padding: 0;
}
p + p {
margin-top: 1.25em;
}
a {
border-bottom: 1px solid;
text-decoration: none;
}
/* Basic Table Styling */
table {
border-collapse: collapse;
border-spacing: 0;
page-break-inside: always;
border: 0;
margin: 0;
padding: 0;
}
th, td {
vertical-align: top;
text-align: left;
}
table.container {
width:100%;
border: 0;
}
tr.no-borders,
td.no-borders {
border: 0 !important;
border-top: 0 !important;
border-bottom: 0 !important;
padding: 0 !important;
width: auto;
}
div.bottom-spacer {
clear: both;
height: 8mm;
}
/* Header */
table.head {
margin-bottom: 12mm;
}
td.header img {
max-height: 3cm; /* may be overridden by the settings */
width: auto;
}
td.header {
font-size: 16pt;
font-weight: 700;
}
td.shop-info {
width: 40%;
}
.document-type-label {
text-transform: uppercase;
}
/* Recipient addresses & order data */
table.order-data-addresses {
width: 100%;
margin-bottom: 10mm;
}
table.order-data-addresses td.address,
table.order-data-addresses td.order-data {
overflow-wrap: anywhere;
}
td.order-data {
width: 40%;
}
td.order-data table {
width: 100%;
}
td.order-data table th {
font-weight: normal;
padding-right: 2mm;
width: 50%;
overflow-wrap: break-word;
}
.invoice .shipping-address {
width: 30%;
}
.packing-slip .billing-address {
width: 30%;
}
/* Order details */
table.order-details {
width:100%;
margin-bottom: 8mm;
page-break-before: avoid;
}
.quantity,
.price {
width: 20%;
}
.order-details tr {
page-break-inside: always;
page-break-after: auto;
}
.order-details td,
.order-details th {
border-bottom: 1px #ccc solid;
border-top: 1px #ccc solid;
padding: 0.375em;
}
.order-details th {
font-weight: bold;
text-align: left;
}
.order-details thead th {
color: white;
background-color: black;
border-color: black;
}
/* product bundles compatibility */
.order-details tr.bundled-item td.product {
padding-left: 5mm;
}
.order-details tr.product-bundle td,
.order-details tr.bundled-item td {
border: 0;
}
.order-details tr.bundled-item.hidden {
display: none;
}
/* item meta formatting for WC2.6 and older */
dl {
margin: 4px 0;
}
dt, dd, dd p {
display: inline;
font-size: 7pt;
line-height: 7pt;
}
dd {
margin-left: 5px;
}
dd:after {
content: "\A";
white-space: pre;
}
/* item-meta formatting for WC3.0+ */
.wc-item-meta {
margin: 4px 0;
font-size: 7pt;
line-height: 7pt;
overflow-wrap: anywhere;
}
.wc-item-meta p {
display: inline;
}
.wc-item-meta li {
margin: 0;
margin-left: 5px;
}
/* Notes & Totals */
.document-notes,
.customer-notes {
margin-top: 5mm;
overflow-wrap: anywhere;
}
table.totals {
width: 100%;
margin-top: 5mm;
table-layout: fixed;
}
table.totals th,
table.totals td {
border: 0;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
table.totals th.description,
table.totals td.price {
width: 50%;
}
table.totals tr.order_total td,
table.totals tr.order_total th {
border-top: 2px solid #000;
border-bottom: 2px solid #000;
font-weight: bold;
}
table.totals tr.payment_method {
display: none;
}
/* Footer Imprint */
#footer {
position: absolute;
bottom: -2cm;
left: 0;
right: 0;
height: 2cm; /* if you change the footer height, don't forget to change the bottom (=negative height) and the @page margin-bottom as well! */
text-align: center;
border-top: 0.1mm solid gray;
margin-bottom: 0;
padding-top: 2mm;
}
/* page numbers */
.pagenum:before {
content: counter(page);
}
.pagenum,.pagecount {
font-family: sans-serif;
}

View File

@@ -0,0 +1,6 @@
<?php
/**
* Use this file for all your template filters and actions.
* Requires PDF Invoices & Packing Slips for WooCommerce 1.4.13 or higher
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly