Quantcast
Channel: WordPress.org Forums » [WooCommerce] Support
Viewing all 102134 articles
Browse latest View live

Updating wc_product_meta_lookup after inserting a review with wp_insert_comment

$
0
0

Replies: 0

Hello,

I can’t seem to figure out how wc_update_product_lookup_tables_rating_count() function works.

I have a cron that inserts new comments/reviews on specific products, which looks something like this:

$commentdata = [
                'comment_author'        => $original_comment->comment_author,
                'comment_author_email'  => $original_comment->comment_author_email,
                'comment_author_url'    => $original_comment->comment_author_url,
                'comment_author_IP'     => $original_comment->comment_author_IP,
                'comment_date'          => $original_comment->comment_date,
                'comment_date_gmt'      => $original_comment->comment_date_gmt,
                'comment_post_ID'       => $post->ID,
                'comment_content'       => $original_comment->comment_content,
                'comment_karma'         => $original_comment->comment_karma,
                'comment_approved'      => 1,
                'comment_agent'         => $original_comment->comment_agent,
                'comment_type'          => $original_comment->comment_type,
                'comment_parent'        => $original_comment->comment_parent,
                'user_id'               => $original_comment->user_id,
                'comment_meta' => [
                    'rating' => $comment_rating,
                ]
            ];

wp_insert_comment($commentdata);

So this is all the necessary data that wp_insert_comment requires for it to be inserted.
After this function executes, everything is fine, new review is inserted with correct data, but the wc_product_meta_lookup table needs to be updated.

I tried with this:

 $test = [
                [
                    'meta_value' =>  $comment_rating,
                    'post_id' => $post->ID 
                ],
            ];

wc_update_product_lookup_tables_rating_count($test);

But this doesn’t work. I see that instead of average_rating, rating_count is being updated. I tried various examples with $test array but i can’t find the correct solution for this. Any help is appreciated.

  • This topic was modified 1 hour, 31 minutes ago by kojaa.

ä characters in checkout email subject

$
0
0

Replies: 1

Hello dear ones,

My site name includes “ä” and for some reason that character is output as such into the outgoing email subject after checkout. The name Rakastava Sydän is in brackets as [Rakastava Sydän] at the start of the email subject. Is this a WordPress issue, or a Woocommerce one?

My site has Finnish localization and other than the subject line, the emails reproduce “ä” correctly.

Thank you

Antti


### WordPress Environment ###

WordPress address (URL): http://www.rakastavasydan.fi/testisivu
Site address (URL): http://www.rakastavasydan.fi/testisivu
WC Version: 3.7.0
REST API Version: ✔ 1.0.2
Log Directory Writable: ✔
WP Version: 5.2.3
WP Multisite: –
WP Memory Limit: 512 MB
WP Debug Mode: –
WP Cron: ✔
Language: fi
External object cache: –

### Server Environment ###

Server Info: LiteSpeed
PHP Version: 7.2.21
PHP Post Max Size: 128 MB
PHP Time Limit: 30
PHP Max Input Vars: 10000
cURL Version: 7.65.3
OpenSSL/1.0.2s

SUHOSIN Installed: –
MySQL Version: 5.5.5-10.2.23-MariaDB-cll-lve
Max Upload Size: 128 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

### Database ###

WC Database Version: 3.7.0
WC Database Prefix: wp_
MaxMind GeoIP Database: ✔
Tietokannan kokonaiskoko: 2.19MB
Tietokannan tietojen koko: 1.17MB
Tietokannan hakemiston koko: 1.02MB
wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_commentmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_comments: Data: 0.01MB + Index: 0.01MB + Engine MyISAM
wp_failed_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_litespeed_img_optm: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_litespeed_optimizer: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_options: Data: 0.41MB + Index: 0.04MB + Engine MyISAM
wp_postmeta: Data: 0.09MB + Index: 0.02MB + Engine MyISAM
wp_posts: Data: 0.04MB + Index: 0.02MB + Engine MyISAM
wp_queue: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_terms: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
wp_term_relationships: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_term_taxonomy: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wp_usermeta: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
wp_users: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB

### Security ###

Secure connection (HTTPS): ❌
					Kauppa ei käytä HTTPS-salausta. Lisätietoja HTTPS ja SSL sertifikaateista.
Hide errors from visitors: ✔

### Active Plugins (10) ###

Child Theme Configurator: -- Lilaea Media – 2.5.0
Homepage Control: -- WooThemes – 2.0.3
Limit Login Attempts Reloaded: -- WPChef – 2.9.0
LiteSpeed Cache: -- LiteSpeed Technologies – 2.9.8.6
Loco Translate: -- Tim Whitlock – 2.3.0
Options for Twenty Seventeen: -- webd.uk – 2.0.6
WooCommerce Admin: -- WooCommerce – 0.19.0
WooCommerce PayPal Checkout Gateway: -- WooCommerce – 1.6.17
WooCommerce Services: -- Automattic – 1.21.1
WooCommerce: -- Automattic – 3.7.0

### Inactive Plugins (7) ###

Akismet Anti-Spam: -- Automattic – 4.1.2
Facebook for WooCommerce: -- Facebook – 1.9.15 – Ei ole testattu käytössä olevassa WooCommerce versiossa
Hello Dolly: -- Matt Mullenweg – 1.7.2
Jetpack by WordPress.com: -- Automattic – 7.7.2
Klarna Checkout for WooCommerce: -- Krokedil – 1.11.2
Limit Login Attempts: -- Johan Eenfeldt – 1.7.1
Mailchimp for WooCommerce: -- Mailchimp – 2.2.4

### Dropin Plugins (1) ###

advanced-cache.php: advanced-cache.php

### Must Use Plugins (1) ###

installatron_hide_status_test.php: --  –

### Settings ###

API Enabled: –
Force SSL: ✔
Currency: EUR (€)
Currency Position: right_space
Thousand Separator: 
Decimal Separator: ,
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

Connected to WooCommerce.com: –

### WC Pages ###

Kaupan polkutunnus: #67 - /kauppa/
Ostoskori: #68 - /ostoskori/
Kassa: #69 - /kassa/
Oma tili: #70 - /oma-tili/
Tilaus- ja sopimusehdot: ❌ Sivua ei ole asetettu

### Theme ###

Name: Storefront Child
Version: 2.5.3.1569589480
Author URL: https://woocommerce.com/
Child Theme: ✔
Parent Theme Name: Storefront
Parent Theme Version: 2.5.3
Parent Theme Author URL: https://woocommerce.com/
WooCommerce Support: ✔

### Templates ###

Overrides: –

### Action Scheduler ###

Complete: 16
Oldest: 2019-09-26 18:20:31 +0000
Newest: 2019-09-27 14:01:32 +0000

Pending: 1
Oldest: 2019-09-27 14:43:26 +0000
Newest: 2019-09-27 14:43:26 +0000

Canceled: 1
Oldest: 2019-09-26 19:20:31 +0000
Newest: 2019-09-26 19:20:31 +0000

In-progress: 0
Oldest: –
Newest: –

Failed: 0
Oldest: –
Newest: –

can I delete classic editor

$
0
0

Replies: 1

Hello,

Always looking to reduce the number of active plugins. So therefore my question is if it is safe to de-activate/delete the classic editor? Or will it give problems with Woocommerce products/categories?

Thanks, Arien

Add Apple Pay Button (Stripe) to Mini Cart

$
0
0

Replies: 0

I have signed up for Stripe and enabled Apple pay and have removed the button from the product page and added it to the checkout page. I would like to also place it on the WooCommerce Mini Cart. Here is what I used to add it to the checkout page… any ideas on how to add it to the mini cart?

add_filter( ‘wc_stripe_show_payment_request_on_checkout’, ‘__return_true’ );

Thanks!

Which Multivendor supports “All Products for WooCommerce Subscriptions” plugin?

$
0
0

Replies: 0

Our multivendor marketplace is for virtual / digital products only where vendors sell add-ons for our software, a desktop application.

Which multivendor marketplace for wordpress supports the “All Products for WooCommerce Subscriptions” plugin?

Also, do they have to support it directly? For example, Dokan doesn’t support “WooCommerce Subscriptions”, but maybe “All Products for WooCommerce Subscriptions” somehow makes it supporting subscriptions regardless?

Changing default currency, keeping order history

$
0
0

Replies: 0

Currency question(s)…

We have moved from the UK to Eurozone and want to change the default currency from GBP to Euro. If I just go ahead and do that in settings, ALL HISTORY changes too, meaning all previous orders are wrong. The numbers stay the same, just the symbol changes.

Any suggestions for the best way forward? Do I have to archive all previous orders and start as if a new site? Is there a plugin that can help? Do I have to export everything to a csv file?

Thank you so much in advance!

How to Export Product Reviews

$
0
0

Replies: 0

So I’ve looked everywhere and tried everything but it doens’t seem to be working.

I’ve exported the wp_comments sql and reimported it, I’ve tried using plugins but it ends up being the same results.

After importing all the comments/product reviews are there but not the In Response to column, and there is no way for me to manual update that column when I try to edit the comment.

Is there any other way to do this or do I have to be an full migration using duplicator to get all the reviews connected to the products?

Thank you.

Thumbnails | Using Jetpack Photon instead

$
0
0

Replies: 2

Hello. I plan to disable WooCommerce thumbnail background regeneration using the code:

add_filter( 'woocommerce_background_image_regeneration', '__return_false' );

– Code found on Woocommerce wiki

Can you please tell me, must this code be added to the functions.php file or can I add this code to a functionality plugin and still work correctly?

Thanks for your time and advice!
Julian


WC – Order number to form entry

$
0
0

Replies: 0

Hi, please tell me if I can drop order number from thank you page and transfer him to form field…when the form field is on the same thank you page (under order recapitulation).

Thank you. 🙂

Billing Country on checkout: is this automatically filled in by geolocation

$
0
0

Replies: 0

Hi,
I’m wondering, is the field “billing country” automatically filled in by some kind of geolocation or is the field initially blank and the customer has to fill it out anyway?

Warm regards

Woocommerce cannot detect SSL certificate

$
0
0

Replies: 1

Hi,

On the Woocommerce System Status page it states that “Your store is not using HTTPS”. However I have SSL installed and appears active for each stage of the checkout journey.

Does anyone know if I can ignore this or is there an issue I need to fix.

Thanks

Neil

Sale price remains after sale ends

$
0
0

Replies: 3

This one seems to keep cropping up. If I set a sale price on a simple product and schedule an end date, I correctly see a sales banner, the crossed out regular price and the sale price.

Once the sale ends the sale banner disappears, but the sale price remains as the only price, rather than the regular price.

Anyone else see this? I have tested this with default theme (2019) and with WC as the only plugin on a localhost (so I can easily change the server time).

id=”gallery-2″

$
0
0

Replies: 2

Hi there,

we are having trouble with woocommerce “Product Short Description” Section.
when we create gallery, it duplicates the gallery i.e id=”gallery-2″
image in the link.
https://ibb.co/pjnwwC8

can someone please help why its happening.
thanks in advance.

Stripe Gateway – Duplicate order/payment and order not showing

$
0
0

Replies: 0

Hi.

I have a client who is using the Stripe payment gateway on WooCommerce. In the last couple of days he has had two issues. I have installed the latest update but I wanted to see if anyone can tell me whether the update may fix the issues that occurred please.

1. A customer order and payment was duplicated – both the order and the payment went through twice. (This is an issue he faced with Stripe payments on a previous website which wasn’t a WordPress/WooCommerce site). It’s always possible it was a user/user connection issue (perhaps a page taking too long to load and so clicking the button again/refreshing) but the changlog for the most recent update mentions fixes which *could* be related.

2. Order missing – A customer made an order and the payment went through fine, however the order never showed up in WooCommerce. I’ve checked the database and the order isn’t there either, so perhaps a failure in Stripe sending back some form of confirmation to WooCommerce and so not logging the order…

As mentioned above, I have installed the latest WooCommerce Stripe Gateway update so I’m hopeful that resolves the issue but wanted to know if anyone else has come across similar issues and whether this most recent update is likely to resolve the problem. I’ve also enabled logging of debug messages in Stripe so if the issue occurs again (if the update didn’t fix the problem) I’ll have more information to use/share.

Thanks for your time 🙂

Scott

Image Library

$
0
0

Replies: 0

Ok so I have had a long issue with Media images, some show fine and others show a woocommerce place holder image,

only now when I’ve been looking I see that all the images which are fine are uploaded to

/wp-content/uploads/2017/04/DSC3698.jpg

and every single image that has a place holder for the thumbnail that doesn’t show on the website is

wp-content/uploads/woocommerce_uploads/2018/05/Steampunk-googles-cameo-man.jpg

My wife has been adding the products to the site, I’m just wondering why some go in the woocommerce_uploads folder and others aren’t.

Is my wife uploading the images directly through the add product page? if so to avoid issues in the future should she be uplaoding all images in the media screen?

Thanks


Changing the City Field on the Cart Page

$
0
0

Replies: 0

i wanna Make the Customer City Field a Dropdown in cart page , ive seen a solution but i cant do it for some reason .
If you have the shipping calculator on the cart page you’ll also know there is (/can be) a city field for the customer to enter their data. Unfortunately this field won’t automatically change with the above snippet. In fact in order to change this field to a dropdown a template override will be needed.

To get started with this, copy over the woocommerce/templates/cart/shipping-calculator.php template over to your {CHILD-THEME}/woocommerce/cart/shipping-calculator.php file.

i copied the the first one but when i go to my theme/woocommerce/cart —– theres only mini-cart.php and i cannot find shipping calculator.php
screenshot for the problem

Which product type to use… (hiding variation dropdown)

$
0
0

Replies: 1

I’m building a site that sells boat propellers. These propellers fit multiple makes and within each make, multiple engines (but not all engines in all makes). I’ve used attributes to let people narrow down which props fit their make and model so that’s fine. But if I import these as simple products I get dozens of duplicates of a single prop (see https://www.tacomapropeller.com/?s=Michigan+Match+13+3%2F4+X+21+3+Blade+&post_type=product) and I only want one.

If I import them as variable products with engine make and engine model as variations then people have to choose those on the single product page… yet it’s the same prop. It’s not like colors or sizes for clothes where you get a materially different version of the basic item… they get the exact same prop. Additionally, the variation dropdowns don’t filter – you can choose a make and model pair that doesn’t exist. See https://tacoma.sitetherapy.co/product/michigan-match-14-x-13-3-blade-011001/

I can’t seem to hide the variation dropdowns and have the page work either. So… What product type works where the variation doesn’t change anything about the product but I don’t want dozens of duplicate products?

How to stop AJAX from removing fees

$
0
0

Replies: 0

Hi, I’m a developer but very new to WP and WC so still finding my way round. I copied the following function from Woo docs as a starter…


add_action( 'woocommerce_cart_calculate_fees','woocommerce_custom_surcharge' );
function woocommerce_custom_surcharge() {
  global $woocommerce;
	if ( is_admin() && ! defined( 'DOING_AJAX' ) )
		return;

 	$county 	= array('US');
	$percentage 	= 0.01;

	if ( in_array( $woocommerce->customer->get_shipping_country(), $county ) ) :
		$surcharge = ( $woocommerce->cart->cart_contents_total + $woocommerce->cart->shipping_total ) * $percentage;
		$woocommerce->cart->add_fee( 'Surcharge', $surcharge, true, 'standard' );
	endif;
 
}

However, AJAX-checkout just removes it again. Also tried adding the fee directly to WC()->cart->add_fee( ‘Fee’, ’10’ ) with the same result.

I have cleared cache and tried to checkout as guest to see if the issue is related to recurring fees or not. Also tried adding the following, although we’re not offering subscriptions…


add_filter( 'woocommerce_subscriptions_is_recurring_fee', '__return_true' );

No matter what I have tried, AJAX removes it again. I have disabled all plugins other than WC and I’m using the Shopfront theme. What am I missing?

  • This topic was modified 5 hours, 50 minutes ago by ozcoolie.

Buy product button

$
0
0

Replies: 0

Hi,

How make “Buy product” button NOT Overwrite and replace the “Read more” button shown on the Home page and Category page?

I need a “Buy product” shown ONLY on a single product page.

Thank you for the Help. Highly appreciated.

Disable Thumbnail Regeneration not working

$
0
0

Replies: 0

Hello. After adding code obtained from the Woo Wiki to the functions.php file, thumbnails are still being generated.

add_filter( 'woocommerce_background_image_regeneration', '__return_false' );

I do not want thumbnails created after uploading image files. Can you please help?

Viewing all 102134 articles
Browse latest View live