1. Home
  2. Docs
  3. WooCommerce Order Builder
  4. Actions and Filters
  5. wwob_change_product_items_display

wwob_change_product_items_display

Use this filter to completely alter how items are displayed on the product page.

The follow example will change display and render items without image.

[enlighter lang=”php”]
add_filter( ‘wwob_change_product_items_display’, ‘change_product_display’, 5, 10 );
function change_product_display($content, $field, $form_id, $field_id, $i){

$one = 1;
$zero = 0;

$one++;
$zero++;

$item_container_padding = wwob_get_option( ‘item_container_padding’ ) ? wwob_get_option( ‘item_container_padding’ ) : “20”;

$field_label = !empty($field[‘wwob_field_label’]) ? $field[‘wwob_field_label’] : “Product “.$one;
$requiredornot = !empty($field[‘wwob_field_isRequired’]) ? $field[‘wwob_field_isRequired’] : “”;
$placeholder_max_input_select = !empty($field[‘wwob_field_maxSelect’]) ? $field[‘wwob_field_maxSelect’] : “”;
$placeholder_min_input_select = !empty($field[‘wwob_field_minSelect’]) ? $field[‘wwob_field_minSelect’] : “”;
$quanitity = !empty($field[‘wwob_field_quantity’]) ? $field[‘wwob_field_quantity’] : “”;
$quota = !empty($field[‘wwob_field_quota’]) ? $field[‘wwob_field_quota’] : “”;
$description = !empty($field[‘wwob_field_description’]) ? $field[‘wwob_field_description’] : “”;
$additional_field = !empty($field[‘wwob_field_additional_field’]) ? $field[‘wwob_field_additional_field’] : “”;

$requiredornot1 = “*“;
$requiredornot2 = !empty($requiredornot) ? $requiredornot1 : ”;

$disable_images = get_post_meta( $form_id, ‘wwob_disable_images’, true );

$content= “”;
$content .= ‘

  • ‘;
    $content .= “
  • “;

    return $content;
    }
    [/enlighter]

    Placement

    This code should be placed in the functions.php file of your active theme.

    Note

    This filter should only be used to make a major adjustment to items display. If you’re looking to add extra data to your items, use the available actions instead.