Files
mccans-theme/actions/WooCommerceCategoryLayoutHideProducts.php
2025-07-18 16:14:49 -07:00

31 lines
617 B
PHP

<?php
namespace Actions;
use ofc\RadAction;
class WooCommerceCategoryLayoutHideProducts extends RadAction
{
protected string $hookName = "woocommerce_before_main_content";
public function callback()
{
if (!is_product_category()) {
return;
}
$type = site()->getQueriedObject(null, ['display_type']);
if ($type === "") {
$type = "products";
} else {
$type = $type["display_type"];
}
if ($type != "subcategories") {
return;
}
echo site()->render("hideWooCommerceWrapper");
}
}