ArcticFritid
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Bulk update the new cost (cogs) pricingHello again,
I got it.. I just copied my old postmeta holding the costprice using the below code:
function afas_update_post_meta_values() {
global $wpdb;$source_key = 'yith_cog_cost'; $destination_key = '_cogs_total_value'; $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = %s", $source_key ) ); if ( $post_ids ) { foreach ( $post_ids as $post_id ) { $source_value = get_post_meta( $post_id, $source_key, true ); if ( $source_value !== false ) { update_post_meta( $post_id, $destination_key, $source_value ); } } }}
add_action( ‘init’, ‘afas_update_post_meta_values’ );Then i used the woocommerce tool to regenerate the lookup tables and thats it, all cost prices set in postmeta and wp_wc_product_meta_lookup table in just a few sec or minutes.
So now just hoping that the developer of woocommerce bulk editor asap will have in place option to save cost price so i dont need to manually edit lots of products on change of cost price 1-3 times per year.
Brgds
RuneForum: Plugins
In reply to: [WooCommerce] Bulk update the new cost (cogs) pricingHello,
Normally i would have used WooCommerce bulk editor but it is not possible to save the postmeta “_cogs_total_value” using the standard save meta function. It is for some reason not saved.
When i save cogs from product editor i find it back in database under wp_postmeta and in table wp_wc_product_meta_lookup under column cogs_total_value
So i belive that woocommerce is blocking me from saving the postmeta “_cogs_total_value” without at the same time save cogs_total_value in wp_wc_product_meta_lookup
So then i wonder if there is a quick way to update wp_wc_product_meta_lookup table, something similar as updating postmeta “update_post_meta” or do i need to build me a code to directly update database?
As i can not use woocommerce bulk editor i just have to setup a loop and loop through all products. I already have my own cost prices for each product stored in postmeta “_afas_cog_cost” so it should be a quick fix if i got how to update the wp_wc_product_meta_lookup table the easiest way.
Brgds
RuneForum: Plugins
In reply to: [Svea Checkout for WooCommerce] Waiting for status and fatal errorThen i have checked my backups and it looks like 3.5.0 was installed on the day of error.
Brgds
RuneForum: Plugins
In reply to: [Svea Checkout for WooCommerce] Waiting for status and fatal errorWell, if version 3.6.0 was released 2-3 days ago then it was 3.6.0. I always update immediately when a new version is released.
Rune
Forum: Plugins
In reply to: [WooCommerce] Still fatal error on update from 10.4.3Well, it seems to me that there is a renaming process during the update and this process immediately fails to rename that file to class-wp-rest-abilities-v1-run-controller.php Or the call for that file is running to early, before renaming is done, and thats why we get the error.
When update has been finished the file has changed name and new file is ok. So there is something that fails with the renaming process during the update.
If you afterwards do a manual install then no errors appear because then the file already has been renamed. But if you do a test and rename file to its old name then error is back on manual install.
Brgds
RuneForum: Plugins
In reply to: [WooCommerce] WP Admin dashboard broke after 10.5.0 updateYes, it will not help to deactivate the custom reviews plugin as the store reviews will still remain active as they are posted just like a product reviews, perhaps using a different post type.
Forum: Plugins
In reply to: [WooCommerce] WP Admin dashboard broke after 10.5.0 updateAfter more debugging i have found that in previous WC version only product reviews appear in the dashboard widget. When i update to WC 10.5.0 then other reviews like store reviews appear in widget and cause dashboard page crash. Then i am not sure if woocommerce will fix this issue or it will be a job for the plugin developers out there to change their codes.
Forum: Plugins
In reply to: [WooCommerce] WP Admin dashboard broke after 10.5.0 update@bougiedogwear well, no help using code snippet plugin as you will ned to add a code directly into the dashboard reviews widget file in woocommerce.
Yes, if you have any review from the store reviews plugin they are most probably also listed in the dashboard review widget and as a store review has no product name the review widget will cause an error that crashes dashboard page.
I belive that woocommerce will come up with a fix for that as most store review plugin uses that very same table / widget. I guess that thousands of store owners now have the same issues.
Forum: Plugins
In reply to: [WooCommerce] WP Admin dashboard broke after 10.5.0 update@bougiedogwear yes and i have figured out the problem. It is the woocommerce reviews widget causing problems if you have other types of reviews ie. store review, deleted products etc.
Woocommerce does not decleare the product object so if product is deleted etc. the dashboard page will crash because of an review without a product name.
I have a temporary fix for it if you have any php coding knowledge.
Rune
Forum: Plugins
In reply to: [WooCommerce] Fatal error and no DB updateMoved this little code into /public/wp-content/plugins/woocommerce/templates/dashboard-widget-reviews.php
if ( is_a( $product, 'WC_Product' ) ) {
$product_name = $product->get_name();
}Then replaced
$product->get_name()with$product_nameand controlpanel again working ok.I have a clean install, only latest wordpress, woocommerce 10.5.0 and latest storefront. I have tried manual install of WC latest version downloaded from wordpress repository but fatal error, no DB update message and all the wierd issues are still the same.
Forum: Plugins
In reply to: [WooCommerce] WP Admin dashboard broke after 10.5.0 update@bougiedogwear most probably because of the fatal error thrown during the update. I just reinstalled latest WC version manually and dashboard issue was back again. This time it did not work updating DB.
It really seems to be lots of different issues with version 10.5.0
Forum: Plugins
In reply to: [WooCommerce] Fatal error and no DB updateI just found this error in the wordpress dashboard. In my first install/update of latest WC version i was able to make it work when i manually updated database but after a manual instal of WC problem came back again with error as below:
- Uncaught Error: Call to a member function get_name() on false in /public/wp-content/plugins/woocommerce/templates/dashboard-widget-reviews.php:39
Stack trace:
#0 /public/wp-content/plugins/woocommerce/includes/wc-core-functions.php(346): include()
#1 /public/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-dashboard.php(517): wc_get_template(‘dashboard-widge…’, Array)
#2 /public/wp-admin/includes/template.php(1453): WC_Admin_Dashboard->recent_reviews(”, Array)
#3 /public/wp-admin/includes/dashboard.php(271): do_meta_boxes(Object(WP_Screen), ‘normal’, ”)
#4/public/wp-admin/index.php(204): wp_dashboard()
#5 {main}
thrown - File: /public/wp-content/plugins/woocommerce/templates/dashboard-widget-reviews.php
- Line: 39
This error seems to block widgets from loading in wordpress dashboard.
Regards
RuneForum: Plugins
In reply to: [WooCommerce] WP Admin dashboard broke after 10.5.0 update@bougiedogwear if you go to woocommerce ->status ->tools and then use the tool to update the database the dashboard will be working again. This fixes a lot of different problems like add to cart, loading shop pages etc. etc. But there is still wierd issues around so check every action and parts of your site.
Brgds
RuneForum: Plugins
In reply to: [Svea Checkout for WooCommerce] Part payment module in single productSounds great, thank you 🙂
Brgds
RuneHello,
I did find the issue, the form class “checkout” was missing from the template file svea-checkout.php so now both quantity adjustment and option to add a discount code works just as in cart page.
In regards to your comment “generally advised to not allow change of quantity” it is all about making it easy for our customers, and customers get the same notifications for discount codes, errors etc. as in cart page (except for those disabled by me). When i started optimizing my site, making it easier for customers to use it by showing them shipping cost per product, updating the checkout process + + + i got an insane decrease in abandonen carts. Fallen from 60-70% to now 4-9%. If i then notice a little increase, the first thing i check out is the checkout process.
Most of my customers buying only 1 item goes directly to checkout and like myself they are happy for beeing able to do whatever needed in the checkout page. Lots of statistics and feedbacks confirms that my work has been a big success. There is always a change that customer increase the quantity.
Brgds
Rune - Uncaught Error: Call to a member function get_name() on false in /public/wp-content/plugins/woocommerce/templates/dashboard-widget-reviews.php:39