This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Woocommerce disable payment gateway by shipping method. | |
*/ | |
add_filter( 'woocommerce_available_payment_gateways', 'venus_payment_method_by_shipping' ); | |
function venus_payment_method_by_shipping( $gateways ) { | |
if( is_admin() ) { // do nothing in /wp-admin | |
return $gateways; | |
} | |
if( is_wc_endpoint_url( 'order-pay' ) ) { // "Pay for order" page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove Taxes from order | |
* | |
* @param array $variables get variables. | |
* @param int $order_id get order id. | |
* @return array | |
*/ | |
function wave_order_variable( $variables, $order_id ) { | |
$items = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add some Specific User role User | |
* | |
* @param array $friend_ids | |
* @param int $user_id | |
* @return array | |
*/ | |
function buc_add_friends_in_list( $friend_ids, $user_id ) { | |
$users_role = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set Invoice number as order id | |
* | |
* @param array $variables get variables. | |
* @param int $order_id get order id. | |
* @return array | |
*/ | |
function wave_order_variable( $variables, $order_id ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Update my profile data before get BUC chat | |
* | |
* @param array $profile Get my profile data. | |
* @return array | |
*/ | |
function buc_update_my_profile_data( $profile ) { | |
$user_info = get_userdata( $profile['id'] ); | |
$first_name = $user_info->first_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Update my profile data before get BUC chat | |
* | |
* @param array $profile Get my profile data. | |
* @return array | |
*/ | |
function buc_update_my_profile_data( $profile ) { | |
// If set custom profile image. | |
$custom_image = 'http://demo.wpvenus.com/bp-better-user-chat/wp-content/uploads/2020/06/Venus.png'; // Custom image url. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hide BUC chat frame if select Specific Users option. | |
* | |
* @return void | |
*/ | |
function buc_hide_chat_frame() { | |
if( is_user_logged_in() ) { | |
global $venus_buc; | |
$settings = $venus_buc->get_settings(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set custom guest user variable for WooCommerce Wave Connector | |
* Remove province code in guest user variable. | |
* | |
* @param array $variable get variable. | |
* @param array $order_id get order id. | |
* @return array | |
*/ | |
function venus_wc_custom_guest_user_variable( $variable, $order_id ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set custom user variable for WooCommerce Wave Connector | |
* Replace display name with first name & last name in name value | |
* | |
* @param array $variables get variables. | |
* @param array $user_ids get user's id. | |
* @return array | |
*/ | |
function custom_customer_variable( $variables, $user_ids ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set custom user variable for WooCommerce Wave Connector | |
* Remove province code in user variables. | |
* | |
* @param array $variable get variables. | |
* @param array $user_id get user id. | |
* @return array | |
*/ | |
function venus_wc_custom_user_variable( $variable, $user_id ) { |