How to add contact seller button in product page

You can use woocommerce_single_product_summary hook to add custom button in the single product page in WooCommerce. Please check following example. Custom link added and button class is given to display it like a button. add_action( ‘woocommerce_single_product_summary’, ‘wpso_add_seller_button’, 15 ); function wpso_add_seller_button() { echo ‘<a href=”https://example.com” class=”button”>Contact Seller</a>’; }

Add Product Permalink in woocommerce admin order page

There’s no permalink property of a product. Permalinks are not stored in the database, because they’re generated based on a number of external factors. Therefore you need to use a function to retrieve the permalink. In WooCommerce the best way to do this is with: function fpd_custom_order_item_values($_product) { $url = $_product->get_permalink(); echo ‘<p>’ . esc_url( … Read more

Enable Payment gateway if ACF checkbox in user profile is checked

Found my solution /* * Enable COD for account holder */ function enable_cod_payment( $available_gateways ) { global $woocommerce; $user = wp_get_current_user(); $user_status = get_field(‘account_holder’, $user ); if ($user_status == ‘Yes’) { $available_gateways[‘cod’]; unset( $available_gateways[‘authorize_net_cim_credit_card’] ); } else { unset( $available_gateways[‘cod’] ); } return $available_gateways; } add_filter( ‘woocommerce_available_payment_gateways’, ‘enable_cod_payment’ );