Archived topic
Search results page
4 replies · Started by Lukas on July 25, 2022
Hello
When I want to edit the search results page, where do I edit it. I don't like how it is displayed now. And I would like that when it finds products so that there is a button to put in the basket is it possible????
Hi Lukas,
You can use a Block Element - Content Template: https://docs.generatepress.com/article/block-element-content-template/
As for the button, can you give an example of it? Are you referring to “Add to Cart”?
Kindly let us know.
Yes I meant the add to cart button
I see. You can try adding this PHP snippet:
function cart_shortcode($atts, $content = null) {
ob_start();
do_action('hook_cart’);
return ob_get_clean();
}
add_shortcode('portable_cart’, ‘cart_shortcode');
add_action('hook_cart’, 'woocommerce_template_loop_add_to_cart', 10);
Then, you can use shortcode [portable_cart] in your Content Template through a shortcode Block.