I’d like to add a button under the “Add to Cart” button which says “Buy on Amazon” and links to my Amazon product page [closed]

You can copy this code to your functions.php and you will add a button under Add to Cart Button. add_action( ‘woocommerce_after_add_to_cart_button’, ‘content_after_addtocart_button’ ); function content_after_addtocart_button() { echo ‘<div class=”content-section”><br><br><a href=”https://www.google.com/”><input id=”amazonBtn” type=”button” value=”Buy on Amazon”/></a></div>’; } Change the Google link for your Amazon link.

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.

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