Site logo

Archived topic

PHP Error with Product Recommendations Plugin

13 replies · Started by roadlink on May 28, 2021

Viewing posts 1–14 of 14

Hi,

I bought Product Recommendations plugin few weeks ago. https://woocommerce.com/products/product-recommendations
It does it's job but create lots of php errors with GeneratePress theme.

I change to them to storefront and don't see any error.

I have contacted with plugin's support, they also said they can't re produce the error with storefont or 2021 theme.

Is there any suggestion to fix it?

2021-05-28 21:36:58 31.223.26.117 require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/woocommerce/templates/single-product.php'), wc_get_template_part, load_template, require('/plugins/woocommerce/templates/content-single-product.php'), do_action('woocommerce_after_single_product'), WP_Hook->do_action, WP_Hook->apply_filters, WC_PRL_Templates->display_recommendations, WC_PRL_Templates->process_hook, WC_PRL_Deployment->get_products, WC_PRL_Engine->apply_dynamic_filters, WC_PRL_Filter_Stock_Status->run, WC_PRL_Engine->query, wc_get_products, WC_Product_Query->get_products, WC_Data_Store->__call, WC_Product_Data_Store_CPT->query, WP_Query->__construct, WP_Query->query, WP_Query->get_posts taraf\xc4\xb1ndan olu\xc5\x9fturulan SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_wc_product_meta_lookup wc_product_meta_lookup ON wp_posts.ID = wc_product_meta_lookup.product_id LEFT JOIN wp_wc_product_meta_lookup wc_product_meta_lookup ON wp_posts.ID = wc_product_meta_lookup.product_id WHERE 1=1 AND wp_posts.ID IN (36256,5638,2089,12723,25287,58148,58209,36160,27740,2540,51487,63339,12249,16809,4430,42555,4308,54603,41075,12,40736,47461,2464,74248,67293,54349,63328,57332,51113,39393,6565,3784,56544,53221,51231,45393,37789,36309,6035,5940,3279,69995,69983,63306,59803,57407,54389,54386,53215,52068,50751,47795,45390,42991,39399,32268,27479,16825,5738,4719,3757,76351,72690,71481,64881,64703,63616,63615,61930,60928,59781,59674,57963,57297,56534,54420,53498,53279,53230,51366,49317,45392,27743,27401,21507,20832,14041,13811,12239,6401,6281,6245,5942,5393,4438,3901) AND ( \n wp_term_relationships.term_taxonomy_id IN (2,3,4,5,142)\n) AND wp_posts.post_type = 'product' AND ((wp_posts.post_status = 'publish' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private')) AND wc_product_meta_lookup.stock_status IN ( 'instock' ) GROUP BY wp_posts.ID ORDER BY wc_product_meta_lookup.min_price ASC, wc_product_meta_lookup.product_id ASC LIMIT 0, 96 sorgusu i\xc3\xa7in WordPress veritaban\xc4\xb1 hatas\xc4\xb1 Not unique table/alias: 'wc_product_meta_lookup'

2021-05-28 21:36:38 66.249.65.190 require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/plugins/woocommerce/templates/single-product.php'), wc_get_template_part, load_template, require('/plugins/woocommerce/templates/content-single-product.php'), do_action('woocommerce_after_single_product'), WP_Hook->do_action, WP_Hook->apply_filters, WC_PRL_Templates->display_recommendations, WC_PRL_Templates->process_hook, WC_PRL_Deployment->get_products, WC_PRL_Engine->apply_dynamic_filters, WC_PRL_Filter_Stock_Status->run, WC_PRL_Engine->query, wc_get_products, WC_Product_Query->get_products, WC_Data_Store->__call, WC_Product_Data_Store_CPT->query, WP_Query->__construct, WP_Query->query, WP_Query->get_posts taraf\xc4\xb1ndan olu\xc5\x9fturulan SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_wc_product_meta_lookup wc_product_meta_lookup ON wp_posts.ID = wc_product_meta_lookup.product_id LEFT JOIN wp_wc_product_meta_lookup wc_product_meta_lookup ON wp_posts.ID = wc_product_meta_lookup.product_id WHERE 1=1 AND wp_posts.ID IN (16809,12723,74248,4430,12249,36256,58209,12239,20832,56345,51487,67293,2089,5638,63339,25287,42555,4308,54603,41075,12,40736,47461,2464,54349,63328,57332,51113,6565,3784,56544,53221,51231,45393,37789,36309,6035,5940,3279,69995,69983,63306,59803,58148,57407,54389,54386,53215,52068,50751,47795,45390,42991,39399,32268,27479,16825,5738,4719,3757,76351,72690,71481,64881,64703,63616,63615,61930,60928,59781,59674,57963,57297,56534,54420,53498,53279,53230,51366,49317,45392,27743,27401,21507,14041,13811,6401,6281,6245,5942,5393,4438,3901) AND ( \n wp_term_relationships.term_taxonomy_id IN (2,3,4,5,142)\n) AND wp_posts.post_type = 'product' AND ((wp_posts.post_status = 'publish' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private')) AND wc_product_meta_lookup.stock_status IN ( 'instock' ) GROUP BY wp_posts.ID ORDER BY wc_product_meta_lookup.min_price ASC, wc_product_meta_lookup.product_id ASC LIMIT 0, 93 sorgusu i\xc3\xa7in WordPress veritaban\xc4\xb1 hatas\xc4\xb1 Not unique table/alias: 'wc_product_meta_lookup'

Hi there,

I could be wrong but I don't think it's related to the theme - those errors are pointing to WooCommerce templates which GP doesn't interfere.

Where are you seeing the error? Are you using the parent theme and no custom functions added?

Hi Leo,
I see these errors on error.log file and also hosting's plugin at admin panel.
I use child theme.
I am not sure what do you mean with custom functions?
I have some code snippets for design.

When I try with storefront theme, I don't see these errors.

Can you try activating the parent theme to test?

Hi Leo,

tested, still got error. :(

And no issue with the twenty twenty theme?

Hi Leo,

Yes, no error on storefront or Twenty Twenty-One.

That is why I contacted you after somewherewarm team (plugin owner)
I share admin access with you.
Theme is Twenty Twenty-One now and no error.
When I switch it to GP and visit some categories, error listed in error page.

I just visited the page and see an error with Twenty twenty theme activated:
https://www.screencast.com/t/QxczWeJ12d

But I guess that's not the error you are referring to?

If that's the case, can you deactivate all plugins except GP Premium, WooCommerce and Product Recommendations Plugin for us to take look?

Thanks :)

Hi Leo,

Yes, it is not the error I mentioned.
I did deactivated all plugins. (except plugin which shows error)

Since it is dev site you can do any change you want, if you need.

thanks.

Hi there,

I just visited a handful of categories and products, but I'm not seeing any errors in the log.

This seems to be the actual error: Not unique table/alias: 'wc_product_meta_lookup'

The theme itself doesn't alter/mess with any core WooCommerce functionality, so I don't believe the error is coming from the theme. Perhaps there's some sort of issue with the database? Really hard for us to tell, unfortunately.

Hi Tom,

Thanks for your time to check this. I spend some more time.
And found the issue as below.

Maybe this can help to solve the case.

1. Deactivated all unnecessary plugins and activated 1 by 1.
2. Found that this error happens only with generatepress theme, code snippet plugin active, and after visited a composite product. Regular products don't create errors.
3. I went to all snippets and tried all of them one by one. And found that that snippet creates the error.


/**
 * Plugin Name: WooCommerce Composite Products - Sort Component Options by Price
 * Plugin URI: https://woocommerce.com/products/composite-products/
 * Description: Use this snippet to change the default Component Options sorting option from "Default sorting" to "Sort by price".
 * Version: 1.0
 * Author: SomewhereWarm
 * Author URI: https://somewherewarm.gr/
 * Developer: Manos Psychogyiopoulos
 *
 * Requires at least: 3.8
 * Tested up to: 5.3
 *
 * Copyright: © 2017-2020 SomewhereWarm SMPC (info@somewherewarm.gr).
 * License: GNU General Public License v3.0
 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
 */

// To use this snippet, download this file into your plugins directory and activate it, or copy the code under this line into the functions.php file of your (child) theme.

add_filter( 'woocommerce_composite_component_default_orderby', 'wc_cp_sort_by_price', 10, 3 );

function wc_cp_sort_by_price( $default_sort_function, $component_id, $composite ) {
    return 'price';
}

PS : I already contacted with plugin's developer btw.

Definitely sounds like that snippet isn't compatible with their plugin. They should be able to debug more now that you narrowed it down :)

It was an error with other plugin from this company.
They published an update and problem solved.

It was weird that , that problem was not exist in storefront.

Thanks for your time.

Glad they got it sorted :)

This archived topic is closed to new replies.