diff --git a/assets/css/order-styles.css b/assets/css/order-styles.css
index 25da40cc..a9b41e91 100644
--- a/assets/css/order-styles.css
+++ b/assets/css/order-styles.css
@@ -26,8 +26,8 @@
fill: #2aad2a;
}
-.type-shop_order .column-wc_actions a.button.wpo_wcpdf > svg.icon-ubl,
-.woocommerce_page_wc-orders .column-wc_actions a.button.wpo_wcpdf > svg.icon-ubl {
+.type-shop_order .column-wc_actions a.button.wpo_wcpdf > svg.icon-xml,
+.woocommerce_page_wc-orders .column-wc_actions a.button.wpo_wcpdf > svg.icon-xml {
left: auto;
right: 2px;
fill: black;
diff --git a/includes/Admin.php b/includes/Admin.php
index c6cb6e71..6a5b201c 100644
--- a/includes/Admin.php
+++ b/includes/Admin.php
@@ -223,7 +223,6 @@ public function add_listing_actions( $order ) {
if ( $document = wcpdf_get_document( $document_type, $order ) ) {
foreach ( $document->output_formats as $output_format ) {
switch ( $output_format ) {
- default:
case 'pdf':
if ( $document->is_enabled( $output_format ) ) {
$document_url = WPO_WCPDF()->endpoint->get_document_link( $order, $document->get_type() );
@@ -280,6 +279,7 @@ public function add_listing_actions( $order ) {
}
$listing_actions = apply_filters( 'wpo_wcpdf_listing_actions', $listing_actions, $order );
+ $xml_formats = apply_filters( 'wpo_wcpdf_xml_formats', array( 'ubl' ) );
foreach ( $listing_actions as $action => $data ) {
if ( ! isset( $data['class'] ) ) {
@@ -290,9 +290,9 @@ public function add_listing_actions( $order ) {
$printed = $data['printed'] ? '' : '';
// ubl replaces exists
- $exists = isset( $data['output_format'] ) && 'ubl' === $data['output_format'] ? '' : $exists;
+ $exists = isset( $data['output_format'] ) && in_array( $data['output_format'], $xml_formats ) ? '' : $exists;
- if ( isset( $data['output_format'] ) && ( 'ubl' !== $data['output_format'] || $data['exists'] ) ) {
+ if ( isset( $data['output_format'] ) && ( ! in_array( $data['output_format'], $xml_formats ) || $data['exists'] ) ) {
printf(
'%5$s%6$s',
esc_attr( $data['url'] ),