: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* WooCommerce Modules: ET_Builder_Module_Woocommerce_Stock class
* The ET_Builder_Module_Woocommerce_Stock Class is responsible for rendering the
* Stock markup using the WooCommerce template.
* Class representing WooCommerce Stock component.
class ET_Builder_Module_Woocommerce_Stock extends ET_Builder_Module {
$this->name = esc_html__( 'Woo Stock', 'et_builder' );
$this->plural = esc_html__( 'Woo Stock', 'et_builder' );
$this->slug = 'et_pb_wc_stock';
$this->vb_support = 'on';
$this->settings_modal_toggles = array(
'main_content' => et_builder_i18n( 'Content' ),
$this->advanced_fields = array(
'label' => esc_html__( 'In Stock', 'et_builder' ),
'main' => '%%order_class%% .et_pb_module_inner .stock.in-stock',
'plugin_main' => '%%order_class%% .in-stock, %%order_class%% .in-stock a, %%order_class%% .in-stock span',
'default' => floatval( et_get_option( 'body_font_height', '1.7' ) ) . 'em',
'label' => esc_html__( 'Out Of Stock', 'et_builder' ),
'main' => '%%order_class%% .et_pb_module_inner .stock.out-of-stock',
'plugin_main' => '%%order_class%% .out-of-stock, %%order_class%% .out-of-stock a, %%order_class%% .out-of-stock span',
'default' => floatval( et_get_option( 'body_font_height', '1.7' ) ) . 'em',
'label' => esc_html__( 'On Backorder', 'et_builder' ),
'main' => '%%order_class%% .available-on-backorder',
'plugin_main' => '%%order_class%% .available-on-backorder, %%order_class%% .available-on-backorder a, %%order_class%% .available-on-backorder span',
'default' => floatval( et_get_option( 'body_font_height', '1.7' ) ) . 'em',
'margin_padding' => array(
// Don't add text-shadow fields since they already are via font-options.
$this->custom_css_fields = array(
'label' => esc_html__( 'In Stock Text', 'et_builder' ),
'selector' => '.in-stock',
'outofstock_text' => array(
'label' => esc_html__( 'Out of Stock Text', 'et_builder' ),
'selector' => '.out-of-stock',
'backorder_text' => array(
'label' => esc_html__( 'On Backorder Text', 'et_builder' ),
'selector' => '.available-on-backorder',
$this->help_videos = array(
'name' => esc_html__( 'Divi WooCommerce Modules', 'et_builder' ),
public function get_fields() {
'product' => ET_Builder_Module_Helper_Woocommerce_Modules::get_field(
'default' => ET_Builder_Module_Helper_Woocommerce_Modules::get_product_default(),
'computed_affects' => array(
'product_filter' => ET_Builder_Module_Helper_Woocommerce_Modules::get_field(
'computed_affects' => array(
'computed_callback' => array(
'ET_Builder_Module_Woocommerce_Stock',
'computed_depends_on' => array(
'computed_minimum' => array(
* @param array $args Additional arguments.
public static function get_stock( $args = array() ) {
$args = wp_parse_args( $args, $defaults );
$rating = et_builder_wc_render_module_template(
* Renders the module output.
* @param array $attrs List of attributes.
* @param string $content Content being processed.
* @param string $render_slug Slug of module that is used for rendering output.
public function render( $attrs, $content = null, $render_slug ) {
ET_Builder_Module_Helper_Woocommerce_Modules::process_background_layout_data( $render_slug, $this );
$this->add_classname( $this->get_text_orientation_classname() );
$output = self::get_stock( $this->props );
// Render empty string if no output is generated to avoid unwanted vertical space.
return $this->_render_module_wrapper( $output, $render_slug );
new ET_Builder_Module_Woocommerce_Stock();