Tagged: woocommerce
-
AuthorPosts
-
June 3, 2014 at 10:12 am #273800
I found at Woothemes docs for displaying sale products this shortcode:
array( 'per_page' => '12', 'columns' => '4', 'orderby' => 'title', 'order' => 'asc' )
How about if I place this in Enfold Child functions.php or is this the wrong place? What I like is, having only one sale product on homepage, but per default, woocommerce has a four column layout for that activated. I need to overwrite this. So my question were to place this? In case, best will be as AVIA element, were I can select options!
Thanks, Adrian
June 3, 2014 at 10:28 am #273803Update: There is a simple shortcode for placing inside post/page
[sale_products per_page="1" columns="1"]
but this doesn’t work as expected. Seems, that for sale_products the columns parameter doesn’t work. It shows up in the html code, but still as four columns, which makes the product very small.
June 3, 2014 at 12:12 pm #273825Hi!
You can try to insert this code into the functions.php file
add_action('wp_head','avia_change_column_count'); function avia_change_column_count(){ global $avia_config, $woocommerce_loop; if(is_shop() || is_product_category()){ $woocommerce_loop['columns'] = $avia_config['shop_overview_column']; }else{ $avia_config['shop_overview_column'] = $woocommerce_loop['columns']; } remove_filter( 'loop_shop_columns', 'avia_woocommerce_loop_columns'); add_filter( 'loop_shop_columns', 'avia_woocommerce_loop_columns_custom'); } function avia_woocommerce_loop_columns_custom($count) { global $avia_config; if(is_shop() || is_product_category()) return $avia_config['shop_overview_column']; return $count; }
It will modify the standard function a bit and return the theme columns value (WooCommerce > Einstellungen > Produkte > “Column Count”) only on the shop and archive pages. The shortcodes should use the columns value you specified.
Best regards,
PeterJune 3, 2014 at 12:17 pm #273827Thanks, danke, merci.
-
AuthorPosts
- The topic ‘Sales products in AVIA’ is closed to new replies.