### JSON Response Example Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Example of the JSON structure for batch data, including purchase order information. ```json { "batches": [ { "batch_number": "EOEOEOEOEOEOE", "date_expiry": "2023-12-31 00:00:00", "quantity": "50", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` ```json { "batches": [ { "batch_number": "EOEOEOEOEOEOE", "date_expiry": "2023-12-31 00:00:00", "quantity": "50", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` ```json { "batches": [ { "batch_number": "EOEOEOEOEOEOE", "date_expiry": "2023-12-31 00:00:00", "quantity": "50", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` -------------------------------- ### Get all batches endpoint Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 The GET request URL to retrieve all product batches. ```http http://wpovernight.local/wp-json/wc/v3/products/batches ``` -------------------------------- ### Retrieve all batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 A GET request to fetch all product batches. ```json "request": { "method": "GET", "header": [], "url": { "raw": "{{api_path}}/products/batches", "host": [ "{{api_path}}" ], "path": [ "products", "batches" ] } }, "response": [] ``` -------------------------------- ### JSON Response Example Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 A sample JSON structure representing the response after updating a product batch. ```json { "batches": [ { "id": "53", "quantity_available": "20", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` ```json { "batches": [ { "id": "53", "quantity_available": "20", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` ```json { "batches": [ { "id": "53", "quantity_available": "20", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` -------------------------------- ### Usage of [wcpdf_download_pdf] shortcode Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/download-invoice-link-with-shortcode Examples of using the download shortcode with default and custom attributes. ```text [wcpdf_download_pdf] ``` ```text [wcpdf_download_pdf document_type="invoice" link_text="Click here to Download the PDF invoice" order_id="123" id="invoice-link" class="pdf-invoice pdf-shortcode"] ``` -------------------------------- ### Usage of [wcpdf_document_link] shortcode Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/download-invoice-link-with-shortcode Example of using the raw document link shortcode. ```text [wcpdf_document_link] ``` -------------------------------- ### JSON response for batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Example of the JSON structure returned when querying for batches. ```json { "23": { "id": "23", "date_created": "2024-02-01 09:55:08", "date_expiry": "2024-10-01 09:55:08", "user_id": "1", "batch_number": "c40b0dc24d", "supplier": "WP Overnight", "location": "Netherlands", "quantity": "20.0000", "quantity_available": "18.0000", "units": "1", "status": "active", "order_ids": "[1037,1038]", "shared_ids": "[275]" }, } ``` ```json { "23": { "id": "23", "date_created": "2024-02-01 09:55:08", "date_expiry": "2024-10-01 09:55:08", "user_id": "1", "batch_number": "c40b0dc24d", "supplier": "WP Overnight", "location": "Netherlands", "quantity": "20.0000", "quantity_available": "18.0000", "units": "1", "status": "active", "order_ids": "[1037,1038]", "shared_ids": "[275]" }, } ``` ```json { "23": { "id": "23", "date_created": "2024-02-01 09:55:08", "date_expiry": "2024-10-01 09:55:08", "user_id": "1", "batch_number": "c40b0dc24d", "supplier": "WP Overnight", "location": "Netherlands", "quantity": "20.0000", "quantity_available": "18.0000", "units": "1", "status": "active", "order_ids": "[1037,1038]", "shared_ids": "[275]" }, } ``` -------------------------------- ### GET /products/batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Retrieves a list of all product batches. ```APIDOC ## GET /products/batches ### Description Retrieves a list of all product batches available in the system. ### Method GET ### Endpoint /wp-json/wc/v3/products/batches ### Response #### Success Response (200) - **id** (string) - The unique identifier of the batch - **date_created** (string) - The date the batch was created - **date_expiry** (string) - The expiry date of the batch - **user_id** (string) - The ID of the user associated with the batch - **batch_number** (string) - The unique batch number string - **supplier** (string) - The supplier name - **location** (string) - The location of the batch - **quantity** (string) - The total quantity - **quantity_available** (string) - The available quantity - **units** (string) - The unit count - **status** (string) - The status of the batch (e.g., active) - **order_ids** (string) - JSON array of associated order IDs - **shared_ids** (string) - JSON array of shared IDs #### Response Example { "23": { "id": "23", "date_created": "2024-02-01 09:55:08", "date_expiry": "2024-10-01 09:55:08", "user_id": "1", "batch_number": "c40b0dc24d", "supplier": "WP Overnight", "location": "Netherlands", "quantity": "20.0000", "quantity_available": "18.0000", "units": "1", "status": "active", "order_ids": "[1037,1038]", "shared_ids": "[275]" } } ``` -------------------------------- ### GET /products/{product_id} Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Retrieves details for a specific product. ```APIDOC ## GET /products/{product_id} ### Description Retrieves information for a specific product by its ID. ### Method GET ### Endpoint {{api_path}}/products/{product_id} ### Parameters #### Path Parameters - **product_id** (string) - Required - The ID of the product to retrieve. ``` -------------------------------- ### GET /products/batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Retrieves a list of all product batches. ```APIDOC ## GET /products/batches ### Description Retrieves a list of all product batches. ### Method GET ### Endpoint {{api_path}}/products/batches ``` -------------------------------- ### GET /products/batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Retrieves a list of all product batches. ```APIDOC ## GET /products/batches ### Description Retrieves all available product batches. ### Method GET ### Endpoint {{api_path}}/products/batches ``` -------------------------------- ### Example Server Error Message Source: https://docs.wpovernight.com/woocommerce-smart-reminder-emails/troubleshooting An example of a server-side error message that may appear when the environment does not support JSON partial matching. ```text Error during status transition. JSON partial matching not supported in your environment. Please check your MySQL/MariaDB version ``` -------------------------------- ### Using Placeholders in Email Templates Source: https://docs.wpovernight.com/woocommerce-smart-reminder-emails/email-placeholders Example of how to reference standard and custom placeholders within the reminder email editor. ```text The order was placed on {order_date} Here are the product descriptions: {all_product_descriptions} ``` -------------------------------- ### Broken Translation String Example Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-loco-translate-to-customize-translations An example of a translation string missing required placeholders. ```text Pour garder les limites de l'API %1$s sous contrôle, vous devez activer votre licence d'extension professionnelle pour utiliser ce service. Découvrez comment activer votre licence %2$s. ``` -------------------------------- ### Create a Custom Placeholder with PHP Source: https://docs.wpovernight.com/woocommerce-smart-reminder-emails/email-placeholders Use the wpo_wcsre_replace_ABCDE filter hook to define a new placeholder. This example demonstrates creating a placeholder that retrieves and displays all product descriptions from an order. ```php /** * WP Overnight * Introducing a new placeholder to display all product descriptions. **/ add_filter( 'wpo_wcsre_replace_all_product_descriptions', 'wpo_handle_all_product_descriptions_placeholder', 10, 2 ); function wpo_handle_all_product_descriptions_placeholder( string $output, WC_Abstract_Order $order ): string { $product_descriptions = array(); foreach ( $order->get_items() as $item ) { $product = $item->get_product(); if ( $product ) { $product_descriptions[] = $product->get_description(); } } $output = implode( "\n", $product_descriptions ); return $output; } ``` -------------------------------- ### Create or regenerate document JSON response Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-the-rest-api Example response returned after successfully creating or regenerating a document. ```json { "number": "1078", "date": "2024-03-02T13:37:25", "date_timestamp": 1709386645 } ``` -------------------------------- ### GET /products/batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Retrieves a list of all batches. ```APIDOC ## GET /products/batches ### Description Retrieves a list of all available batches. ### Method GET ### Endpoint {{api_path}}/products/batches ``` -------------------------------- ### CSV structure for existing batch updates Source: https://docs.wpovernight.com/woocommerce-batch-numbers/import-update-product-batch-data-using-wp-all-import-add-on Example of a CSV row containing a batch_id to update an existing product batch. ```text batch_id,date_expiry,product_id,batch_number,supplier,quantity,quantity_available,status 38,"2022-12-03 00:00:00",310,PWOWOWOWOWOWO,WPO,100,20,active ``` -------------------------------- ### Retrieve an order JSON response Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-the-rest-api Example structure of the response containing document details for an order. ```json { ... "documents": { "invoice": { "number": "1", "date": "2024-02-27T15:34:31", "date_timestamp": 1709048071 }, "proforma": { "number": 1, "date": "2024-02-23T13:25:50", "date_timestamp": 1708694750 }, "credit-note": [ { "number": 2, "date": "2024-02-28T10:34:31", "date_timestamp": 1735893084 }, { "number": 3, "date": "2024-02-28T10:34:32", "date_timestamp": 1735892964 } ] }, } ``` -------------------------------- ### Display order notes via action hooks Source: https://docs.wpovernight.com/article/displaying-order-notes Add these snippets to your theme's functions.php to inject order notes into documents. The second example restricts output to packing slips. ```php add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_order_notes', 10, 2 ); function wpo_wcpdf_order_notes ($template_type, $order) { $document = wcpdf_get_document( $template_type, $order ); $document->order_notes(); } ``` ```php add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_order_notes', 10, 2 ); function wpo_wcpdf_order_notes ($template_type, $order) { if ($template_type == 'packing-slip') { $document = wcpdf_get_document( $template_type, $order ); $document->order_notes(); } } ``` -------------------------------- ### Template Header and Footer Structure Source: https://docs.wpovernight.com/article/repeating-headers-footers Example of the top section of a template file with the footer positioned immediately following the header table. ```php
has_header_logo() ) { $this->header_logo(); } else { echo $this->get_title(); } ?>

shop_name(); ?>

shop_address(); ?>
get_footer() ) : ?> ``` ```php
has_header_logo() ) { $this->header_logo(); } else { echo $this->get_title(); } ?>

shop_name(); ?>

shop_address(); ?>
get_footer() ) : ?> ``` ```php
has_header_logo() ) { $this->header_logo(); } else { echo $this->get_title(); } ?>

shop_name(); ?>

shop_address(); ?>
get_footer() ) : ?> ``` -------------------------------- ### Original Translation String Example Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-loco-translate-to-customize-translations The source string containing four placeholders used as a reference for translation. ```text To keep %1$s API limits under control, you are required to activate your Professional extension license to use this service. See how to activate your license %2$shere%4$s, or clear the cache %3$shere%4$s. ``` -------------------------------- ### CSV structure for creating new batches Source: https://docs.wpovernight.com/woocommerce-batch-numbers/import-update-product-batch-data-using-wp-all-import-add-on Example of a CSV row with an empty batch_id field, which triggers the creation of a new batch upon import. ```text batch_id,date_expiry,product_id,batch_number,supplier,quantity,quantity_available,status ,"2022-12-03 00:00:00",310,TESTESTESTESTEST,WPO,10,10,active ``` -------------------------------- ### Example CSS Class Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/how-to-use-the-browser-developer-tools-to-find-css-classes An example of a CSS class identifier found within the HTML inspector. ```text payment-method ``` -------------------------------- ### Check Address via GET Request Source: https://docs.wpovernight.com/woocommerce-postcode-checker/address-check-using-woocommerce-rest-api Use this GET request to verify an address by providing the house number and postcode as query parameters. ```http http://wpovernight.local/wp-json/wc/wpo/wcpc/v1/wc-postcode-checker?house_number=30&postcode=2012ES ``` -------------------------------- ### Create a Two-Column Layout Source: https://docs.wpovernight.com/article/creating-a-custom-template Uses an HTML table to display a return address in the left column and label data in the right column. ```html
Return address:
Some Company
123 Main Street
Anytown, US 12345
``` ```html
Return address:
Some Company
123 Main Street
Anytown, US 12345
``` ```html
Return address:
Some Company
123 Main Street
Anytown, US 12345
``` -------------------------------- ### Insert Image via Settings using URL Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/insert-images Use an HTML img tag with a direct URL in the plugin settings fields. Ensure your server allows remote image fetching. ```html Please consider the environment before printing this document ``` -------------------------------- ### GET /wp-json/wc/v3/orders//documents Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-the-rest-api Downloads a PDF document for a specific order. ```APIDOC ## GET /wp-json/wc/v3/orders//documents ### Description Downloads a PDF document for a specific order. ### Method GET ### Endpoint http://your-site/wp-json/wc/v3/orders//documents ### Parameters #### Query Parameters - **type** (string) - Required - The document type. For example `invoice`. - **generate** (boolean) - Optional - If `true`, it generates the document if it doesn’t already exist. The default is `false`. ``` -------------------------------- ### Display full description via action hook Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/displaying-product-description Adds the full product description after item meta using the wpo_wcpdf_after_item_meta hook. ```php add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_show_product_full_description', 10, 3 ); function wpo_wcpdf_show_product_full_description ( $template_type, $item, $order ) { if (empty($item['product'])) return; $_product = $item['product']->is_type( 'variation' ) ? wc_get_product( $item['product']->get_parent_id() ) : $item['product']; if ( method_exists( $_product, 'get_description' ) ) { $description = $_product->get_description(); printf('
%s
', $description ); } } ``` -------------------------------- ### Insert Image via Settings using Server Path Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/insert-images Use the full server path to the image if remote URL fetching is restricted by your server configuration. ```html ``` -------------------------------- ### GET /wc/wpo/wcpc/v1/wc-postcode-checker Source: https://docs.wpovernight.com/woocommerce-postcode-checker/address-check-using-woocommerce-rest-api Retrieves address details based on the provided postcode and house number. ```APIDOC ## GET /wc/wpo/wcpc/v1/wc-postcode-checker ### Description Retrieves address information such as street and city based on a provided postcode and house number. ### Method GET ### Endpoint /wp-json/wc/wpo/wcpc/v1/wc-postcode-checker ### Parameters #### Query Parameters - **house_number** (string) - Required - The house number to check. - **postcode** (string) - Required - The postcode to check. ### Response #### Success Response (200) - **address** (object) - Contains address details including postcode, housenumber, street, and city. #### Response Example { "address": { "postcode": "2012ES", "housenumber": "30", "housenumber_suffix": "", "street": "Julianastraat", "city": "Haarlem", "data": { "street": "Julianastraat", "city": "Haarlem" } } } ``` -------------------------------- ### Display a product barcode via shortcode Source: https://docs.wpovernight.com/woocommerce-ultimate-barcodes/display-a-barcode-using-a-shortcode Use this shortcode to display a product barcode by providing the product ID. ```text [wcub_product_barcode id="21"] ``` -------------------------------- ### Authentication Error Response Source: https://docs.wpovernight.com/woocommerce-postcode-checker/address-check-using-woocommerce-rest-api Example of the error response received when there is an issue with the REST API authentication. ```json { "code": "woocommerce_rest_authentication_error", "message": "Invalid signature - provided signature does not match.", "data": { "status": 401 } } ``` -------------------------------- ### Basic Shortcode Usage Source: https://docs.wpovernight.com/woocommerce-batch-numbers/display-batch-number-on-product-pages-with-shortcode Displays the batch number using default settings. ```text [wcpbn_product_batch_numbers] ``` -------------------------------- ### Example base64_decode error message Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/server-requirements This warning appears if the base64_decode function is restricted in the PHP configuration. ```text "Warning: base64_decode() has been disabled for security reasons" ``` -------------------------------- ### Document type placeholder usage Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/add-an-additional-billing-email-address Example of using the {document_type} placeholder within email content. ```text Document type(s): {document_type} ``` -------------------------------- ### Recipient field configuration Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/add-an-additional-billing-email-address Example format for entering multiple email recipients in the settings field. ```text {customer}, test1@gmail.com, test2@gmail.com ``` -------------------------------- ### Display default Menu Cart shortcode Source: https://docs.wpovernight.com/wp-menu-cart/menu-cart-pro-shortcode Use this basic shortcode to insert the shopping cart with default settings. ```text [wpmenucart] ``` -------------------------------- ### Batch Update JSON Response Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Example of the JSON structure returned after a successful batch update request. ```json { "quantity_available": "20", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ``` ```json { "quantity_available": "20", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ``` ```json { "quantity_available": "20", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ``` -------------------------------- ### Address Verification JSON Response Source: https://docs.wpovernight.com/woocommerce-postcode-checker/address-check-using-woocommerce-rest-api Example of a successful JSON response returned by the address check endpoint. ```json { "address": { "postcode": "2012ES", "housenumber": "30", "housenumber_suffix": "", "street": "Julianastraat", "city": "Haarlem", "data": { "street": "Julianastraat", "city": "Haarlem" } } } ``` -------------------------------- ### PUT /wc/v3/products/ Source: https://docs.wpovernight.com/woocommerce-batch-numbers/using-the-rest-api-2 Inserts a new batch for a specific product. ```APIDOC ## PUT /wc/v3/products/ ### Description Inserts a new batch through a product. ### Method PUT ### Endpoint http://wpovernight.local/wp-json/wc/v3/products/ ### Parameters #### Path Parameters - **product_id** (integer) - Required - The unique identifier for the product. #### Request Body - **batches** (array) - Required - An array of batch objects. - **batches[].batch_number** (string) - Required - A unique identifier for the batch. - **batches[].date_expiry** (string) - Optional - The expiration date of the batch (YYYY-MM-DD HH:MM:SS). - **batches[].quantity** (integer) - Optional - The total quantity of items in the batch. - **batches[].quantity_available** (integer) - Optional - The number of available items in the batch. - **batches[].location** (string) - Optional - The location of items in the batch. - **batches[].status** (string) - Optional - The status of the batch (active or archived). - **batches[].user_id** (integer) - Optional - The unique identifier for the user. - **batches[].po** (object) - Optional - The purchase order details. - **batches[].po.date_created** (string) - Optional - Date the purchase order was created (YYYY-MM-DD HH:MM:SS). - **batches[].po.po_number** (string) - Optional - The purchase order number. - **batches[].po.supplier** (string) - Optional - The name of the supplier. - **batches[].po.cost** (float) - Optional - The cost price of the item. - **batches[].po.regular_price** (float) - Optional - The regular selling price of the item. - **batches[].po.sale_price** (float) - Optional - The sale price of the item. - **batches[].po.price_margin** (float) - Optional - The profit margin on the item. - **batches[].po.price_discount** (float) - Optional - The discount amount applied to the item. ### Response Example { "batches": [ { "batch_number": "EOEOEOEOEOEOE", "date_expiry": "2023-12-31 00:00:00", "quantity": "50", "po": { "date_created": "2023-01-16 00:00:00", "po_number": "PO23456", "supplier": "WPO", "cost": 10.99, "regular_price": 14.99, "sale_price": 13.99, "price_margin": 30.00, "price_discount": 5.00 } } ] } ``` -------------------------------- ### Enable Alternative WordPress Cron Source: https://docs.wpovernight.com/woocommerce-automatic-order-printing-printnode/how-can-i-reduce-any-printing-delays-in-the-wordpress-scheduled-task-system Use this configuration setting in wp-config.php if loopback connections are blocked by the hosting provider. ```php define('ALTERNATE_WP_CRON', true); ``` -------------------------------- ### Email subject placeholder usage Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/add-an-additional-billing-email-address Example of using placeholders to dynamically generate an email subject line. ```text {document_type} for {site_title} Order #{order_number} ``` -------------------------------- ### Remove internal fields Source: https://docs.wpovernight.com/e-documents/customize-the-item-meta-included-in-e-documents Filters out meta fields that start with an underscore, typically used for internal data. ```php add_filter( 'wpo_ips_edi_get_item_meta', function( $rows ) { return array_values( array_filter( $rows, fn( $r ) => ! str_starts_with( $r['name'], '_' ) ) ); }, 10, 4 ); ``` -------------------------------- ### GET /wc/v3/orders/ Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-the-rest-api Retrieve and view a specific order. Document data is included under the documents field of the response. ```APIDOC ## GET /wc/v3/orders/ ### Description Retrieve and view a specific order. All document data is under the `documents` field of the response. ### Method GET ### Endpoint http://your-site/wp-json/wc/v3/orders/ ### Response #### Success Response (200) - **documents** (object) - Contains document details for invoice, proforma, and credit-note. #### Response Example { "documents": { "invoice": { "number": "1", "date": "2024-02-27T15:34:31", "date_timestamp": 1709048071 }, "proforma": { "number": 1, "date": "2024-02-23T13:25:50", "date_timestamp": 1708694750 }, "credit-note": [ { "number": 2, "date": "2024-02-28T10:34:31", "date_timestamp": 1735893084 } ] } } ``` -------------------------------- ### Display short description via action hook Source: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/displaying-product-description Adds the product short description after item meta using the wpo_wcpdf_after_item_meta hook. ```php add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_show_product_description', 10, 3 ); function wpo_wcpdf_show_product_description ( $template_type, $item, $order ) { if (empty($item['product'])) return; $_product = $item['product']->is_type( 'variation' ) ? wc_get_product( $item['product']->get_parent_id() ) : $item['product']; if ( method_exists( $_product, 'get_short_description' ) ) { $description = $_product->get_short_description(); printf('
%s
', $description ); } } ```