Forum Replies Created

Viewing 15 replies - 1 through 15 (of 52 total)
  • Hello,

    also to me the Contact Form 7 module goes into error when the plugin is active. Below the php error log:

    PHP Fatal error:  Uncaught Error: Class 'MailPoet\Models\Segment' not found in /home/xxxxx/public_html/wp-content/plugins/add-on-contact-form-7-mailpoet/includes/class-mailpoet-cf7-integration.php:235
    Stack trace:
    #0 /home/xxxxx/public_html/wp-content/plugins/add-on-contact-form-7-mailpoet/includes/class-mailpoet-cf7-integration.php(123): MailPoet_CF7_Integration->mailpoet_segments_data(Array)
    #1 /home/xxxxx/public_html/wp-content/plugins/contact-form-7/includes/form-tags-manager.php(551): MailPoet_CF7_Integration->mailpoet_signup_form_tag(Object(WPCF7_FormTag))
    #2 /home/xxxxx/public_html/wp-content/plugins/contact-form-7/includes/form-tags-manager.php(460): WPCF7_FormTagsManager->scan_callback(Array, true)
    #3 [internal function]: WPCF7_FormTagsManager->replace_callback(Array)
    #4 /home/xxxxx/public_html/wp-content/plugins/contact-form-7/includes/form-tags-manager.php(356): preg_replace_callback('/(\\[?)\\[(mailpo...', Array, '<p><span style=...')
    #5 /home/xxxxx/public_html/wp-content/plugins in /home/xxxxx/public_html/wp-content/plugins/add-on-contact-form-7-mailpoet/includes/class-mailpoet-cf7-integration.php on line 235

    • This reply was modified 1 month, 1 week ago by guardiano78.
    Thread Starter guardiano78

    (@guardiano78)

    Hello,

    I solved the problem.
    The registered user, I don’t know why, did not have the NATION field filled in. This prevented woocommerce from performing the tax calculation, or at least in visualization. Thanks anyway.

    Forum: Fixing WordPress
    In reply to: permalink problems
    Thread Starter guardiano78

    (@guardiano78)

    Hello @sharif200

    thank you I catch the plugin that make the problem.
    I contacted the owner.

    Bye

    Thread Starter guardiano78

    (@guardiano78)

    Maybe I understood. Through $args I retrieve much more information than the $wpdb query which only retrieves my id.
    Could this be the reason?

    Thread Starter guardiano78

    (@guardiano78)

    Hello,
    my post is a Woocommerce product.
    The variable is created before the function and I have to pass it inside the function.
    my custom meta post is called “_role_based_price”. The meta post must contain a serialized array of a role/price combination.
    That’s all.

    Thread Starter guardiano78

    (@guardiano78)

    Hello,
    I don’t want to run it every time, but only when a specific if condition is true.
    And yes, I just need to add a custom meta post while saving the post.
    Do you think this is not the right way to do it?
    Maybe I must use do_action? … or what?
    And how I can pass my custom variable?

    thank you.

    • This reply was modified 2 years, 5 months ago by guardiano78.
    Thread Starter guardiano78

    (@guardiano78)

    Hi @ rynald0s

    I already did.
    My needs are to display the sku instead of the product title in the error messages for “insufficient stock”.
    This way, the user will be able to identify the product more quickly.

    Thank you.

    Thread Starter guardiano78

    (@guardiano78)

    Hello @rynald0s ,
    thank you very much for your help, I think I will give up for the moment and look for any new hooks in the new versions of woocommerce.

    Bye

    Thread Starter guardiano78

    (@guardiano78)

    Hello,

    yes, there is a reason.
    The products on the site have a long title, so to avoid problems, when viewing, I created a limit of 50 characters.
    In addition in the cart, I have activated a snippet for viewing the sku.
    So it happens that if there are products in the cart that have similar names except for the last word, with my character limit, the titles look the same, except for the sku. Then replacing the sku at the title for the cart messages would have been useful for the user to identify the product that has stock problems.

    Thread Starter guardiano78

    (@guardiano78)

    Hello,
    unfortunately it does not work, I can not understand where I am wrong.
    Let’s start from the beginning.
    In the file “class-wc-cart.php” starting from line 789 I find this code:

    if ( apply_filters( 'woocommerce_cart_item_required_stock_is_not_enough', $product->get_stock_quantity() < ( $held_stock + $required_stock ), $product, $values ) ) {
    				/* translators: 1: product name 2: quantity in stock */
    				$error->add( 'out-of-stock', sprintf( __( 'Sorry, we do not have enough "%1$s" in stock to fulfill your order (%2$s available). We apologize for any inconvenience caused.', 'woocommerce' ), $product->get_name(), wc_format_stock_quantity_for_display( $product->get_stock_quantity() - $held_stock, $product ) ) );
    				return $error;
    			}

    If i replace “$product->get_name()” with “$product->get_sku()”, I achieve my goal.
    Now I have to create the hook for this message.
    Searching on google I find this:

    add_filter( 'woocommerce_cart_item_required_stock_is_not_enough', 'wp_kama_woocommerce_cart_item_required_stock_is_not_enough_filter', 10, 3 );
    function wp_kama_woocommerce_cart_item_required_stock_is_not_enough_filter( $has_stock, $product, $values ){
    
    	// filter...
    	return $has_stock;
    }

    It should work … but it doesn’t work.
    So I replace:
    add_filter( 'woocommerce_cart_item_required_stock_is_not_enough', 'wp_kama_woocommerce_cart_item_required_stock_is_not_enough_filter', 10, 3 );
    with :
    add_filter( 'woocommerce_cart_item_required_stock_is_not_enough', 'wp_kama_woocommerce_cart_item_required_stock_is_not_enough_filter', 10, 4 );
    but it still doesn’t work.
    New wordpress installation, with only woocommerce and storefront theme …. there is something that escapes me.

    Thread Starter guardiano78

    (@guardiano78)

    Hi,
    i already empty browser cache. I also tried with another browser that never used localhost

    Thread Starter guardiano78

    (@guardiano78)

    Hello,
    i did a clean wordpress installation, i installed storefront:
    https://snipboard.io/e3hOHE.jpg

    i only installed woocommerce:
    https://snipboard.io/2QIdFD.jpg

    i created the hook in functions.php:
    https://snipboard.io/HYSfZ8.jpg

    I added to cart a product, reduced the stock and i gone to cart:
    https://snipboard.io/m5nPOA.jpg

    The message is not overwritten. I don’t know what else to do ??

    Thread Starter guardiano78

    (@guardiano78)

    Hi @rynald0s
    thank you.
    I wrote your code in my theme child functions.php, but it still doesn’t work ??

    I am going crazy.

    greetings.

    Thread Starter guardiano78

    (@guardiano78)

    Hi @maykato
    thank you so much.

    Thread Starter guardiano78

    (@guardiano78)

    Hello,
    I found that you need to make some changes on the server side.
    The code I posted works fine, so I close the post it’s fixed.
    Thank you.

Viewing 15 replies - 1 through 15 (of 52 total)