This plugin adds what we consider standard refinements for e-commerce websites. These refinements include diverse customizations to WooCommerce and related plugins, like WooCommerce German Market.
The plugin adds several configuration settings in two main points of the backend admin:
- Custom tab in WooCommerce configuration page.
- Products options (simple products, products variations).
The customizations applied by shop-standards
affect diverse aspects of the way the shop works: products prices, products stocks, products delivery time, products listing filtering, SEO, performance, WP-CLI commands...
These customizations include:
- General products management and display.
- Products prices management and display
- Products sale label and category
- Products stocks management and display
- Products delivery time management and display
- Filtering products by delivery time
- Plus Products category
- Cart and checkout
- Set number of products displayed on listing pages.
- Minimum amount of product variations to trigger the AJAX retrieval of data.
- Enable revisions for products descriptions.
- Hide "Add to cart" button for products not to be sold online.
- Hide product sale label. This is controlled by a backend configuration setting.
The plugin adds several backend custom fields to both simple products(#1, #2, #3) and variable products(#1, #2).
Custom fields added to products are:
- Simple products
- Back in stock date
- GTIN
- ERP/Inventory ID
- Display sale price as normal price (checkbox)
- Product notes
- Custom price label
- Hide sale percentage bubble (checkbox)
- Hide add to cart button (checkbox)
- Variation has insufficient images (checkbox, only product variations)
- Purchasing Price
- Price comparison focus product
Customizations in the way the product prices are managed and displayed include:
- Strike out regular prices range of variable products on sale.
- Remove prefix "From" in variable products price ranges added by plugin B2B Market.
- Display sale price as regular price. This is controlled by a backend configuration setting.
Products on sale can be automatically assigned a custom category. This is implemented in class WooCommerceSaleLabel.
- Update variable product delivery time with the lowest delivery time among its own variations. The update is triggered when the product is saved or manually using a WP-CLI custom command.
This feature relies on a very specific way to setup the delivery time values. Those need to be defined as terms of taxonomy product_delivery_times
.
The slug of each term in the taxonomy has to be a numeric value, so that the code is able to compare all values and select the lowest one. The recommended way is to set the slug of each term to the value in days of the corresponding delivery time. If the delivery time is a range, we pick the highest time.
E.g.
- ca. 2-3 Wochen => 21
- ca. 5-6 Wochen => 40
- ca. 3-4 Werktage => 4
- 48 stunden => 2
This plugin adds a widget to filter products by their delivery time. This is achieved overriding layered nav WooCommerce widgets with new ones supporting WooCommerce German Market delivery time taxonomy terms (see previous point) to be used as product filters.
The whole implementation is contained in folder src/ProductFilters, entry point being class DeliveryTime.
The time delivery product filter widget can be used in any products listing page, as any other WooCommerce (so called) layered navigation widget.
- Add salutation custom field for billing and shipping. This is controlled by a backend configuration setting.
- Add a confirmation email custom field on the checkout page.This is controlled by a backend configuration setting.
- Add basic information (e.g. weight, sku, etc.) and product attributes to cart item data.
Performance improvements are mainly implemented in class Performance. Those cover:
- Preloading of main product image.
- Asynchronous loading of styles and scripts.
- DNS prefetching for resources.
- Prevent loading of unwanted assets.
Plugin shop-standards
provide a custom WP-CLI command to update the delivery time of variable products. This command ensures the delivery time assigned to variable products is the lowest among its variations.
Although this update is triggered whenever the variable products are edited and saved, this offers a convenient way to update a given variable product (by ID), a list of them (comma separated list of IDs) or all of them.
Update delivery time for a single product:
wp shop-standards refreshDeliveryTime 2165
Update delivery time for a list of products:
wp shop-standards refreshDeliveryTime 2165, 2166, 2167
Update delivery time for all products:
wp shop-standards refreshDeliveryTime --all