Title: Fatal error &#8211; DOMText
Last modified: August 22, 2016

---

# Fatal error – DOMText

 *  Resolved [ret](https://wordpress.org/support/users/blubb/)
 * (@blubb)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-domtext/)
 * Hi,
 * since upgrading to the latest version (WP, WC,…) i get the following message 
   when completing an order:
 * Fatal error: Call to undefined method DOMText::getAttribute() in /var/www/fqdn/
   public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/lib/dompdf/
   include/cellmap.cls.php on line 437
 * Thanks!
 * [https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379304)
 * This usually means there’s faulty HTML in your template, which is often caused
   by an error right in the middle of a table for example. If you output to HTML(
   see [FAQ](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/faq/)),
   you will probably see that error.
 * Let me know what you find and I’ll try to help you fix it.
 *  Thread Starter [ret](https://wordpress.org/support/users/blubb/)
 * (@blubb)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379348)
 * Now that’s strange, i’m using default templates. Any suggestions? Already enabled
   HTML output, everything is displayed without any issue.
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379359)
 * did you also enable WP_DEBUG?
 * Even if you’re using default templates, there could be plugins that alter some
   of the output in the template. You can also try running the template output through
   an HTML validator (like [http://validator.w3.org/#validate_by_input](http://validator.w3.org/#validate_by_input)).
   I am pretty sure that the getAttribute() error refers to a problem with the HTML.
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379551)
 * [@ret](https://wordpress.org/support/users/ret/), did you find the cause of this
   issue?
    Let me know if you still have any issues!
 *  Thread Starter [ret](https://wordpress.org/support/users/blubb/)
 * (@blubb)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379589)
 * Hi,
 * sorry for the delay. Unfortunately this issue still exists. Any further ideas?
   I have run it through the HTML validator – 14 errors.
 * like…
 * …”item-name”>Product Name</span><span class=”item-meta”><dl class=”variation”
   >
 * I am using default templates of the plugin.
 * Thank you!
 *  Thread Starter [ret](https://wordpress.org/support/users/blubb/)
 * (@blubb)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379590)
 * … the packing list is working properly – same logo, same name and so on. I don’t
   think that there is a special char which produces the error.
 *  Thread Starter [ret](https://wordpress.org/support/users/blubb/)
 * (@blubb)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379591)
 * At least i’ve figured it out, this part from invoice.php
 *     ```
       <?php foreach( $wpo_wcpdf->get_woocommerce_totals() as $key => $total ) : ?>
       						<tr class="<?php echo $key; ?>">
       							<td class="no-borders">&nbsp;</td>
       							<th class="description"><?php echo $total['label']; ?></th>
       							<td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td>
       						</tr>
       						<?php endforeach; ?>
       ```
   
 * Is causing the issue. Inside my theme, i’ve defined a text for woocommerce_de_small_business_regulation_text–
   if this is deleted, pdfs are created.
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379592)
 * Glad to hear you’ve figured it out! I have seen this before with German users/
   WooCommerce German Market, it’s an improper usage of a woocommerce action that
   is not meant for output… (they should have used filters instead!).
 *  Thread Starter [ret](https://wordpress.org/support/users/blubb/)
 * (@blubb)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379593)
 * Well, if i delete the block no totals are shown on the PDF. How can i fix that,
   or isn’t that something for your plugin? thx.
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379594)
 * No, you simply have to delete the woocommerce_de_small_business_regulation_text
   and output it in another way/location. IIRC this function is used to echo something
   upon calling the `woocommerce_get_order_item_totals` filter.
 * There’s an important difference between actions and filters in WordPress:
    Actions
   are meant to execute a function or output certain text/html, filters are meant
   to change/filter a variable.
 * In this case, this is about a filter for the woocommerce totals: `woocommerce_get_order_item_totals`
   is meant to make changes to the total rows (add new rows, modify how it’s displayed,
   labels, etc.). This filter gets executed when the total rows are requested. Because
   it’s not an action, no output is expected/supposed to be given. I can only request
   these totals in the middle of the table, because I have to loop through each 
   <tr>. Your filter (mistreated like an action) gives this kind of output:
 *     ```
       <table>
       Umsatzsteuerbefreit nach §4 UstG
       <tr>
         <td>Label</td>
         <td>€10</td>
       </tr>
       </table>
       ```
   
 * As you can see, this is not proper HTML (there’s not supposed to be any output
   outside of a td), and that’s why the PDF engine crashes.
    I advise you to contact
   German Market Press support to come up with a better solution.
 * Hope that helps!
    Ewout
 *  Thread Starter [ret](https://wordpress.org/support/users/blubb/)
 * (@blubb)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379595)
 * Great, thanks for your support!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Fatal error – DOMText’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [ret](https://wordpress.org/support/users/blubb/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-domtext/#post-5379595)
 * Status: resolved