{"id":2273,"date":"2023-12-04T23:09:08","date_gmt":"2023-12-04T23:09:08","guid":{"rendered":"https:\/\/www.antpace.com\/blog\/?p=2273"},"modified":"2025-08-25T17:33:17","modified_gmt":"2025-08-25T17:33:17","slug":"case-study-how-we-fixed-a-woocommerce-website-for-a-new-client","status":"publish","type":"post","link":"https:\/\/www.antpace.com\/blog\/case-study-how-we-fixed-a-woocommerce-website-for-a-new-client\/","title":{"rendered":"Case Study: Fixing a WooCommerce Website for a New Client"},"content":{"rendered":"<p>I met Steven at his store on Bloomfield Avenue in Northern New Jersey. After I gave him my business card he told me his website needs help. The checkout wasn&#8217;t working, and users couldn&#8217;t even add products to their cart. This was how the previous web development vendor left things before their arrangement ended.<\/p>\n<p>The website was powered by WordPress (managed by Bluehost), and used WooCommerce as its ecommerce solution. I helped him create a Stripe account, and connect it to his online store.\u00a0 I finished configuring a premium WordPress theme called BeTheme, and gave him a multi-week marketing plan to help sales grow.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2351 size-full\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/website-screenshot.png\" alt=\"website screenshot\" width=\"1822\" height=\"910\" \/><\/p>\n<p>I used an image manipulation program (the GIMP) to create graphic assets used throughout the shop:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2350\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/graphic-design-for-a-website.png\" alt=\"website graphic design\" width=\"1341\" height=\"961\" \/><\/p>\n<p>Many times I have to pick up where someone else left off. I could tell you another story about inheriting a Frankenstein tech stack from a previous vendor. They left off on non-talking terms after demanding back work payments to release the credentials to my team. My skill in figuring things out, regardless of the technology involved, shines in times like these.<\/p>\n<p>My company tag line is &#8220;I can build your website&#8221; &#8211; it should really be &#8220;I can <em>fix<\/em> your website&#8221;. Business owners try to do it themselves, and often make it most of the way. When you need help, I am there to carry it over the finish line. I&#8217;ve been asked if services like Wix cuts into my business &#8211; it&#8217;s actually the opposite. Broken, incomplete, or unoptimized websites created on easy-to-use platforms have provided a solid market for my expertise.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2299\" style=\"font-size: 1rem;\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/jpeg-optimizer_1000007065.jpg\" alt=\"Organic market\" width=\"3000\" height=\"4000\" \/><\/p>\n<p>Local small businesses are what make neighborhoods unique and give families a chance to make a living themselves. It feels great to help people knowing we can both benefit. You can read more about the plan I use to help businesses with <a href=\"https:\/\/www.antpace.com\/blog\/existing-website-maintenance-audit-enhancement\/\">their existing website in another blog post<\/a>.<\/p>\n<h2>Membership Discounts Without a Plugin<\/h2>\n<p>As part of the marketing plan, we decided to add membership accounts to the WordPress ecommerce website for Organic Sun Market. Enabling that capability was a few settings in the dashboard:\u00a0<em>WooCommerce &gt; Settings &gt; Accounts &amp; Privacy<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2340\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/accounts-and-privacy.png\" alt=\"woocommerce accounts and privacy settings\" width=\"1122\" height=\"619\" \/><\/p>\n<p>I also added a &#8220;My Account&#8221; link to the site&#8217;s global navigation.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2344\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/menu-nav.png\" alt=\"menu in wordpress\" width=\"916\" height=\"606\" \/><\/p>\n<p>By default, WooCommerce provides a &#8220;My Account&#8221; page where users can log in, view their orders, update their information, and more. You can specify a custom page in the advanced settings:\u00a0<em>WooCommerce &gt; Settings &gt; Advanced<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2341\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/advanced-settings.png\" alt=\"woocommerce advanced setting\" width=\"1045\" height=\"483\" \/><\/p>\n<p>The account page specified uses a WooCommerce short code to handle the content:\u00a0<em>[woocommerce_my_account]<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2342\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/account-page-shortcode.png\" alt=\"account page shortcode\" width=\"1062\" height=\"558\" \/><\/p>\n<h3>Change menu text if user is logged into WordPress<\/h3>\n<p>I wanted the &#8220;My Account&#8221; menu text to change if the user is not logged in. I was able to do this with the WordPress hook `wp_nav_menu` and a simple string replacement PHP function:<\/p>\n<pre>add_filter('wp_nav_menu', 'change_my_account_menu_item', 10, 2);\n\nfunction change_my_account_menu_item($nav_menu, $args) {\n\/\/ Check if the user is not logged in\n    if (!is_user_logged_in()) {\n        \/\/ Change \"My Account\" link to \"Login\/Register\"\n        $nav_menu = str_replace('My account', 'Login\/Register', $nav_menu);\n    }\n    return $nav_menu;\n}\n<\/pre>\n<p>To incentivize users to create an account, we offer a 5% discount to any one logged in. The checkout page contains conditional messaging (depending on wether they are logged in or not) to communicate this incentive.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2346\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/conditional-css-messaging-on-checkout.png\" alt=\"conditional css messaging on checkout\" width=\"1547\" height=\"858\" \/><\/p>\n<h3>Hide or show UI elements if user is logged into WordPress<\/h3>\n<p>I am able to apply that\u00a0 style condition with two custom CSS classes, specific to the presence of the WordPress body class &#8216;logged-in&#8217;:<\/p>\n<pre>.only-show-while-logged-in{display: none;}\nbody.logged-in .dont-show-while-logged-in{display:none;}\nbody.logged-in .only-show-while-logged-in{display:block;}\n<\/pre>\n<h3>Apply WooCommerce discount to logged in users<\/h3>\n<p>I applied the discount by using custom PHP code in the child theme&#8217;s functions.php file with the `woocommerce_before_calculate_totals` hook:<\/p>\n<pre>add_action( 'woocommerce_before_calculate_totals', 'no_discount_if_not_logged_in', 10, 1);\nfunction no_discount_if_not_logged_in( $cart ) {\n\tif (is_user_logged_in()) {\n\t\tforeach ( $cart-&gt;get_cart() as $cart_item ) {\n\t\t\t$discount_eliminate = $cart_item['data']-&gt;get_regular_price();\n\t\t\t$discount_percentage = 5; \/\/ Set your desired discount percentage\n\t\t\t$discount_amount = $discount_eliminate * ($discount_percentage \/ 100);\n\t\t\t$new_price = $discount_eliminate - $discount_amount;\n\n\t\t\t$cart_item['data']-&gt;set_price($new_price);\n\t\t}\n\t}\n}\n<\/pre>\n<h3>Apply WooCommerce discount to logged in users on a specific category of products<\/h3>\n<p>Later, we changed the logic to be a 10% discount for logged-in members, but only on products that were part of a specific category called &#8220;bundles&#8221;.<\/p>\n<pre>add_action( 'woocommerce_before_calculate_totals', 'discount_for_specific_category', 10, 1);\n\nfunction discount_for_specific_category( $cart ) {\n    if ( is_user_logged_in() ) {\n        \/\/ Define the category slug you want to apply the discount to\n        $target_category = 'bundles';\n\n        foreach ( $cart-&gt;get_cart() as $cart_item ) {\n            $product_id = $cart_item['product_id'];\n\n            \/\/ Check if the product belongs to the target category\n            if ( has_term( $target_category, 'product_cat', $product_id ) ) {\n                $discount_eliminate = $cart_item['data']-&gt;get_regular_price();\n                $discount_percentage = 10; \/\/ Set your desired discount percentage\n                $discount_amount = $discount_eliminate * ( $discount_percentage \/ 100 );\n                $new_price = $discount_eliminate - $discount_amount;\n\n                $cart_item['data']-&gt;set_price( $new_price );\n            }\n        }\n    }\n}\n<\/pre>\n<h2>Print Design<\/h2>\n<p>Many local small businesses take their marketing offline and into the real world. Print marketing is a business I have been a part of for almost two decades. I have designed, delivered, and distributed flyers, menus, business cards and more. As the holiday season approached, Steven asked me to create a poster for one of his healthy products.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2359\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/graphic-design-request.jpg\" alt=\"graphic design request via text message\" width=\"1080\" height=\"2316\" \/><\/p>\n<p>He sent me a draft he has been working on, along with some inspiration examples that expressed the direction he wanted things to go. This was the final product:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2286\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/dog-treats.png\" alt=\"Dog treats poster\" width=\"500\" height=\"647\" \/><\/p>\n<p>And here it is hanging in the store front:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2300\" src=\"https:\/\/www.antpace.com\/blog\/wp-content\/uploads\/2023\/12\/jpeg-optimizer_1000007064.jpg\" alt=\"Printed poster design \" width=\"3000\" height=\"4000\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I met Steven at his store on Bloomfield Avenue in Northern New Jersey. After I gave him my business card he told me his website needs help. The checkout wasn&#8217;t working, and users couldn&#8217;t even add products to their cart. This was how the previous web development vendor left things before their arrangement ended. The &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.antpace.com\/blog\/case-study-how-we-fixed-a-woocommerce-website-for-a-new-client\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Case Study: Fixing a WooCommerce Website for a New Client&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3118,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3,5],"tags":[43,128,142,143],"class_list":["post-2273","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-design","category-marketing","category-web-development","tag-ecommerce","tag-stripe","tag-woocommerce","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts\/2273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/comments?post=2273"}],"version-history":[{"count":1,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts\/2273\/revisions"}],"predecessor-version":[{"id":3190,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/posts\/2273\/revisions\/3190"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/media\/3118"}],"wp:attachment":[{"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/media?parent=2273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/categories?post=2273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antpace.com\/blog\/wp-json\/wp\/v2\/tags?post=2273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}