• Resolved Francisco

    (@fmarconi)


    Hi! I really like your theme.
    I would like to filter my woocommerce checkout page title. When the title design is “In content” I can use “the_title” filter easily. But when I choose “Above content” page title things get complicated: the filter no longer works because the page title goes through kadence_entry_hero action and then kadence_entry_header function and finnaly render_title function and from there on I don’t understand the trace.
    ?Can you help me?

Viewing 4 replies - 1 through 4 (of 4 total)
  • hannah

    (@hannahritner)

    Hey,
    Thanks for reaching out! Would you mind posting a link so I can see how you have things set up?

    Thanks,
    Hannah

    Thread Starter Francisco

    (@fmarconi)

    Hi, Hannah,
    I’m working in this site.
    It works with quotation, not selling directly. So in the WooCommerce thank you page I need the title to be “Quotation received”.
    But then, when the client got the answer for the quotation with prices by mail, they are redirected to the order pay endpoint and after that to the thank you page again, but this time the title has to be the default “Order received”.
    To do so, I’ve added a simple conditional filter for the title:

    add_filter( 'the_title', 'titulos_cotizaciones', 10, 2 );
    function titulos_cotizaciones($title, $post_id)
    {
    	if (is_checkout() && in_the_loop())
    	{
    		if (cart_contains_quotable()) return 'Finalizar Cotización';
    		elseif (orden_recibida_estado()=='pending')	return 'Solicitud de cotización enviada';
    		elseif (!empty(orden_recibida_estado())) return 'Pago realizado';
    	}
    	return $title;
    }

    This works with the Kadence apperance setting Page design -> title set to “In content”.
    So far, so good.

    The issue is when I change this setting to “Above the content” the code no longer works.

    That’s it,
    Thanks

    • This reply was modified 3 years ago by Francisco. Reason: links instead of thumbnails
    Thread Starter Francisco

    (@fmarconi)

    Hi! I resolved the issue. In order to target the page title and not the nav menu items titles I was checking if we are in_the_loop(), this have been working for me so far, but for some reason the above-content title returns false as opposed to in-content title, so I’ve change it and now I check instead if wc_get_page_id( ‘checkout’ ) === current page id.
    Kind regards.

    hannah

    (@hannahritner)

    Glad you were able to resolve this! Let us know if there’s something else we can help you with.

    Kindly,
    Hannah

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hero page title’ is closed to new replies.