woocommerce order received page display error - wordpress

Woocommerce "Order Received" page displays "gtag" code between payment details and order details. Attached screenshotenter image description here
Where do I remove it?
I have looked through all the theme child files including:
templates/checkout/thankyou.php
templates/order/order-details.php

Related

This field may not be blank notice at checkout page?

I only need Name and Email at checkout page so for that I'm using this WordPress plugin Checkout Field Editor to disable other fields but when I enter name and email and press place order its "This field may not be blank" and also at checkout page there is no Product Image Showing at checkout page.
p.s. I did researched for the solution from my side but didn't found any.

Display error Woocommerce admin edit product page

I want to display an error message on the Woocommerce admin edit product page. I've tried using add_settings_error(), but it didn't work. I read about the way Woocommerce displays errors, but can't seems to get it to work as it all seems related to the Settings API.
I'm using get_option() to retrieve an option on the Admin edit product page. If it's not set, I want to raise an error, with a link to the settings page. What's the best way to display an error on this page?

How to remove custom fields from “WooCommerce Thankyou Order” email?

I have added custom fields to my product. I don't want to display those into "WooCommerce Thankyou Order" email. Please, can someone tell me, how to hide the custom fields?
For ex: I want to hide the details that are highlighted email template
Go WooCommerce in the wordpress Dashboard, click on Email tab. At the end you have Email Template.
In order to override the default email template edit woocommerce/templates/emails/customer-process-proshop/woocommerce/emails/customer-processing-order.php
At least that's WooCommerce instructions says. I do not have a wordpress with commerece to test or check that file but I suppose in there you could decide what information is actually sent to the customer.

How do I add my Shipping info to the 'thank you' page in WooCommerce (Wordpress)

I have a Wordpress site using WooCommerce for online transactions - on the order completed page (the thank you page) I see the Billing Address but not the Shipping Address (even when the addresses are different)
How do I get the Shipping Address to ALWAYS be displayed on this order confirmation page.
Edit order/order-details-customer.php , scroll to the bottom of the file, you'll notice the Shipping address has been wrapped in a conditional, just comment out the conditional and the shipping address will always be displayed.
You need to do this by overriding WooCommerce templates
Copy file from
wp-content/plugins/woocommerce/templates/checkout/thankyou.php
and put it into
wp-content/themes/YOUR_THEME/woocommerce/checkout/thankyou.php.
Take user shipping value from wp_user_meta table of wordpress. Its like override template. Add our field to that template.

How to programmatically enable reviews and ratings in WooCommerce products?

I have enabled Reviews from the Dashboard but they are not appearing in the front-end of my site. This could be an issue with the theme itself. Is there a function that displays the reviews and ratings section within my theme?
It's the /plugins/woocommerce/templates/single-product/review.php that needs to be displayed on the product pages but it's not showing at all.
There's a few layers at work here. A few things you should check, in order of most likely to least likely culprit:
Is another setting in the dashboard hiding the reviews tab? There are other options below the "Enable reviews" checkbox. Review those, as they can hide the tab based on your front-end viewing user privileges.
Is the review tab just getting hidden by CSS in your theme? Go to the page's source code in Chrome Inspector (or whatever browser tool you're using) and CTRL+F "review" and cycle through any hits. If you find elements in the page body with "review" classes or ids, check to see if they're hidden, and if so, whether they're hiding the reviews tab.
Is the reviews tab being hidden in the source code by a hook? Search your entire project's source code (including plugins) for hooks that may be un-setting the reviews tabs. For example:
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30);
remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30);
Are your theme's override templates removing reviews? Check the /theme/woocommerce/content-single-product.php file to see if it's markedly different from the base WooCommerce template, for instance not executing do_action( 'woocommerce_single_product_summary' )
Did your WooCommerce base templates get altered? Check for the same in the plugin files directly.
There are 3 components to enable reviews on WooCommerce.
Enable comments in WordPress
Enable Reviews in WooCommerce
Enable reviews in the product
I will only discuss the third option which is not as documented on the web.
As of Woocommerce 3.7.0 (maybe even earlier), if a product was already created and then you enabled the review settings, then the product will have the reviews DISABLED. You must enable them on each product.
Manual:
Go to the Products->All Products menu on WordPress.
Click "Quick Edit" on a product. You will see a "Enable Reviews" checkbox just below the Product tag field. Check it.
Automated:
Got to phpMyAdmin and run a SQL command:
UPDATE wp_posts SET comment_status = 'open' WHERE post_type = 'product';

Resources