-
-
- How can I change the amount of products displayed by page on the shop page. It is currently set to 12 and I would like to show 20.
- Is there a way to use a load more button and get more products to load as you scroll down?
- How can I change the layout to display in 3 columns with a sidebar like it is on this demo https://codeless.co/specular/default/?post_type=product
- On the product detail page, is there a way to add extra tabs (Description, Additional information, Reviews (0), Delivery, Return Policy)
- On the reviews, how can I make the older reviews go on the bottom and the new on the top
Thank you so much for helping
-
Hello,
1-There isn’t an option for this. You need to edit theme files. Open file functions-woocommerce.php, find this line(79):
add_filter('loop_shop_per_page', create_function('$cols', 'return 12;'), 20);
Change number 12 to your wish and save changes. That is the value of products displaying in shop page.
2-Sorry but this is not possible with theme options. Changing it requires coding that is not included in support.
3-You need to set page layout with sidebar. Go to Specular > Layout > Pages Default Layout (screenshot), select with sidebar. After this, go to Appearance > Widgets and add widgets to “Sidebar Woocommerce”
4-You need to edit woocommerce plugin code to add more tabs. Or use some plugin to help with that. Such as:
https://wordpress.org/plugins/yikes-inc-easy-custom-woocommerce-product-tabs/
https://wordpress.org/plugins/woocommerce-product-tabs/5-Check this article regarding this: https://silicondales.com/tutorials/wordpress/reverse-date-order-of-woocommerce-reviews-show-newest-oldest-first/
Best regards!
-
Hi there,
I neglect to mention that I am using a child theme, so this is the code I am using but it is not working. It is my understanding that I have to declare WooCommerce Theme Support, which I did but I am not sure if it is correct.
<?php function child_enqueue_scripts() { wp_register_style( 'childtheme_style', get_stylesheet_directory_uri() . '/style.css' ); wp_enqueue_style( 'childtheme_style' ); } add_action( 'wp_enqueue_scripts', 'child_enqueue_scripts'); // woocommerce support function mytheme_add_woocommerce_support() { add_theme_support( 'woocommerce' ); } add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' ); // Change the add to cart button INTO View Product button add_filter( 'woocommerce_loop_add_to_cart_link', 'add_product_link' ); function add_product_link( $link ) { global $product; echo 'get_permalink( $product->id ).'" class="button">' . __('View Product', 'woocommerce') . ''; } // Change number of products displayed per page on shop page add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 ); function new_loop_shop_per_page( $cols ) { $cols = 20; return $cols; } ?>
Thank you!
All the other fixes worked perfectly.
- This reply was modified 5 years ago by Mirela. Reason: code
-
Hello,
You have an error in this line:
echo 'get_permalink( $product->id ).'" class="button">' . __('View Product', 'woocommerce') . '';
It should be like this:
echo get_permalink( $product->id ).' class="button">'. __('View Product', 'woocommerce') .'';
Let us know.
Best regards! -
I made the change you suggested, which was to change the add to cart button to view product and it broke the button and also the products didn’t get to display 20 but still the same 12.
https://www.dropbox.com/s/5h3dhpndgwpzywp/Screen%20Shot%202019-03-08%20at%2011.24.36%20AM.png?dl=0
-
Hello,
Sorry for the late reply.
This can not be changed in child theme. I can’t really tell why. We will investigate it and let you know what we find. For now i have changed it in the parent theme functions-woocommerce.php file.Best regards!
-
Thank you so much for taking care of this. I will really appreciate it you could keep looking into it, so it can be fixed in the proper way. If not maybe with a plugin so that an update doesn’t break the fix. Keep me posted and thanks again!
-
Hello,
Sure. Let us know if there is anything else we can help you with.
Best regards!
-
You must be logged in to reply to this topic.