Hi, @shamsdev,
Hi, I mean placeholder like {order_date}
I’m still not sure if I got the question right, but to get the order date with the [order_func]
shortcode, you would do something like this:
[order_func func="get_date_created"]
Please note that as the get_date_created()
function returns WC_DateTime
class object, the output will be similar to this: 2023-05-10T17:15:09+00:00
.
Generally, in the [order_func]
shortcode, you can use all the functions listed in the WC_Order
class documentation. However, please note that not all return types (e.g., array
) will be outputted as expected. So probably you mostly will be using functions which return scalar types, e.g., string
. Also, currently, you can only use functions that do not have any required params.
Is there any method to show text message based on product variation.
I would suggest taking a simpler approach. The [order_item_names]
shortcode will output all order products (comma-separated), so instead of using multiple if
, you could do this:
Thank you for purchasing [order_item_names]
As you only allow your customers to have one product in the order, this should solve the task.
If you still prefer to use if
– there is [if]
shortcode in the plugin. Currently, you can’t use product IDs, however, you can use product names:
[if value1="{order_item_names}" value2="Students Basic Membership" operator="equal"]Thank you for purchasing Students Basic Membership[/if]
[if value1="{order_item_names}" value2="Students Silver Membership" operator="equal"]Thank you for purchasing Students Silver Membership[/if]
[if value1="{order_item_names}" value2="Students Gold Membership" operator="equal"]Thank you for purchasing Students Gold Membership[/if]
Please give it a try and let me know what you think.