Questions tagged [woocommerce]

WooCommerce is a remarkable plugin that seamlessly integrates with WordPress. If you ever have any inquiries regarding its usage, feel free to reach out to their dedicated support team who are always ready to assist you. A significant advantage of WooCommerce is that it operates primarily on an open-source basis, allowing for customization and enhancement possibilities. Should you have any queries related to programming aspects involving modifications or extensions of WooCommerce behavior, you are encouraged to raise them as well. However, if your questions pertain to third-party plugins, it is recommended to directly approach the respective plugin's support for prompt assistance.

What is the process for eliminating the message "Hello Member" on the Woocommerce Checkout page?

I've been struggling to remove a certain area on the checkout page without success. I attempted using this CSS code: .avada-myaccount-user-column .username { display:none; } https://i.stack.imgur.com/okFg9.png https://i.stack.imgur.com/GisRQ.png Current ...

Trouble with Woocommerce Checkout: Checkbox for Auto-Product Addition in Cart

Based on Unique Checkbox field that adds a product to the cart on Woocommerce checkout page, I have successfully implemented the following code: It enables customers to add a specific product to their cart by simply checking a checkbox. The AJAX feature dy ...

Refresh shopping cart information using AJAX in WooCommerce

Attempting to implement an AJAX update for the shipping details in my checkout cart... I have set up the necessary function in functions.php function custom_update_shipping() { WC()->cart->calculate_shipping(); echo "hello"; die(); } a ...

`How to Customize Page Titles and Add Content in WooCommerce`

Currently, I am facing a challenge in adding content after the page title and changing the style of the page where all products are displayed in WooCommerce. Unfortunately, I am unsure about the location of the file that needs to be copied to my custom t ...

Enhance your online shopping experience with a personalized touch by incorporating an Ajax add to cart button on

Currently, I am working on customizing the add to cart button on a single product page. After implementing an ajax call solution from LoicTheAztec's post here, I have successfully added the feature. The code works perfectly fine, but now I am faced with t ...

What is the specific method or action hook triggered when a shipping method is changed on the checkout page?

To ensure the address fields are required when a user selects a shipping method other than "local pickup," I need to implement dynamic changes using an action instead of just setting them as optional by default. Currently, I have managed to make the field ...

Query to retrieve WooCommerce products based on category name using MySQL

I need a solution to update products based on their specific category. Currently, I have successfully retrieved the desired results using the following MySQL query: SELECT * FROM wp_posts WHERE post_type = 'product' At present, there are two product cate ...

Having trouble with the alignment of the product grid on Woocommerce with the Wootique theme?

Hey there, I've been facing an issue with the woocommerce product display grid layout. The items keep getting misaligned, with one on a line and the others right next to each other. I attempted to fix it by adding some custom CSS code: .woocommerce ...

How can you customize your WooCommerce add to cart functionality using Ajax to set a unique price for your products?

My current challenge involves adding a product to the cart during checkout through an on_click event. The price of this product is calculated dynamically using an external API, causing it to register with a price of 0 in WooCommerce itself. While I have su ...

Show a personalized field from the product category following the product title in the WooCommerce product loop

On the category creation/edition page, I added a custom field using the following code: // Custom Field for Product Category Creation Page function product_cat_new_field_create_page() { ?> <div class="form-field"> <label for=&quo ...

Show the "Available" notification for WooCommerce variations that do not have Managed Stock enabled

I require assistance for a specific situation. In the context of WooCommerce, when the "Manage Stock" option is enabled for either a simple product or variation, it triggers a notification to display on the product page, as shown in this example. However, ...

Is there a way to display a delivery estimate underneath the product title on a WooCommerce website?

How can I display Estimated delivery days below the product title to inform my customers about their order's arrival date, similar to the example on the page included in the link? I would like it to show varying days depending on the shipping class. ...

Customize WooCommerce Cart Price by Passing Dynamic Price Variables to Custom Price Hook

I've been struggling to pass a dynamically generated custom price stored in a variable to a hooked function within the woocommerce_before_calculate_totals hook in the cart. Unfortunately, my current setup doesn't seem to be working as expected. ...

Open product link in new tab after "endless scroll" in Woocommerce by utilizing ajax functionality

I have successfully configured all product links on my Woocommerce website to open in a new tab. However, I am encountering an issue with endless scroll and ajax where the newly loaded products do not open in a new tab when clicked on. Below is the curren ...

Arrange charges by title in WooCommerce orders and email alerts

Is there a way to sort fees by name instead of the default sorting by price in WooCommerce orders? I was able to successfully sort fees by name on the cart and checkout pages using the code provided in the answer located at Reordering multiple fees differ ...

Conditional display in Woocommerce

I have encountered another issue. I am attempting to perform a category checkup and provide a positive or negative response with my WooCommerce categories. My goal is to exclude the "accessories" category from my shop page, but only include accessories on ...

Contact Company by Sending Email According to Selected Product Dropdown Choice

If a customer selects a specific business option from the dropdown menu on the product page, I want to send the standard WooCommerce Order Confirmation Email to both the site admin and that selected business. Backpack $50 Choose an Option Business First ...

Ensure proper escaping of PHP special characters in Elementor and WordPress integration

I'm attempting to add this code into Elementor's Custom Code section in order to modify the Sale Badge Text on WooCommerce add_filter(‘woocommerce_sale_flash’, ‘edit_sale_badge’); function edit_sale_badge() { return ‘TEXT-GOES-HERE’; ...

Issue: The use of 'ajax' option is restricted for Select2 when connected to an <input> element - Following the update to version 3.1.2

After updating the WooCommerce version to 3.1.2, I encountered an issue while trying to add or edit a variable product. An error message "Uncaught Error: Option 'ajax' is not allowed for Select2 when attached to a element." appears when selecting a product ...

Linking the bridge between Woocommerce Subscription and Account Funds plugins

After purchasing two plugins, Woocommerce Subscriptions and Account Funds, which claim to be compatible in their documentation, I am attempting to create a Simple Subscription product that adds the product price as account funds for the user upon checkout, ...

Woocommerce Dual Column Payment Portal

I prefer a two-column layout for the checkout process on www.narwal.shop/checkout Here is the code I added: /* Large devices (large desktops, 1200px and up) */ @media (min-width: 993px) { /* --------------------- WOOCOMMERCE -------- ...

Using Jquery to add links that open in a new tab

I have a client who runs a WooCommerce WordPress site and they want the product image/link on the category page to open in a new tab when clicked. I have been attempting to use jquery to achieve this with no success. As I am relatively new to jquery, any a ...

Show the Best Deals on Category Pages Using Woocommerce

On my quest to showcase the lowest price on category pages instead of a price range, while still displaying the range on individual product pages, I stumbled upon a solution shared by another user: add_filter('woocommerce_variable_price_html', & ...

Get rid of the add to cart message and modify the button that says "add to cart" on Woocommerce

How can I modify the shopping cart page to remove the "has been added to your cart" text and replace the quantity and add to cart button with a custom button (my image)? Here is an example of what I am trying to achieve: This is the current state of the p ...

Emulate a Click Using Pure JavaScript

I am looking to add a click event to my custom dropdown, which replaces a SELECT element. The purpose of this click event is to trigger the corresponding OPTION item when an LI element is clicked. It seems like Woocommerce uses some JavaScript or PHP func ...

Items arranged in two rows instead of three, exclusively for certain product categories

While working on a website, I encountered the need to display products in 2 rows instead of the default 3 for one specific category. After researching on Stack Overflow and Google, I came across this valuable solution: add_filter('loop_shop_columns', 'loo ...

Modify the address fields settings for Checkout and My Account based on the country in Woocommerce

I've implemented code to adjust checkout address fields for more accurate formats in various countries. The segment that updates the labels for UK and New Zealand states is not functioning properly though. In the UK, the County (optional) field retains i ...

How to implement flexslider on a separate page within your Woocommerce website

I've successfully displayed a product on my homepage using the following shortcode: <?php echo do_shortcode('[product_page id="195"]');?> The product is shown with its main image and small thumbnails below it, and on the right side there i ...

The WooCommerce mini cart fails to refresh after items are added using AJAX

I have successfully implemented adding multiple items with quantities to the cart using AJAX. However, after adding a product, the mini cart is not updating as expected. I am calling WC_AJAX::get_refreshed_fragments() in my function.php and have a hook set ...

Adjust input quantities for product variations in Woocommerce

In my WooCommerce store, I encountered an issue with a variable product that has 3 product variations. Unfortunately, the quantity to sell for each variation needs to be fixed and cannot be adjusted by the customer. For instance: We have 2 Red items ava ...

Notify the user via email when they are on the WooCommerce checkout page and have items in their cart

Is there a way to trigger an email to be sent to the user when they are about to make a purchase at checkout? I tried implementing this code in my functions.php, but it seems to be sending multiple emails in a random manner. I suspect it may be due to the ...

Tips for sending AJAX forms with only certain fields provided

I have a form that allows users to update their account information. I have implemented ajax requests to save changes without refreshing the page. However, I only want to submit certain fields from the form as some are disabled. The code snippet below is w ...

Showcase specific product configurations in the extra details section, including custom field entries

Recently, I customized the WooCommerce product settings by adding custom fields to the shipping tab. Now, my goal is to display these custom fields on the Product page under the Additional Information tab and ensure that they are automatically included in ...

Displaying items in the shopping cart across two separate columns

I have a website located at Within that page, I have included the Cart table using a woocommerce shortcode. Currently, the cart table is positioned below the billing details and payment options section. My goal is to move this cart table to be situated ...

Discover the method of obtaining the post id within an Ajax callback in the Wordpress

Currently, I am using the Add to cart Ajax callback, but I am facing difficulty in retrieving the post Id from it. MY OBJECTIVE: My intention is to apply the add_filter only on a specific page. Here is the PHP code in functions.php file: add_filter( 'wooc ...

Seamless integration of NextJS with Woocommerce backend

I am currently in the process of integrating NextJS with a backend WooCommerce using GraphQL. One thing that I have been pondering is how to reconfigure the setup. Currently, Wordpress/WooCommerce is set up as follows: mywebwoo.com - default WordPress sto ...

Enhance your WooCommerce shopping experience by incorporating a variety of personalized checkout fields organized into two distinct

I have implemented custom code to create unique checkout fields based on the number of products in a customer's cart. Each product requires 4 customized checkout fields, displayed in two columns side by side. The expected result is as follows: co ...

Incorporate a product category on the woocommerce archive/shop page

Attempting to include product category within the product card on the woocommerce archive page. Currently, it displays "Thumbnail," "Title," "Price," and "Add to cart button." Using a function that should work if the variable "product" is set to the curre ...

Tips to position two shortcode elements next to each other horizontally

I have some code here and I am looking to align the two elements at the bottom, "php echo do_shortcode(wcas-search-form);" and "php do_action('hamzahshop_custom_min_cart');" on the same line horizontally. I am new to this and struggling to figure it out. ...

Enhance your Woocommerce experience with real-time cart updates using AJAX

Is there a way to dynamically update the cart content using AJAX when the 'update cart' button is clicked? I've been struggling to get the $fragments function to work properly, as it always returns true. I've also attempted to use WooCommerce hooks, but t ...

If there is a discrepancy between the billing and shipping addresses, it is recommended to put a WooCommerce order on hold

I am looking for a solution to combat fraud on my WooCommerce website. Oftentimes, scammers use automated bots with stolen credit card information to make purchases and have the products shipped to a different address than the billing one. To prevent this, ...

Updating Button Text with PHP on WooCommerce

Hi there, I'm trying to find a way to translate a button in my WooCommerce store without using LocoTranslate or any other tools. Is there a PHP function that can help me change the button text without needing an ID? If you want to take a look at the ...

Arrange WooCommerce products in order using WP Query based on the total number of sales starting from

Is it possible to fetch a list of all products in WooCommerce that have been ordered by their popularity (total sales) starting from a specific date? $args = array( 'post_type' => 'products', 'posts_per_page' => 200 ...

Make alterations to the "Delete" link wording for a WooCommerce coupon on the checkout page

Instead of the standard [Remove] option on the WooCommerce checkout page for removing coupons, I would like to change the text to say [Remove & Re-Calculate]. After trying to implement the code below to make this change, the text was successfully upda ...

Revise tax classification for international customers of the company in WooCommerce

I am currently facing an issue in WooCommerce where I need to set a different tax class for company users with billing addresses outside of Germany. Normally, the tax rate is always 19%, but in this specific case, I require it to be set at 0%. To achieve t ...

Displaying product categories on WooCommerce page for non-registered users

Currently, I am working on a WordPress WooCommerce website and I have encountered an issue. I want to implement a logic where users cannot see product categories, subcategories, or product pages without logging in, and instead be redirected to the login pa ...

Incorporating Social Share Buttons to Enhance User Engagement on Your WordPress E

Looking to enhance my product page by adding social icons right below the 'Add to Cart' button. The product page URL is https://flowersforeveryone.co.za/product/cheerful-orange-tulips/. I already have a 'social menu' set up. How can I ...

Adding a hook to create additional tabs in a product display interface based on specific keywords found in the product title

Is there a way to customize product tabs in WooCommerce by adding them based on a specific word in the product title instead of just tags? add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' ); function woo_new_product_tab( $ ...

Discover an effective method to retrieve selected product categories' order items in the latest version of Woocommerce

Is there a way to retrieve specific order items from a particular product category in Woocommerce? I've thoroughly searched through the Woocommerce documentation, but unfortunately, I haven't found any relevant information. Below is my current code snipp ...

Assistance for WPML Integration with WooCommerce

My website uses multiple languages (English, French, Serbian) with a WooCommerce setup created using the qTranslate plugin. However, I am facing an issue with translating WooCommerce messages such as cart, checkout, and email contents. I was able to solve ...

Learn the steps to update WordPress pagination URLs from sitename.com/pagename/2/ to sitename.com/pagename/?page=2 with ease

I have set my Wordpress site's permalink structure to use the Post name option, resulting in URLs like: http://sitename.com/sample-post/ However, I am encountering an issue when trying to access a page with the "page" argument, such as: http://sitename. ...

Conceal a WooCommerce product from a designated category archive once a certain time frame has elapsed

I recently added a "New Arrival" product category section on my WooCommerce website. I am looking for a way to automatically hide or remove products from the "New Arrival" category after they have been published for 15 days, while still keeping them visibl ...

Enhance your Woocommerce shopping experience by showcasing additional attributes directly on your cart page

I am using Woocommerce along with Woocommerce Bookings, and I am looking to enhance the cart by adding more information once a user has added an item there. Currently, I have the starting date of the booking and its duration displayed with labels. <dl ...

Having trouble with adding a product to your cart after using the add_filter() function in woocommerce_add_to_cart_validation

In my current scenario, a non-logged-in user is restricted to adding only one product to their cart. I have implemented a filter on woocommerce_add_to_cart_validation that seems to be working correctly with $woocommerce->cart->cart_contents_count&g ...

The issue of WooCommerce GraphQL API not returning a comprehensive list of product variations is causing frustration among users

I'm currently working on a project that involves WooCommerce integration with WordPress and utilizing GraphQL to retrieve product variations. One issue I've encountered is that the GraphQL API is only returning 10 out of 12 variations for a speci ...

What is the best way to include personalized notes according to the chosen checkout preferences?

Is there a way to automatically include a personalized message for each order, depending on the payment methods chosen during checkout? The customized note would be displayed as an additional line below the customer's order notes. ...

Numerous Options for Woocommerce Product Templates

I am working on a WordPress website that incorporates WooCommerce for its e-commerce features. Within the website, there are three distinct categories, each with its own template assigned to the products within those categories. So far, I have successfull ...

Unable to access or modify users using the WooCommerce Rest API in PHP 7.4 due to the rest_user_cannot_view restriction

I am currently utilizing the Automattic Client to establish a connection with the wooCommerce Rest API, and most of my requests are functioning as intended. Typically, I make use of the Endpoint wc/v3, but I have switched to wp/v2 because it appears that u ...

Adjust prices of multiple specific products selectively in Woocommerce

After finding code on Stack Overflow to increase the price of a specific product by $10, I encountered an issue when trying to apply this to multiple products. I attempted modifying line 7 of the code snippet: if( $product->get_id() != 87 ) return $pri ...

Retrieve JSON data from a WordPress site that is powered by WooCommerce, using basic authentication

I am in the process of creating an Android application that retrieves product data from a WordPress site. The website has the Woocommerce plugin installed. I have been able to successfully obtain the JSON data using Postman software and basic authenticat ...

Enhancing Efficiency through Leveraging get_post_meta in WordPress

In my WordPress, I have implemented a logic where each CPT shop_order has a post_meta called "luck_number". However, the issue arises when there are more than 1000 sales per post in this CPT. When I try to retrieve the post_meta with get_post_meta inside a ...

Issues with Adding Variable Products to Cart in Woocommerce

Hey there! I've been working on my woocommerce website and have added a variety of products, some single and some variable. The singles are all good to go, but I've run into an issue with the variable ones. Every time I try to add a variable prod ...

refresh shopping cart page when coupons are added or removed in woocommerce

Is there a way to prevent ajax reloading for coupons on the cart page in woocommerce when adding or removing them? I'd like this to be done with a manual page refresh. Any tips on how to achieve this would be greatly appreciated. Thank you! ...

Updating the basket/custom attribute on the cart page of WooCommerce with Product Add-ons

I have been experimenting with updating a custom field on the basket/cart page for each product using WooCommerce Product Add-ons. While I did manage to get a method working as a test, it's not an ideal solution and seems to be quite messy code. Strangely ...

"Unique AJAX feature for manual, customized one-time payment subscriptions for adding items to cart

Hello, I am currently working on manually ajaxing this process: <a href="/cbg-gummies?add-to-cart=55337&convert_to_sub_55337=0" class="testing"> Add to cart </a> The purpose of this is to add a one-time purchase option ...

How to Remove Header Image from New Order Template in Wordpress Woocommerce

I've set a header image for my woocommerce email settings, but I only want it to display in some emails and not others. Does anyone know how I can achieve this, specifically for the 'new order' notification? ...

Prevent image swapping when selecting variations in Woocommerce

Can the image change be disabled when selecting a variation for a variable product? I understand that I could remove the image from the variation, but in my situation, I need to keep the variation images. Any assistance would be greatly appreciated. ...

"Mastering the Art of Combining Two AJAX Requests Seamlessly (Without the Need for Plugins

I currently have 2 distinct ajax requests: One for endless loading The other for product filtering - by size, color, orderby, and it functions correctly with pagination. However, after applying the filters, the loadmore script does not work as expecte ...

Show pricing information on the "Add to Cart" button in WooCommerce

Is there a way to display the price on the add to cart button in the loop? [100$ Add to cart] instead of [Add to cart] add_to_cart.php template: echo apply_filters( 'woocommerce_loop_add_to_cart_link', sprintf( '<a href="%s" rel="nofollow" data-p ...

The Ajax "load more" feature and filtering options in WooCommerce are exceptional for enhancing user experience and streamlining the shopping process

I came across this code snippet for implementing a "load more" button in WooCommerce. Initially, it worked perfectly fine but I encountered an issue when trying to filter the products using an Ajax plugin - the button stopped responding altogether. You ca ...

Is there a way to display the basket notification only when the cart contains one or more items?

Is there a way to display the total price of the user's cart in the header only when there is at least one item in it? I've tried implementing various suggestions from online resources but nothing seems to be working. Can anyone provide guidance ...

Prevent users from updating their profile if data has already been provided during Woocommerce checkout

My shop has user profiles with registered data. On the checkout page, users can modify the automatically filled information from their profile. I want to ensure that if a customer enters a different address or email during checkout, this updated informati ...

Remembering WooCommerce Checkout Fields

I designed a page where I transmit concealed form field values to the WooCommerce checkout section. $my_form = '<form action="/checkout" method="post">'; $m_form .= '<input type="hidden" name="company" value="<%= company %>" ...

Output the chosen item quantity in the WooCommerce cart

Is there a way to showcase the quantity of added products in the cart on the single product page as a text image? Here is what I'm currently using in functions.php, but I need to include the quantity number within: add_action('woocommerce_before ...

Updating the email header for responding to New Order and shipped email notifications in Woocommerce

Looking for a solution to customize the reply-to email addresses specifically for New Order and Shipped emails sent to customers. I attempted to implement a suggested fix from this resource Change "reply to" email address in all Woocommerce email ...