Hey,
Thanks for reaching out! Would you mind posting a link so I can see how you have things set up?
Thanks,
Hannah
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, 10 months ago by
Francisco. Reason: links instead of thumbnails
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.
Glad you were able to resolve this! Let us know if there’s something else we can help you with.
Kindly,
Hannah