Home Forums WoodMart support forum Child theme search template

Child theme search template

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #550106

    admin-8893
    Participant

    Hi I have installed global cart and global search plugin cause I have multisite network so I can search all products of my 3 sites also in child site as woodamart

    the devloper of global cart has modified the search template in inc/modules/search.php adding few line of code that u can see here
    https://wpglobalcart.com/documentation/loop-though-the-cart-items/

    so the developer of global cart said this:

    “Hi,
    For the file \wp-content\themes\woodmart\inc\modules/search.php see lines 544 and 562
    Also the \wp-content\themes\flatsome\inc\extensions\flatsome-live-search/flatsome-live-search.php lines 165 and 188

    Please check with the theme support on how these files can be overwritten from the child theme.

    Can u tell me how can I have in child theme my custom search.php I have copied in Child theme directory copy also the directory structure inc/modules/search.php but not work

    I attach the file search.php edited by global cart u can check from line 544 to 562

    Thx

    Jack

    #550227

    Luke Nielsen
    Keymaster

    Hello,

    Just copy the function itself to the functions.php file in your child theme and recheck the issue.

    https://prnt.sc/u6go5AY6CGQf

    Kind Regards

    #550385

    admin-8893
    Participant

    hi I have added the code: `function woodmart_ajax_suggestions() {
    add_action ( ‘wp_ajax_woodmart_ajax_search’, ‘woodmart_ajax_suggestions’, 10 );
    add_action ( ‘wp_ajax_nopriv_woodmart_ajax_search’, ‘woodmart_ajax_suggestions’
    , 10 );
    }`

    but still stuck
    I want to avoid the loop in main theme search.php file as it now

    while ( $results->have_posts() ) {
    				$results->the_post();
                    do_action( 'woocommerce/cart_loop/start', $post );
    				if ( $post_type == 'product' && woodmart_woocommerce_installed() ) {
    					$product = $factory->get_product( get_the_ID() );
    
    					$suggestions[] = array(
    						'value' => html_entity_decode( get_the_title() ),
    						'permalink' => get_the_permalink(),
    						'price' => $product->get_price_html(),
    						'thumbnail' => $product->get_image(),
    						'sku' => $product->get_sku() ? esc_html__( 'SKU:', 'woodmart' ) . ' ' . $product->get_sku() : '',
    					);
    				} else {
    					$suggestions[] = array(
    						'value' => html_entity_decode( get_the_title() ),
    						'permalink' => get_the_permalink(),
    						'thumbnail' => get_the_post_thumbnail( null, 'medium', '' ),
    					);
    				}
                    do_action( 'woocommerce/cart_loop/end', $post );
    			}

    I need all in child theme how I can do that?

    #550595

    Luke Nielsen
    Keymaster

    Hello,

    Please send me access to the admin panel so I can check your child theme.

    Thank you in advance.

    Kind Regards

    #550605

    admin-8893
    Participant

    Hi here below the admin access

    #550727

    Luke Nielsen
    Keymaster

    Hello,

    Please explain how access to the Theme File editor: https://prnt.sc/tZUNUQ2e2LBK

    Thank you for your time.

    Kind Regards

    #550730

    admin-8893
    Participant

    sorry is multisite network use SFTP credential below

    #551147

    Luke Nielsen
    Keymaster

    Hello,

    You need to copy the full function woodmart_ajax_suggestions. https://prnt.sc/uMZHRcVfIVti . In this screenshot I just hid a part of the function – https://prnt.sc/u6go5AY6CGQf but you need to copy it fully – https://prnt.sc/PouZ7pVYOnu1 and paste the changes that the plugin support mentioned.

    Thank you for your time.

    Kind Regards

    #551247

    admin-8893
    Participant

    ok thx u now works

    #551378

    Luke Nielsen
    Keymaster

    Hello,

    You are welcome! In case you need any additional help, I’d be more than happy to assist you.

    Wish you all the best.

    Kind Regards

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Child theme search template’ is closed to new replies.