• Apfelbiss

    (@apfelbiss)


    Hello,

    I wanted to activate the “Search by SKU” setting, but after a few seconds my browser says:
    ?Aktion fehlgeschlagen. Bitte laden Sie die Seite neu und versuchen Sie es nochmal.“
    (?Action failed. Please reload the page and try again.“)

    I think it’s because this page also lists all of the shop categories, which is in my case too much for the server or browser with 388 categories (including all hierarchy categories). I have tested it now on a test installation at localhost (MAMP 4.3 with PHP 7.1.12 on MacOS Sierra 10.12.6).

Viewing 15 replies - 1 through 15 (of 15 total)
  • Algoritmika

    (@algoritmika)

    Hi @apfelbiss,

    Yes, you are probably correct – having many categories will require more resources for the page to load. Could you please try increasing WP memory limit by adding to your to wp-config.php file:

    define( 'WP_MEMORY_LIMIT', '512M' );
    define( 'WP_MAX_MEMORY_LIMIT', '512M' );

    Hope that helps.

    Best regards,
    Tom

    Thread Starter Apfelbiss

    (@apfelbiss)

    Hello,

    i changed the memory limit in wp-config.php from 128M to 512M with the two lines you mentioned.
    I also changed it from 128M to 512M in php.ini from MAMP (and restarted the MAMP server), but nothing changed:

    max_execution_time = 30     ; Maximum execution time of each script, in seconds
    max_input_time = 60	; Maximum amount of time each script may spend parsing request data
    memory_limit = 512M      ; Maximum amount of memory a script may consume (8MB)

    I don’t wanna use the Autogenerate SKU feature, but it doesn’t matter if I leave this checkbox checked (or uncheck only this in the first step), the error occurs every time I click the Save button.

    Edit: Even when adding one or two “0” to the two time values, the error occurs after ca. 3 seconds.

    • This reply was modified 7 years ago by Apfelbiss.
    Algoritmika

    (@algoritmika)

    Hi,

    Could you please replace one line in “/includes/settings/wcj-settings-sku.php” file, so we could be sure that this is because the categories number. It’s line 113:

    from

    
    $product_categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' );
    

    to

    $product_categories = array();

    Please let me know if that helps.

    Best regards,
    Tom

    Thread Starter Apfelbiss

    (@apfelbiss)

    Hello,

    after changing the code I could save this setting. After re-entering this page the checkbox is still activated.

    But my delight lasted only for short, because it didn’t find anything. I searched for SKUs from variations and simple products.
    The Search by SKU for Woocommerce Plugin still works fine, but only if your “Search by SKU” function is disabled. When testing your function, I deactivated the other plugin first, of course.

    I even deactivated all plugins except Woocommerce and Booster and changed the theme to Twenty Fifteen, but it still founds nothing.

    Thread Starter Apfelbiss

    (@apfelbiss)

    I have to correct myself:

    When “Search by SKU” in the Booster is enabled, the search function always says, that nothing is found, even when searching for text.

    When disabling this function in the Booster and the separate “Search for SKU” Plugin, searching for text works fine.

    • This reply was modified 7 years ago by Apfelbiss.
    Algoritmika

    (@algoritmika)

    Hi @apfelbiss,

    You are correct – I’ve just tested it on my server, and it seems to not work anymore. Already fixing this. Could you please let me know which WooCommerce version do you have? I’m trying to figure out when this stopped working.

    Best regards,
    Tom

    Algoritmika

    (@algoritmika)

    Hi again, @apfelbiss,

    I’ll have to do more testing, but hopefully I’ve managed to fix it. Please download the development version here – https://booster.io/dev/. You will need to uninstall the old plugin version first (don’t worry your saved settings won’t disappear). If you are a Booster Plus user – please contact me on [email protected] with your order number, and I will send you the development version for Plus.

    Please let me know if searching by SKU works ok now.

    Best regards,
    Tom

    Thread Starter Apfelbiss

    (@apfelbiss)

    Thank you.

    I still have to set $product_categories = array(); as mentioned above, but with SKU Hook set to “posts_search” the search works.

    Algoritmika

    (@algoritmika)

    Hi @apfelbiss,

    Thanks for confirming. Did I understand it correctly – when “pre_get_posts” is selected, it still doesn’t work (I’ve made some changes to “pre_get_posts” option also, so now both options work fine on my test server)?

    As for $product_categories = array(); – I’m still working on solution for this, hopefully will think of some till next Booster version release.

    Best regards,
    Tom

    Thread Starter Apfelbiss

    (@apfelbiss)

    Yes, that’s right, with “pre_get_posts” it doesn’t find anything, even searching for text (WooCommerce 3.2.6 is installed).

    Thotek

    (@thotek)

    Hello!

    I mentioned this problem some month ago. This is a really nice plugin, i love it. But i not answear on this bug report. There are many questions to come to you, surely it is gone. ??

    So, i found, what is the problem:
    On The /wp-content/plugins/booster-plus-for-woocommerce/includes/class-wcj-sku.php file, on 371 line. The code not use the database table prefix.
    Your code:
    $join .= "INNER JOIN wp_postmeta AS wcj_sku ON (wp_posts.ID = wcj_sku.post_id)";
    I change the wp_ to my table prefix, and the search is working again.

    I hope, this is help you!
    I still love the plugin Thanks!!

    By:
    Lui

    • This reply was modified 7 years ago by Thotek.
    Algoritmika

    (@algoritmika)

    Hi @thotek,

    Thanks, really appreciate it. Yes, I should have accounted for the non-standard prefix, my mistake. Will fix that in next version.

    Best regards,
    Tom

    Thotek

    (@thotek)

    Thank You! And thank you for your persistent work!

    Good luck in the future!
    Lui

    Algoritmika

    (@algoritmika)

    Hi @apfelbiss and @thotek,

    I’ve replaced hard-coded wp_ prefix with the correct code in Booster v3.4.1. So now it should work fine with custom prefixes also.

    Best regards,
    Tom

    Thotek

    (@thotek)

    Hi!

    I upgraded the plugin, and this is really working fine! Thanks again!
    Have a nice day!

    Lui!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Can’t save settings for Products > SKU’ is closed to new replies.