-
Notifications
You must be signed in to change notification settings - Fork 1
Jeroen's Project Notes
- Copy the folder 'woocommerce-availability-chart' to your wp-content/plugins/ to install it within WordPress.
- Go to your website's admin and go to the 'plugins' page.
- Click on 'Activate' at the WooCommerce Availability Chart plugin.
- Open an variable product.
- Scroll down to the 'Product data' tab.
- Under the 'general' tab you will find a checkbox 'Availability chart', enable this.
- Save your product view the chart up front.
- You can also use the bulk or quick edit function within WooCommerce to enable Availability charts.*
Add the following CSS code to your style.css of your (child) theme:
.bar { background-color: #ddd; } .filled { background: #70BAFD; }
You can change the colors to any color you want.
I've chosen for one of my regular plugin structures.
- Main file
- Other required files (like readme, screenshots)
- assets/
- css/
- stylesheet.css
- css/
- assets/
- admin/
All required files that are in the main folder are there, other files are grouped in other folders. (admin is usually of the time divided under the 'includes' map)
I used classes because I find that they give a good structure to your code and is better readable vs. regular functions.
The class names are descriptive of what you can expect whats in the file.
There are four classes
- Woocommerce_Availability_Chart
- WAC_Admin
- WAC_Admin_Bulk_Edit
- WAC_Admin_Quick_Edit
I separated the Bulk and Quick Edit from the regular Admin class to provide better readability of the code.
All code has been written in compliance with the WordPress coding standards to the best of my knowledge.