Tagged: ajax, my account, tabs, woocommerce
-
AuthorPosts
-
August 27, 2021 at 12:59 am #1318521
Hello,
Not sure if this is possible, but I have customized the WooCommerce My Account page a little bit by hiding the Woocommerce Tabs and adding Icons as menu tabs instead. This all works great and looks much better than the standard WooCommerce layout (in my opinion).
My Account Page:
However, I was curious if it would be possible to enable AJAX loading to switch between the account tabs more seamlessly, it would also be great to have the tab illuminated in some way to reflect which page you are currently on.
What the page currently looks like:
https://snipboard.io/vm3ErI.jpgWhat I would (roughly) like it to look like:
https://snipboard.io/soVDk1.jpgAny advice on this would be greatly appreciated!
- This topic was modified 3 years, 2 months ago by ihawkr14.
August 30, 2021 at 6:07 am #1318910Hey ihawkr14,
Thank you for the inquiry.
The plugin automatically applies unique class names to the body tag for each account subpage, e.g. woocommerce-payment-methods for the payment method page, woocommerce-billing-address for the billing address page, so on and so forth. You can use those class names to adjust the style of an icon or link when viewing a corresponding sub page.
.woocommerce-payment-methods .avia-icon-list li:nth-child(3) .iconlist_icon { background: orange; }
The code above should adjust the background color of the third icon in the list when viewing the payment methods page. For the billing address, this should work.
.woocommerce-billing-address .avia-icon-list li:nth-child(1) .iconlist_icon { background: orange; }
We could also create a custom script that checks for the current page and apply a background to the corresponding link, but that would a bit more complicated.
Best regards,
IsmaelAugust 30, 2021 at 5:44 pm #1319005Hi Ismael,
Pardon my ignorance, but where should I put these codes? I have tried Snippets(we don’t have a child theme), Custom CSS under Appearances > Customize, as well as Custom CSS under the element settings as well and haven’t been able to get this to work..
Really appreciate your patience!
September 2, 2021 at 8:16 am #1319448Hi,
Thank you for the update.
You can add the code in the Enfold > General Styling > Quick CSS field, or in the child theme’s style.css file, whichever you prefer. You may need to toggle or temporarily disable the Enfold > Performance > File Compression settings after adding the css. Please note that the css above will only adjust the style of first and third icon, in the billing and payment pages, respectively. You have to add more css just like those to adjust the style of the other icons.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.