Additional shortcodes
-
Hi,
Would it be possible to add some additional specific shortcodes to the plugin, for the number of articles in the order, used payment method, delivery/pickup method and charges, as well as subtotal/total?
Right now we have {email_order_total_footer} at our disposal, but this leaves no room for customization if you want to print a custom footer on the receipt, instead of using the default WooCommerce output. In addition, it does not provide a count of the articles in the order.
For now, I added the following to the plugin, which does part of the job:
$cart_items = $this->object->get_item_count(); $cart_total = $this->object->get_total(); $payment_method = $this->object->get_payment_method_title(); $this->placeholders['{woocommerce_email_cart_items}'] = sprintf( _n( '%d articolo', '%d articoli', $cart_items, 'amweb' ), $cart_items ) . ' - CHF ' . $cart_total . '<br/>' . $payment_method;
But this has some limits: for example, get_item_count is always returning the exact count of items, including also all components of composite products, which should be delivered as 1 single item, but are counted as 3 items (the composite product and its two components in my case).
Thank you in advance for your feedback.
Regards,
Aron
- The topic ‘Additional shortcodes’ is closed to new replies.