krishna89
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Woocommerce – checkout error after plugin updateI think I get it now. I have a custom style sheet which I added directly without applying enqueue. I will try to resolve this and let you know. Thanks anyway for your help.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce – checkout error after plugin updateThanks a lot Mike! woo-author is my custom plugin which I am developing based on woocommerce, but I could not understand what kind of data it is returning here because I did not add any code related to checkout page in my plugin. Any clue??
Forum: Plugins
In reply to: [WooCommerce] Woocommerce – checkout error after plugin updateMike, here is the test product link you can order and check link
Also you can use these test credentials while ordering, I have filled in all the customer details for you- mike/mike@123
Forum: Plugins
In reply to: [WooCommerce] Woocommerce – checkout error after plugin updateRight now I have enabled only Direct Bank Transfer, I even tested the scenario with Check payment and other wallet system.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce – checkout error after plugin updateThanks Mike! I actually had gone through your post before posting here, but that code snippet did not solve the issue. I have added that code in wp-config.php please correct me if I am wrong.
Forum: Fixing WordPress
In reply to: Woocommerce – checkout error after plugin updateThanks James, I have done that just now.
Forum: Plugins
In reply to: [Custom User Profile Photo] admin side image uploader errorAdding a screenshot https://prntscr.com/856lik
Forum: Fixing WordPress
In reply to: Adding custom form fields to woocommerce single product pageThanks Tomtheman2. I think I will have to be more clear on this.
I have written a function where the form fields are dynamically generated based on post author ID (since I have assigned authors to products).
Now I am thinking may be hooking my custom function to product page would work.
I tried few hooks collected from woocommerce docs but I am not finding any changes in product page.Forum: Plugins
In reply to: [WooCommerce] Need to calculate total revenues per productI thought I figured it out by trying to count the number of times a product was used as an order line item using woocommerce_order_items and woocommerce_order_itemmeta tables, later on finding the priced amount for that purticular product in all the order. Below is the function I tried, I felt I was halfway through but not geting expected result even for finding the line item products.
function wc_product_sold_count() { global $wpdb; $author_id = get_current_user_id(); $args = array('post_type' => 'product', 'stock' => 1, 'author' => $author_id, 'product_cat' => $term->name); $loop = new WP_Query($args); while ($loop->have_posts()) : $loop->the_post(); global $product; //echo $product->id; $units_sold = get_post_meta($product->id, 'total_sales', true); // echo $units_sold; $units_price = $product->price; echo $unit_title = $product->post_title; //echo $units_title; //$total_per_product = $units_price*$units_sold; $order_results = $wpdb->get_var($wpdb->prepare("SELECT order_item_id FROM {$wpdb->prefix}woocommerce_order_items WHERE order_item_name = $unit_title")); // //$order_id = $order_results->order_item_id; $item_line = $wpdb->get_var($wpdb->prepare("SELECT _line_total FROM {$wpdb->prefix}woocommerce_order_itemmeta WHERE order_item_id = $order_results")); echo $item_line; endwhile; }