Dragos Cristache
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Orders get overwrittenHello @babylon1999,
I managed to find out the culprit for my issue. I was using the function below to store some additional info that we need for accounting reasons. After a bit of digging around I found that the item->save() part was causing a lot of issues under high traffic.
add_action('woocommerce_checkout_create_order', 'save_regular_price_in_order', 10, 2 ); function save_regular_price_in_order( $order, $data ) { foreach( $order->get_items() as $item_id => $item ){ $product = $item->get_product(); $regular_price = $product->get_regular_price(); $sale_price = $product->get_sale_price(); $item->update_meta_data( '_regular_price', $regular_price ); $item->update_meta_data( '_sale_price', $sale_price ); $item->save(); } }
I managed to fix it by saving once at order level instead of every line item – like this.
add_action('woocommerce_checkout_create_order', 'save_regular_price_in_order', 10, 2 ); function save_regular_price_in_order( $order, $data ) { foreach( $order->get_items() as $item_id => $item ){ $product = $item->get_product(); $regular_price = $product->get_regular_price(); $sale_price = $product->get_sale_price(); $item->update_meta_data( '_regular_price', $regular_price ); $item->update_meta_data( '_sale_price', $sale_price ); // $item->save(); } $order->save(); }
I hope this helps anyone that encounters this issue in the future. I found some extra information on Github, in issues 17660 and 25623.
Forum: Plugins
In reply to: [Yoast SEO] Yoast not working, snippet box not showingThe problem is that Yoast won’t auto update after 9.2.1 unless you update WordPress to the latest version (update that might be impossible for some). So if you don’t force update Yoast (and most users won’t do this as it requires a few extra clicks) basically you’re stuck with the broken version.
Forum: Plugins
In reply to: [Yoast SEO] Yoast not working, snippet box not showingHello @jerparx,
There’s no update available for Yoast on WP 4.8.7. Should I do an update of the plugin via FTP?
Later update:
I updated Yoast to 9.3 and it works fine on WP 4.8.7 with PHP7, both Chrome and Firefox.
- This reply was modified 5 years, 11 months ago by Dragos Cristache.
Forum: Plugins
In reply to: [Yoast SEO] Yoast not working, snippet box not showingHello,
@devnihil I can confirm that everything works fine, now that I updated to WordPress 4.9 and Yoast 9.3 – all running on PHP7.0.
On WP 4.8.7 and Yoast 9.2.1 and PHP7.0 the problem is still present.
The problem is that on some websites we can’t yet update to 4.9 and Yoast 9.3 requires WP 4.9.
Forum: Plugins
In reply to: [Yoast SEO] Yoast not working, snippet box not showing@cinghaman, Thanks for that insight! I did not expect that kind of change to be made without notice.
Forum: Plugins
In reply to: [Advanced AJAX Product Filters] Pagination arrows issueThe fix would be really helpful.
Forum: Fixing WordPress
In reply to: Unknown source of textIt’s on the homepage, check the source. I found a workaround to hide the text.
Forum: Fixing WordPress
In reply to: Page jumps to footer on loadIt was because of the newsletter input field in the footer. I’ve replaced the hard coded input with a Contact Form 7 field and it doens’t jump anymore.
*insert my code works i have no idea why meme*
Forum: Fixing WordPress
In reply to: Page jumps to footer on loadThe custom theme I’m developing is heavily using Advanced Custom Fields and if I deactivate it the theme is useless, it outputs no content if I disable ACF.
Forum: Fixing WordPress
In reply to: Page jumps to footer on loadI have a theory: I think the page jumps to the first ID element on the page. About solving that, I have no idea how.
Forum: Fixing WordPress
In reply to: Page jumps to footer on loadHello Jose!
I disabled all JS using a Chrome extension but no luck, it works the same. Here’s a link to a live version: https://ivc.cristache.net/ – hopefully you can tell what’s going on.
Forum: Themes and Templates
In reply to: [Storefront] Image Wrapper for thumbnailsCould you post a code example? Thanks!
Forum: Fixing WordPress
In reply to: tinymce is not definedI had the same error and I solved it by re-uploading the wp-includes folder. Hope this helps someone!
Forum: Plugins
In reply to: [WooCommerce Products Per Page] Romanian Translation