Product Category Does not update Tab title

Using Airi theme with woocommerce is giving an awkward sort of error.
On the product-category page, when we select a new category, the url, page title and products change however the tab title remains that of the previous category. This will remain unless the page is refreshed which then loads the entire page with the correct tab title.

Now we can make a script that updates document.title with the correct names but that is just forcing it. That and the fact that it does not work after one click which is annoying as heck.

https://wisewellusa.com is the site.

Hello there,

I am sorry, I couldn’t experience the issue you have mentioned. See the below screencast.

Perhaps I tested it incorrectly?

Regards,
Kharis

1 Like

Hi there. Thanks for checking my problem out.

The issue can be experienced when selecting the sidebar product category.
When selecting the sidebar option, about 3 or 4 different ajax requests are triggered, to get the url, page title , product contents and shifting the focus to the product.

Now what i observed was that the things did change but when i used inspect element, the content of the previous page remained. This was solved on refreshing the page but that is definitely not the solution.

The workaround i have made so far is that luckily, window.location.href gives the correct url. I dequeued the javascript from parent theme to child theme and customized the functionality that will retreive the title tag of the url via another ajax call and that gives the correct thing back. It has a little delay but gives the right thing back.

Hello there,

Thank you for adding some extra details. I tried the product filter on sidebar and everything seems to be working fine.

I feel it’s an inconsistent issue. Perhaps it’s related to web browser’s issue at your end? Check its version and ensure you’re running the latest.

Regards,
Kharis

1 Like

Yes it works now. But inspect element your page and look at the section. What i did was issue another command to get a og:title content from the meta however the meta belongs to the previous page. That is still an issue which is wierd.

That and in your last gif, do check the slight delay in the tab title. It should not be that slow.

Hello there,

How did you enable AJAX effect on product category widget? I would like to reproduce and debug it on my test site.

Regards,
Kharis

in the airi parent theme, we have a file called app.js in the folder assets/js/min/app.js
I copied the same path to the child theme.
I dequeued the parent script called ‘airi theme’ and enqueued the child script. Now we should get the basic working back.
In app.js , first unminify the js file fir ease and find this snippet

a(".la-ajax-shop-loading").removeClass("loading")

right after this statement i added

jQuery.get(window.location.href, function(t) {
                        document.title = jQuery(t).filter('meta[property="og:title"]').attr("content")
})

And presto, with a little delay, it works.