WooCommerce, after moving reviews tab to under product description. If pagination link is clicked description is hidden

The active tab is set in woocommerce/assets/js/frontend/single-product.js. Starting at line 11 this file looks for the words “comments” “reviews” or “tab-reviews” in the page url, and if found, it uses jQuery to click on the review tab. Since there is no review tab anymore, nothing gets clicked. To solve this issue I overrode WooCommerce’s single-product.js … Read more

Restrict the shop_manager role to the WooCommerce Orders Page

I finally found the solution. function checkUserPermissionsInThisScreen(){ if (is_admin()){ $currentUserRoles = wp_get_current_user()->roles; if (in_array(‘shop_manager’, $currentUserRoles)){ $a = get_current_screen(); if ($a->id != ‘edit-shop_order’ && $a->post_type != ‘shop_order’){ wp_die(‘you do not have needed permissions to see this page’); } } } } add_action(‘current_screen’, ‘checkUserPermissionsInThisScreen’);

show payment receipt in woocommerce thankyou page with custom payment gateway?

You can try and use the WC session: Documentation URL: https://docs.woocommerce.com/wc-apidocs/class-WC_Session.html StackOverflow discussion. https://stackoverflow.com/questions/27199656/how-to-use-session-in-woocommerce-pages-like-we-use-normal-php-session And once you get to the Thank you page you’ll destroy it. Haven’t tried it yet by coding it but that should work.

Getting custom field data from cart page to checkout page in woocomerce [closed]

Solved by adding this code /** * Update the order meta with field value **/ add_action( ‘woocommerce_checkout_update_order_meta’, ‘my_custom_checkout_field_update_order_meta’ ); function my_custom_checkout_field_update_order_meta( $order_id ) { ?> <?php if ( ! empty( $_POST[‘from_comments’] ) ) { update_post_meta( $order_id, ‘FROM’, sanitize_text_field( $_POST[‘from_comments’] ) ); } } /** * Update the order meta with field value **/ add_action( ‘woocommerce_checkout_update_order_meta’, … Read more

WooCommerce – item added to order not actually saved? [closed]

You have your duplicate_line_items() function written so that the items from the first parameter, $source_order are added to the second parameter, $new_order, but in your first block of code you’re passing the old order as the 2nd parameter: duplicate_line_items($new_order, $old_order); So all the items from $new_order are being added to $old_order, not the other way … Read more