AssignDefaultCategory
Class to assign default category to products.
Description Description
Source Source
File: src/Internal/AssignDefaultCategory.php
Methods Methods
- init — Class initialization, to be executed when the class is resolved by the container.
- maybe_assign_default_product_cat — Assigns default product category for products that have no categories.
- schedule_action — When a product category is deleted, we need to check if the product has no categories assigned. Then assign it a default category. We delay this with a scheduled action job to not block the response.