Open growdev opened 10 years ago
Let me know if you've done WooCommerce template files before, or if you'd like some leading on how to do them. If this will take > 2 hours, I'm not sure it's worth adding since the plugin works great without it.
Have not worked with templates before in plugins. I'll dive into this later on (my own time) and see if I can get it in the plugin. Thanks!
Let's leave this open and target it for version 1.1.0. I'll try to find or write a tutorial on WC templates.
Using templates provides value for customers with premium plugins since it lets them extend/modify your plugin without touching core code.
We'll do! Thanks!
In the Project Description:Frontend Changes I mentioned:
Please put the HTML for the availability chart into its own template inside of this plugin.
The
Woocommerce_Availability_Chart::wac_availability_chart()
method could be changed to pull in a file likewoocommerce-availability-chart/templates/single-product/availability-chart.php
.Then you can call
Woocommerce_Availabilty_Chart::wac_get_availability_bar()
from the template file if it were a static function, or just move the entire function loop to the template file.Having this inside of a template will give users the ability to override the template in their themes.