Please share your store URL and password.
So that I will check and let you know the exact solution here.
This is an accepted solution.
Need for code structure changes.
Could you kindly DM me so that we can discuss further on it.
And else you can get connected with me on email@example.com so that I can assist you further in your requiremennt Thanks!