ShopMagic Example Plugin
We created an Example ShopMagic plugin to show how to add custom events, filters, actions and placeholders.
It is a great starting point if you want to extend ShopMagic. It's also better to use and modify this plugin than add the custom code to your functions.php file.
Feel free to download it and fiddle with it or do anything you want. You can also safely install it as any other WP plugin.
We included 4 basic examples:
- Event: Order After Resend Email
- Triggered after invoice/order details are manually resent to customer.
- Filter: Order - Customer Provided Note
- Checks if the customer added a note to the order at the checkout.
- Action: Order Add Note
- Add a customized note to the order (supports placeholders)
- Placeholder: Order Number (order.number)
- Displays the formatted order numer (which in some cases can be different than the ID).
We think these examples will give you a very good overview of extending ShopMagic to your needs. The code is in most cases self explanatory and we also provided some inline comments to help you understand how these things work.
However if you run into any issues or have questions, please let us know and we will be happy to help.