anjitha21
Forum Replies Created
-
Hi @tmin
The issue is most likely caused by the PDF fonts not being configured for Chinese characters.
Could you please navigate to:
Print Invoices & Delivery Notes → Settings → Font Settings and check whether the Noto Sans TC fonts have been uploaded?
Screenshot for your reference: https://prnt.sc/76e4pyyOChX6
For Chinese stores, both the Regular and Bold versions of the Noto Sans TC font are required. If they are not uploaded, Chinese characters may appear as boxes or unreadable text in the generated PDFs.
After uploading the fonts, please generate a new PDF and let us know whether the issue persists.
Thank you.
Forum: Plugins
In reply to: [Print Invoice & Delivery Notes for WooCommerce] Lost all custiomized fieldThank you for taking the time to investigate this issue and for sharing your findings in such detail.
We have created an internal issue for our development team and included the details and suggested fix that you provided. They will review the implementation and determine whether a deduplication mechanism should be added to improve compatibility with third-party plugins such as WooCommerce Delivery & Pickup Date Time Pro by CodeRockz.
Thank you again for your effort in debugging the issue and proposing a solution.
We appreciate your contribution and will keep this under consideration for a future update.
Hi @ll09 ,
Regarding the filter, that’s a good suggestion.
At the moment, disabling PDF generation requires using the filter provided by our developer.
However, we have created an enhancement request to add a dedicated option in the plugin settings so that users can enable or disable PDF generation directly from the admin panel without using custom code.
Thank you for the suggestion.
We’ll consider it for a future update.
You’re welcome! I’m glad to hear that disabling the PDF generation and replacing the
class-pdf.phpfile resolved the issue and that the plugin is now working as expected.The changes made in the patched
class-pdf.phpfile will be included in a future plugin release, so once you update to that version, you will not need to manually replace the file again.If you are happy with the support provided, we would greatly appreciate it if you could leave us a review here
Your feedback helps us improve our products and support services.
Thank you.
Thank you for reporting this issue. We tried on our end too.
You can use this code which will remove the SKU for both products.
add_filter( 'woocommerce_product_get_sku', 'ts_hide_sku_on_print_order', 10, 2 );
add_filter( 'woocommerce_product_variation_get_sku', 'ts_hide_sku_on_print_order', 10, 2 );
function ts_hide_sku_on_print_order( $sku, $product ) {
if ( isset( $_GET['print-order-type'] ) ) {
return '';
}
return $sku;
}Please check it on your end and let us know if there are any further questions.
We are happy to help you!
Thank you for reporting this issue.
Our developer has investigated the problem, fixed it, and provided a patch.
Please download the patch and replace the following file:
/plugins/woocommerce-delivery-notes/includes/services/class-pdf.phpThis patch includes two improvements:
- It adds a safety check to prevent the fatal error from occurring when the filesystem is unavailable in the WP-CLI context.
- It introduces a new filter,
wcdn_enable_pdf, which allows PDF generation to be disabled entirely if it is not required.
To disable PDF generation, add the following code to your theme’s
functions.phpfile:add_filter( 'wcdn_enable_pdf', '__return_false' );Please apply the patch and let us know if you encounter any further issues.
Yes, it is possible to remove SKU.
You can use this code provided by our developer:
add_filter( 'woocommerce_product_get_sku', function( $sku, $product ) {
if ( isset( $_GET['print-order-type'] ) ) {
return '';
}
return $sku;
}, 10, 2 );Please let us know if there are any further questions.
Forum: Plugins
In reply to: [Print Invoice & Delivery Notes for WooCommerce] Lost all custiomized fieldTo help us identify the cause of the duplicate metadata entries, could you please add the following code snippet to your site temporarily?
This will display all order meta field keys on the invoice page, allowing us to see which metadata is being loaded and whether any entries are being duplicated.
add_filter( 'wcdn_order_meta_fields', function( $fields, $order, $settings, $template ) {
echo '<pre style="background:yellow;padding:10px;font-size:11px;position:relative;z-index:9999;">';
echo '<strong>ALL ORDER META FIELD KEYS:</strong>' . "\n";
foreach ( $fields as $f ) {
echo 'key=' . $f['key'] . ' | label=' . $f['label'] . ' | value=' . $f['value'] . "\n";
}
echo '</pre>';
return $fields;
}, 10, 4 );Once added, please generate the invoice again and share a screenshot or copy of the debug output with us.
Additionally, if you notice any duplicated metadata entries in the debug output, please add the following code snippet to your theme’s
functions.phpfile and check the invoice again:add_filter( 'wcdn_order_meta_fields', function( $fields, $order, $settings, $template ) {
$seen_keys = [];
$unique_fields = [];
foreach ( $fields as $field ) {
if ( in_array( $field['key'], $seen_keys, true ) ) {
continue; // duplicate skip it
}
$seen_keys[] = $field['key'];
$unique_fields[] = $field;
}
return $unique_fields;
}, 20, 4 );Please let us know the results after testing, and we’ll investigate further based on the output.
Regarding the translation issue, I tried to replicate but it is working fine with “Author”, “System”, and “Custom”.
Screenshot for your reference: https://prnt.sc/MsV44AdNBpfI & https://prnt.sc/M9QwYoZN3-g2
Also from the shared screenshot by you the string is successfully translated.
Please let us know if there are any further questions.
Sorry that the issue persists in the latest version.
To investigate this further, could you please email us at ‘support at tychesoftwares dot com’ with the relevant details and temporary admin access to your site?
This will help us troubleshoot the issue more effectively.
We appreciate your cooperation and look forward to resolving this for you.
Yes, it is possible.
Our developer provided the new filter code which you can use to achieve this requirement.
add_filter( 'wcdn_order_meta_fields', function( $fields ) {
foreach ( $fields as &$field ) {
switch ( $field['key'] ) {
case 'billingEmail':
if ( ! empty( $field['value'] ) ) {
$field['value'] = preg_replace(
'/^(.{2}).*(@.*)$/',
'$1*****$2',
$field['value']
);
}
break;
case 'billingPhone':
if ( ! empty( $field['value'] ) ) {
$phone = preg_replace( '/\D/', '', $field['value'] );
if ( strlen( $phone ) > 8 ) {
$field['value'] =
substr( $phone, 0, 5 ) .
'*****' .
substr( $phone, -3 );
}
}
break;
}
}
return $fields;
} );Please let us know if there are any questions further.
We would be happy to help you!
Please note that with the new version you do not need any custom code for this requirement.
You can disable/enable billing address, email, phone number according to your choice in the template settings: https://prnt.sc/UJtl4gnzsmok
Please check this on your end and let us know if there are any further questions.
We would be very happy to help!
Hi @kt77
Thank you for getting back to us, and no worries about the delayed reply.
Glad to hear that the issue is resolved.
If you have a moment, we would love to hear your feedback about your experience with the plugin so far. Your thoughts and suggestions help us improve the product and provide a better experience for all our users.
If you’re happy with the plugin and the support you’ve received, we would also greatly appreciate a review.
Yes, the code will work with the latest version.
Please make sure that you are using the latest version (7.1.2).
If it is still nor working, please let us know.
Looking forward for your reply.
Forum: Plugins
In reply to: [Print Invoice & Delivery Notes for WooCommerce] Lost all custiomized fieldThank you for the updates.
For the duplication issue, our developer is currently checking it.
It seems that the string is correctly translated into French as per the screenshot.
May I know if you face issues only while printing a particular document or all the documents?
Looking forward for your reply.
Forum: Plugins
In reply to: [Print Invoice & Delivery Notes for WooCommerce] shipping addressHi @rekers
Thank you for clarifying.
You can create a table header so it will appear before the table and automatically repeat on every printed page. You can use the filter below, and it will work only for the packing slip template.
add_action( 'wcdn_before_items', 'custom_wcdn_packingslip_repeat_header', 1, 2 );
function custom_wcdn_packingslip_repeat_header( $order, $template ) {
if ( 'packingslip' !== $template ) {
return;
}
?>
<style>
@media print {
.wcdn-items thead {
display: table-header-group;
}
.wcdn-repeat-address-row th {
text-align:left;
padding-bottom:15px;
border-bottom:1px solid #ccc;
}
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
var table = document.querySelector('.wcdn-items');
if (!table) {
return;
}
var thead = table.querySelector('thead');
if (!thead) {
return;
}
var repeatRow = document.createElement('tr');
repeatRow.className = 'wcdn-repeat-address-row';
repeatRow.innerHTML =<br> <th colspan="2"><br><br> <table width="100%"><br> <tr><br><br> <td style="width:50%; vertical-align:top;"><br><br> <strong>Billing Address</strong><br><br><br><br> <?php echo esc_js( $order['billing']['name'] ?? '' ); ?><br><br><br> <?php<br> if ( ! empty( $order['billing']['address'] ) ) {<br><br> foreach ( $order['billing']['address'] as $line ) {<br><br> echo esc_js( $line ) . '<br>';<br> }<br> }<br> ?><br><br> </td><br><br> <td style="width:50%; vertical-align:top;"><br><br> <strong>Shipping Address</strong><br><br><br><br> <?php echo esc_js( $order['shipping']['name'] ?? '' ); ?><br><br><br> <?php<br> if ( ! empty( $order['shipping']['address'] ) ) {<br><br> foreach ( $order['shipping']['address'] as $line ) {<br><br> echo esc_js( $line ) . '<br>';<br> }<br> }<br> ?><br><br> </td><br><br> </tr><br> </table><br><br> </th><br>;
thead.prepend(repeatRow);
});
</script>
<?php
}
Also, for the first page, you can disable the default billing/shipping section because this snippet will add the billing/shipping details on the first page as well.
Please note that this will not work for PDF generation. If you want the same behavior in PDF, then it would require complete template customization.Screenshot for your reference – https://prnt.sc/7FsFCXsadRjv
Please check it on your end and let us know if there are any further questions.