mirror of
https://github.com/proelements/proelements.git
synced 2026-04-18 01:52:20 +00:00
v3.33.1
This commit is contained in:
24
modules/woocommerce/classes/base-products-renderer.php
Normal file
24
modules/woocommerce/classes/base-products-renderer.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace ElementorPro\Modules\Woocommerce\Classes;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
abstract class Base_Products_Renderer extends \WC_Shortcode_Products {
|
||||
|
||||
/**
|
||||
* Override original `get_content` that returns an HTML wrapper even if no results found.
|
||||
*
|
||||
* @return string Products HTML
|
||||
*/
|
||||
public function get_content() {
|
||||
$result = $this->get_query_results();
|
||||
|
||||
if ( empty( $result->total ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return parent::get_content();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user