bookingactivities / booking-activities

Wordpress plugin booking system
GNU General Public License v3.0
29 stars 10 forks source link

WC order number #134

Closed rayedgar closed 2 years ago

rayedgar commented 2 years ago

Is there a way to show the WC order nr (which in our case uses an invoice number generated by flexible invoices) into the notification emails and in the booking system?

yoancutillas commented 2 years ago

This is not possible unfortunately, the only way would be with custom code.

You can add a custom notification tag with custom code as described here: #49 (comment)

rayedgar commented 2 years ago

HI, i have tried to change the snippet and set 'my tag value' to an WC variable {order_number} that does not work. This snippet is used for text based notification only? as you can see i am not a coder.

can i assign the WC order_number variable to {my_tag}?

All i need is to show the order number WC uses into the notification email. I would really appreciate if you can show me an example for the code.

yoancutillas commented 2 years ago

Sorry I cannot provide support for custom code, the code provided is actually an example. If you use that code, then you can use the {my_tag} tag in your notification and it will display "my tag value" in the email.

You can try to replace $tags[ '{my_tag}' ] = 'my tag value'; with $tags[ '{booking_order_id}' ] = ! empty( $booking->order_id ) ? $booking->order_id : '';

Then use the {booking_order_id} tag in your notification, it should display the order id.

rayedgar commented 2 years ago

Many thanks!