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( 'fkcart_reward_enabled', function ( $status ) { | |
if ( is_null( WC()->cart ) ) { | |
return false; | |
} | |
$cart_items = WC()->cart->get_cart(); | |
$tmp_category_id = [ 19 ]; // Your category ID here (for more categories, keep them comma separated) | |
foreach ( $cart_items as $cart_item ) { |
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_action( 'fkcart_quick_before_view_content', function () { | |
add_filter( 'woocommerce_reset_variations_link', function () { | |
$text = '<a class="reset_variations" href="#">' . esc_html__( 'Reset to Default 21', 'woocommerce' ) . '</a>'; | |
return $text; | |
} ); | |
} ); |
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( 'wfacp_checkout_fields', function ( $template_fields, $fields ) { | |
if ( isset( $fields['billing']['billing_nif'] ) ) { | |
$template_fields['billing']['billing_nif'] = $fields['billing']['billing_nif']; | |
} | |
if ( isset( $fields['shipping']['shipping_nif'] ) ) { | |
$template_fields['shipping']['shipping_nif'] = $fields['shipping']['shipping_nif']; |
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_action('woocommerce_checkout_create_order',function ($order){ | |
/** | |
* @var $order WC_Order | |
*/ | |
if(isset($_POST['billing_nif'])){ | |
$order->add_meta_data('billing_nif', $_POST['billing_nif']); | |
} | |
if(isset($_POST['shipping_nif'])){ | |
$order->add_meta_data('shipping_nif', $_POST['shipping_nif']); |
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_action( 'init', function () { | |
// Flytt Vipps-knappen fra cart actions til under proceed to checkout | |
remove_action( 'woocommerce_cart_actions', [ Vipps::instance(), 'cart_express_checkout_button' ] ); | |
add_action( 'woocommerce_proceed_to_checkout', [ Vipps::instance(), 'cart_express_checkout_button' ], 20 ); | |
add_action( 'fkcart_before_checkout_button', function () { | |
echo "<div class='fkcart-checkout-wrap fkcart-panel'>"; | |
Vipps::instance()->cart_express_checkout_button(); | |
echo "</div>"; | |
}, 20 ); |
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_action('woocommerce_add_to_cart', 'apply_coupon_on_specific_product'); | |
function apply_coupon_on_specific_product($cart_item_key) { | |
$product_ids = array(93, 456); // Replace with your specific product IDs | |
$coupon_code = 'pro2'; // Replace with your coupon code | |
foreach (WC()->cart->get_cart() as $cart_item) { | |
if (in_array($cart_item['product_id'], $product_ids)) { | |
if (!WC()->cart->has_discount($coupon_code)) { | |
WC()->cart->apply_coupon($coupon_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
// Define GTM Server Container URL (replace with your container endpoint) | |
$gtmEndpoint = "https://<your-gtm-server>.appspot.com"; | |
// Example Conversion Data | |
$data = [ | |
"event_name" => "purchase", // Event name, e.g., 'purchase', 'lead' | |
"conversion_tracking_id" => "AW-XXXXXXX", // Replace with your Google Ads conversion ID | |
"transaction_id" => "12345", // Unique transaction ID | |
"value" => 100.0, // Conversion value | |
"currency" => "USD", // Currency code | |
"user_data" => [ |
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
/** | |
* Filter to add statement descriptor for payment intent request | |
*/ | |
add_filter( 'fkwcs_payment_intent_data', function ( $request ) { | |
if ( true !== in_array( 'card', $request['payment_method_types'], true ) ) { | |
$request['statement_descriptor'] = 'YOUR_DESCRIPTOR_HERE'; | |
} | |
return $request; | |
} ); |
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_action( 'admin_head', function () { | |
if ( class_exists( 'WFFN_Stripe_Admin_Controller' ) ) { | |
remove_action( 'wp_before_admin_bar_render', [ WFFN_Stripe_Admin_Controller::get_instance(), 'custom_add_fk_stripe_menu' ] ); | |
} | |
} ); |
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 WFACP_ADD_Custom_Fields_Under_Billing_Shipping { | |
public $custom_fields = []; | |
public function __construct() { | |
$this->assign_variables(); | |
add_action( 'after_setup_theme', [ $this, 'setup_fields' ] ); | |
} | |
public function assign_variables() { |
NewerOlder