shop changes
This commit is contained in:
30
actions/WooCommerceCategoryLayoutHideProducts.php
Normal file
30
actions/WooCommerceCategoryLayoutHideProducts.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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("hideProducts");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user