- This topic has 9 replies, 2 voices, and was last updated 2 years, 1 month ago by
Sangita Support Squad.
-
AuthorPosts
-
-
December 12, 2023 at 2:25 AM #215042
webmaster.mid
ParticipantHello,
Please, add this condition “$dashboard_link &&” to this function as shown in the image below:
https://imgur.com/HimjRfe.pngIf the link is empty (I’m not using AFM), it is returning as if it were the vendor dashboard page.
-
December 12, 2023 at 12:02 PM #215054
Sangita Support Squad
Keymaster@webmaster.mid Can you please let us know about the flow that you are looking for on your end so that we can assist you accordingly with the code.
-
December 12, 2023 at 12:02 PM #215055
Sangita Support Squad
KeymasterThis reply has been marked as private. -
December 12, 2023 at 7:48 PM #215088
webmaster.mid
ParticipantHello Sangita. Our license has not expired. We placed the order on September 30, 2023.
About our flow: We have a custom dashboard for vendors, so we don’t use yours. Thus, when checking if the user is on the vendor’s dashboard page and this page does not exist (or is not defined in the MVX settings), the function incorrectly returns true, as if it were the vendor’s dashboard page. I added a condition to check if it isn’t empty (see image).
In my case, as this function returned true, MVX removed all scripts inserted by theme from the queue and should not behave this way.
-
December 13, 2023 at 1:21 PM #215128
Sangita Support Squad
KeymasterHello @webmaster.mid, As you have added your own custom vendor dashboard and not using our default one, so our code shouldn’t affect your custom flow.
However it is still unclear what flow you are exactly looking for your custom page. A detailed flow will guide us what are you expecting so we can assist you with this.
-
December 19, 2023 at 12:34 AM #215267
webmaster.mid
ParticipantHello Sangita.
Ok, a more detailed flow:
We have our custom dashboard that replaces wp-admin for vendors and vendor staffs. However, they still have access to the front of our website when logged in. When they go to the front, all the JS files registered by our theme disappear because the MVX filter ‘mvx_frontend_enqueue_scripts’ is removing them.What is the function of this filter?
It checks if the user is located in the vendor dashboard and, if yes, it removes all added scripts by theme. Ok, makes sense.Why does the filter remove them even when the user is not in the vendor’s dashboard?
When MVX checks if the user is on the vendor’s dashboard, it returns true because the “Vendor Dashboard Field” in the MVX settings is empty or has been set to a page that no longer exists. It should return false.Solution
When checking, the code must consider whether the page actually exists or whether the field is defined in the MVX Settings.
That’s what I suggested in the last messages.Test it:
Delete the Vendor’s Dashboard page completely and go to the front logged as a Vendor. -
December 19, 2023 at 1:54 PM #215276
Sangita Support Squad
KeymasterAs per our code the above mentioned hook will only work for the My account page, vendor dashboard page and for users having the ‘vendor’ role.
Now on your custom page this should not work and remove the added scripts from your custom page if the custom code for your custom page does not match with any of the conditions mentioned.
Also if you want you can just remove the hook by doing remove action on your end and it will no longer affect your custom flow. -
December 26, 2023 at 6:08 PM #215469
webmaster.mid
ParticipantHello Sangita.
I’m spending a lot of time trying to help, even though I’ve already resolved it on my end. I won’t continue here after this comment…
I’m also a developer and, regardless of the scenario and the conditions to be met, you need to check if the field is set to a value to check “is_vendor_dashboard_page”, the rest of the conditions are not important.It’s simple: is it the vendor’s dashboard page? If it is not defined in the MVX settings, it is not. And your code is returning as if it were.
-
December 26, 2023 at 6:26 PM #215470
Sangita Support Squad
Keymaster@webmaster.mid I’ll communicate this to my developers regarding this.
However, could you please share a video demonstrating your user interface and explaining the flow? This will help us better understand it and provide the necessary assistance. -
February 26, 2024 at 5:37 PM #217552
Sangita Support Squad
KeymasterIt’s been long and we have not heard back from you. We are closing this thread. If you need any help or face issue in future please do create a new support topic.
-
-
AuthorPosts
- The topic ‘Validate if dashboard link exists to check if it’s vendor dash page’ is closed to new replies.






