The plugin will cause product pages to produce a PHP error and then fail to load IF the last order of that product was refunded (leading you to never get an order for that product again, because the product page won’t load)
[08-Oct-2024 10:08:10 UTC] PHP Fatal error: Uncaught Error: Call to undefined method Automattic\WooCommerce\Admin\Overrides\OrderRefund::get_billing_first_name() in /var/www/example.com/wp-content/plugins/wpc-smart-messages/includes/class-shortcode.php:319
Stack trace:
#0 /var/www/example.com/wp-includes/shortcodes.php(434): Wpcsm_Shortcode->recent_order()
#1 [internal function]: do_shortcode_tag()
#2 /var/www/example.com/wp-includes/shortcodes.php(273): preg_replace_callback()
#3 /var/www/example.com/wp-content/plugins/wpc-smart-messages/includes/class-frontend.php(114): do_shortcode()
#4 /var/www/example.com/wp-content/plugins/wpc-smart-messages/includes/class-frontend.php(99): Wpcsm_Frontend->display_message()
#5 /var/www/example.com/wp-includes/class-wp-hook.php(324): Wpcsm_Frontend->{closure}()
#6 /var/www/example.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#7 /var/www/example.com/wp-includes/plugin.php(517): WP_Hook->do_action()
#8 /var/www/example.com/wp-content/themes/salient/woocommerce/content-single-product.php(79): do_action()
#9 /var/www/example.com/wp-includes/template.php(812): require('...')
#10 /var/www/example.com/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): load_template()
#11 /var/www/example.com/wp-content/plugins/woocommerce/templates/single-product.php(37): wc_get_template_part()
#12 /var/www/example.com/wp-includes/template-loader.php(106): include('...')
#13 /var/www/example.com/wp-blog-header.php(19): require_once('...')
#14 /var/www/example.com/index.php(17): require('...')
#15 {main}
thrown in /var/www/example.com/wp-content/plugins/wpc-smart-messages/includes/class-shortcode.php on line 319
The code needs to check that the $order object on line 319 is an instance of WC_Order (and specifically not WC_Order_Refund)
Add this below line 315 of /wpc-smart-messages/includes/class-shortcode.php to fix:
if (!$order || !($order instanceof WC_Order)) {
// Skip non-orders
continue;
}
]]>
[wpcsm_product_terms taxonomy=”product_tag”]
]]>please integration loco translate plugin!
]]>Thanks for this great plugin.
Now in the Condition tab, the logics for products are only status, stock, weight, width, hight, type, visibility, categories, tags, and shipping classes.
Can you please add the function to choose by the product id or title? Or how to write a small code snippet to do this function?
Many thanks!
]]>An odd issue with the condition fields, after you fill them in according to the conditions you need, when you save the post they are deleted, but the conditions work and affect the posts without problem, but if you want to update anything in the post you have to enter them again.
]]>Hello,
for my companies onlineshop I want to display the savings in percentage and the amount saved, which works fine with simple products and the smart message plugin and shortcodes.
I have problems showing the savings on variable products. For example I have a variation A (1000€ –> Sale 500€) and variation B (1500€ –> Sale 1350€). The saved percentage and the saved amount is different and when I apply the following statement: “Save [wpcsm_saved_amount] in Presale!” It only shows: “Save 500€ in Presale” even if I change the selector to variation B.
1:
Is there a workaround to display the saved amount/percentage of the selected variation? Like a dynamic smart message?
2:
Which shortcode do I have to use, to display the regular price of a selected variant of a variable product? [wpcsm_price type=”regular”] does not work for a variable product.
Thank you very much.
First of all, that is a very nice and flexible plugin, thank you! It really helped me organize my clients’ messages without having to use PHP codes.
However I noticed one possible omission: the plugin calculates the cart total and not the cart subtotal. I managed to add a nice “Add more US$ xxx to your cart to receive free shipping” message but noticed it would take shipping fees into account (because it is using the cart total, of course).
This is perhaps a rare situation because this problem only manifests itself if the client already chose a shipping option and went back to the store to add more products.
]]>Thanks for this plugin.
Now in the Conditions tab, we can choose a lot of criteria. However, sometimes, we want the logic to be store-wide but EXCLUDE something. For example, to EXCLUDE some product categories or shipping classes.
Could you please add this function to EXCLUDE something? Or how can we add a small code snippet to do this?
]]>Thanks for this great plugin.
Now in the Condition tab, the logics for products are only status, stock, weight, width, hight, type, visibility, categories, tags, and shipping classes.
Can you please add the function to choose by the product id or title? Or how to write a small code snippet to do this function?
Many thanks!
]]>Hello,
Can we create something like this:
The idea is:
-> Today Date + 3 Days
-> Today Date + 7 to 10 Days
And this to be displayed on Product Page and Checkout