site-ground-simple-store-plugin
Site Ground Simple Store Plugin Task - All the requirements are covered excluding React :(
Table of Contents:
- Assets folder:
- Front.scss
- Admin.scss
- Admin.js
- Pages:
- Mass-Promo.php
- Single-Product-WOO.php (Used in case WooCommerce is active)
- Single-Product.php (Default Single Product Post)
- Store.php
- SG-SS.php (Plugin Main File)
Setup
- Place the plugin folder in the wp-content/plugins/ folder
- Go to WP-Admin and start it.
- Upon start it'll create the Custom Post Type - Product
- Upon start it'll create a custom table called - wp_prefix_mass_promo
Usage
- Go to Product from the sidebar of the Admin
- There you'll find:
- Product price
- Product quantity
- Product availability
- Product Promo Price
- Product Promo Price From
- Product Promo Price To (Note: If you don't fill the expiration of the promotion it can stay active forever)
- There you'll find:
- In the sidebar of the Admin you'll also find a new page called - Store:
- Store Page:
- List of all PUBLISHED items with all of their data.
- Edit button for quick transition to the editing screen.
- Mass Promo Sub Page of Store:
- List of all PUBLISHED items with their data.
- Pick / Unpick action to choose which products should receive Mass Promotion.
- Choose promo price and from - to date. (Note: If you don't fill the expiration of the promotion it can stay active forever)
- To remove products from Mass Promo just UNPICK them and click Save.
- Store Page:
- Product Preview:
- If WooCommerce is active you should fill the product price in the Woo field in order to see the fields. 1.1. Since Woo is calling the template part - woocommerce/woocommerce.php only when the default fields are filled. 1.2. Woo fields are not related to the prices which you'll put in the SG_SS plugin fields, WOO is used only to visualize the prices in the propper part of the page when Woo is active.
- If only SG_SS is active you'll see the default Single-Product.php template.
- Product Deletion:
- Upon removal from TRASH the plugin will take care of the product meta create by SG_SS and it'll remove the Mass Promotion setup from the wp_prefix_mass_promo table as well.
Closing remarks
It was very interesting task. If there is some issue with the setup please let me know, however it should work with just Plug & Play.
I'm sorry it took a bit more than expected. During the week I had to deal with my startup ExMoment.com payment provider issues as well.
Happy Easter!