shopplugins / woocommerce-availability-chart

GNU General Public License v2.0
2 stars 1 forks source link

Template file for the Availability Chart #4

Open growdev opened 10 years ago

growdev commented 10 years ago

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 like woocommerce-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.

growdev commented 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.

JeroenSormani commented 10 years ago

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!

growdev commented 10 years ago

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.

JeroenSormani commented 10 years ago

We'll do! Thanks!