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 | |
// Car rental plugin - booking form | |
add_action('woocommerce_new_order', 'wpgens_save_source_tracker_meta', 10, 1); | |
function save_source_tracker_meta($order_id) | |
{ | |
if (!isset($_COOKIE['_wpgens_st_data'])) { | |
return; | |
} |
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_action( 'after_setup_theme', function() { | |
$current_user = wp_get_current_user(); | |
/* is guest? */ | |
if ( 0 == $current_user->ID ) { | |
return; | |
} else { | |
/* is not administrator */ |
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 | |
/** | |
* Hook into checkout | |
* | |
* @since 2.0.0 | |
*/ | |
if (!defined('ABSPATH')) { | |
exit; |
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 | |
/** | |
* Hook into checkout | |
* | |
* @since 2.0.0 | |
*/ | |
if (!defined('ABSPATH')) { | |
exit; |
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 | |
/** | |
* Hook into checkout | |
* | |
* @since 2.0.0 | |
*/ | |
if (!defined('ABSPATH')) { | |
exit; |
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 Meta box to Order Screen | |
* @author WPGens | |
*/ | |
if (!defined('ABSPATH')) { | |
exit; | |
} |
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 | |
// Made by Goran from https://wpgens.com | |
add_action( 'wcs_renewal_order_created', 'remove_discount_from_renewal', 10, 2 ); | |
function remove_discount_from_renewal( $renewal_order, $subscription ) { | |
// Check if there is a specific coupon applied that you want to remove | |
foreach ( $renewal_order->get_items('coupon') as $item_id => $item ) { | |
if ( 'specific_coupon_code' === $item->get_code() ) { | |
// Remove the coupon | |
$renewal_order->remove_coupon( $item->get_code() ); |
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 | |
// Made by Goran from https://wpgens.com | |
add_action( 'woocommerce_before_apply_coupon', 'check_order_history_before_coupon' ); | |
function check_order_history_before_coupon( $coupon_code ) { | |
// Assuming 'firstorder' is your coupon code | |
if ( strtolower( $coupon_code ) !== 'firstorder' ) { | |
return; | |
} |
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
add_filter('wpgens_raf_code','gens_raf_code',10,1); | |
function gens_raf_code($raf_code) { | |
if( !current_user_can('manage_options')) { | |
return 'Referral code is available only to Editors'; | |
} | |
return $raf_code; | |
} | |
add_filter('wpgens_raf_link','gens_raf_link',10,3); | |
function gens_raf_link($raf_link, $referral_id, $type) { | |
if( !current_user_can('manage_options')) { |
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
class Custom_RAF_Status | |
{ | |
/** | |
* Hook in order meta boxes and save order meta | |
* | |
* @since 2.0.0 | |
*/ | |
public function __construct() | |
{ |
NewerOlder