guardiano78
Forum Replies Created
-
Forum: Plugins
In reply to: [Add-on Contact Form 7 – MailPoet 3] The plugin does not work.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.
Forum: Plugins
In reply to: [WooCommerce] display prices include tax by roleHello,
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 problemsForum: Developing with WordPress
In reply to: Query Select … execution timeMaybe I understood. Through $args I retrieve much more information than the $wpdb query which only retrieves my id.
Could this be the reason?Forum: Developing with WordPress
In reply to: add_action with add_post_metaHello,
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.Forum: Developing with WordPress
In reply to: add_action with add_post_metaHello,
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.
Forum: Plugins
In reply to: [WooCommerce] Replace product title with product skuHi @ 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.
Forum: Plugins
In reply to: [WooCommerce] Replace product title with product skuHello @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
Forum: Plugins
In reply to: [WooCommerce] Replace product title with product skuHello,
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.Forum: Plugins
In reply to: [WooCommerce] Replace product title with product skuHello,
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.Forum: Plugins
In reply to: [WooCommerce] Replace product title with product skuHi,
i already empty browser cache. I also tried with another browser that never used localhostForum: Plugins
In reply to: [WooCommerce] Replace product title with product skuHello,
i did a clean wordpress installation, i installed storefront:
https://snipboard.io/e3hOHE.jpgi only installed woocommerce:
https://snipboard.io/2QIdFD.jpgi created the hook in functions.php:
https://snipboard.io/HYSfZ8.jpgI added to cart a product, reduced the stock and i gone to cart:
https://snipboard.io/m5nPOA.jpgThe message is not overwritten. I don’t know what else to do ??
Forum: Plugins
In reply to: [WooCommerce] Replace product title with product skuHi @rynald0s
thank you.
I wrote your code in my theme child functions.php, but it still doesn’t work ??I am going crazy.
greetings.
Forum: Plugins
In reply to: [WooCommerce] exclude products that belong to specific categoriesHi @maykato
thank you so much.Forum: Developing with WordPress
In reply to: How to get user id logged inHello,
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.