Enhance Your WooCommerce My Account Page with Wishlist, Special Offers, and Buy Again Features

Creating a personalized My Account experience is a powerful way to increase customer engagement and drive repeat purchases. In this post, we’ll walk you through a custom plugin that adds three exciting features to your WooCommerce My Account page:

  • Buy Again: Displays a grid of products your customer has previously purchased, allowing them to repurchase with a single click.
  • Wishlist: Lets customers add products to their wishlist via AJAX, with a dedicated grid view for easy management.
  • Special Offers: Showcases on-sale products and dynamically generates a unique, one‑time 5% discount coupon for logged‑in users.

Below, we’ll share the PHP code for the plugin and also include the JavaScript and CSS code that powers the interactive and visual elements of the My Account page.

WordPress Plugin Development

Transform your business website with our expert WordPress development services. Our team of specialists will unlock your site’s full potential, driving better performance, engagement, and conversions. Let us help you create a seamless, high-performing website that delivers results.


Plugin PHP Code

This is the main plugin code that registers our custom My Account enhancements. It uses best practices for escaping, localization, and WordPress coding standards.


JavaScript Code

The JavaScript (located in assets/js/custom-my-account.js) handles the AJAX requests for adding and removing products from the wishlist. Here’s an example:


CSS Code

The CSS (located in assets/css/custom-my-account.css) styles the grid layouts, buttons, and sections for a polished look. For example:


Conclusion

By integrating the PHP, JavaScript, and CSS code provided above, you can transform your WooCommerce My Account page into an engaging space where customers can easily repurchase, manage their wishlist, and take advantage of exclusive discount offers. This plugin not only enhances the user experience but also encourages repeat business with minimal effort.

Feel free to modify and extend the code to best suit your store’s branding and promotional strategies. Happy coding and may your sales soar!

Leave a Reply

Your email address will not be published. Required fields are marked *