Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template file for the Availability Chart #4

Open
growdev opened this issue Jul 25, 2014 · 4 comments
Open

Template file for the Availability Chart #4

growdev opened this issue Jul 25, 2014 · 4 comments
Milestone

Comments

@growdev
Copy link
Contributor

growdev commented Jul 25, 2014

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
Copy link
Contributor Author

growdev commented Jul 25, 2014

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
Copy link
Contributor

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
Copy link
Contributor Author

growdev commented Jul 25, 2014

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.

@growdev growdev added this to the 1.1.0 milestone Jul 25, 2014
@JeroenSormani
Copy link
Contributor

We'll do!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants