option_generate_woocommerce_settings

The option_generate_woocommerce_settings filter allows you to filter the options in our WooCommerce add-on.

These options are all available in the customizer. The filters allow you to change the setting under certain conditions.

Available Options

Return Value

$options[‘cart_menu_item’]

Adds a cart icon with the total price of your items in your primary navigation.

'true'
'false'

$options[‘breadcrumbs’]

Display WC breadcrumbs.

'true'
'false'

$options[‘columns’]

Set the number of columns to display your products on desktop.

'5' //Between 1-6

$options[‘tablet_columns’]

Set the number of columns to display your products on tablet.

'4' //Between 1-4

$options[‘mobile_columns’]

Set the number of columns to display your products on mobile.

'2' //Between 1-3

$options[‘product_archive_image_alignment’]

Set the alignment of product image.

'left'
'center'
'right'

$options[‘products_per_page’]

Choose how many products to display on each page.

'20'

$options[‘product_archive_alignment’]

Set the alignment of product title.

'left'
'center'
'right'

$options[‘shop_page_title’]

Display the “Shop” page title.

'true'
'false'

$options[‘product_results_count’]

Display the results count.

'true'
'false'

$options[‘product_sorting’]

Choose to sort the products or not.

'true'
'false'

$options[‘product_archive_image’]

Display the product image.

'true'
'false'

$options[‘product_secondary_image’]

Display the second product image when hover over the primary image.

'true'
'false'

$options[‘product_archive_title’]

Display the product title.

'true'
'false'

$options[‘product_archive_sale_flash’]

Display the product sales badge.

'true'
'false'

$options[‘product_archive_sale_flash_overlay’]

Display the sale flash on top of the image or under product title.

'true'
'false'

$options[‘product_archive_rating’]

Display the product ratings.

'true'
'false'

$options[‘product_archive_price’]

Display the product price.

'true'
'false'

$options[‘product_archive_add_to_cart’]

Display the add to cart button.

'true'
'false'

$options[‘product_archive_description’]

Display the short description below the product title.

'true'
'false'

$options[‘product_tabs’]

Display tabs which hold the item description, reviews, specs etc..

'true'
'false'

$options[‘product_related’]

Display products related to the currently viewed item.

'true'
'false'

$options[‘product_upsells’]

Display upsells products.

'true'
'false'

$options[‘related_upsell_columns’]

Choose how many columns to show our related/upsell products on desktop.

'3' //Between 1-6

$options[‘mobile_related_upsell_columns’]

Choose how many columns to show our related/upsell products on mobile.

'3' //Between 1-3

$options[‘product_meta’]

Display meta for the current product (category, SKU etc..)

'true'
'false'

$options[‘product_description’]

Display short description below the product title.

'true'
'false'

Example

If we want to use columns for a certain category:

add_filter( 'option_generate_woocommerce_settings','lh_custom_category_wc_columns' );
function lh_custom_category_wc_columns( $options ) {
    if ( is_product_category( 'CATEGORY-HERE' ) ) {
        $options['columns'] = 2;
    }
    
    return $options;
}