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>’; }

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’ );

How to know the page from which a product is added to the cart? – WooCommerce

Please try below code : In this display only page/post URL and page/post ID. You need to store page ID/URL and can get from database. NOTE : This is code working only in details page. function custom_to_cart_item( $cart_item_data, $product_id, $variation_id ) { $page_url = wp_get_referer(); $page_id = url_to_postid( $page_url ); } add_filter( ‘woocommerce_add_cart_item_data’, ‘custom_to_cart_item’, 10, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)