31 lines
617 B
PHP
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");
|
|
}
|
|
}
|