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_theme_high_lite { | |
private $fields = []; | |
public function __construct() { | |
//add_filter( 'woocommerce_checkout_fields', [ $this, 'fetch_field' ], - 10 ); | |
add_filter( 'wfacp_checkout_fields', [ $this, 'push_field' ], 100,2 ); | |
} | |
public function fetch_field( $fields ) { |
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
// Function to store the coupon in the session on the homepage | |
function store_coupon_in_session() { | |
if ( ! is_checkout() && class_exists( 'WooCommerce' ) ) { | |
// Replace 'your-coupon-code' with your actual coupon code | |
$coupon_code = 'test'; | |
// Save the coupon code in WooCommerce session | |
WC()->session->set( 'stored_coupon_code', $coupon_code ); | |
// Apply coupon immediately if the cart is initialized |
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 FKCART_Woo_Discount_Rule { | |
public function __construct() { | |
add_filter( 'fkcart_enable_item_link', [ $this, 'add_item_meta' ] ); | |
} | |
public function add_item_meta( $status ) { |
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('woocommerce_package_rates', 'remove_free_shipping_for_recurring_cart', 10, 2); | |
function remove_free_shipping_for_recurring_cart($rates, $package) { | |
// Check if it's a recurring cart | |
if (isset($package['recurring_cart_key'])) { | |
// Loop through the rates | |
foreach ($rates as $rate_id => $rate) { | |
// Check if the rate is for free shipping | |
if ('free_shipping' === $rate->method_id) { | |
// Unset the free shipping rate | |
unset($rates[$rate_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
<script> | |
jQuery(document).ready(function($) { | |
$(document.body).on('wfacp_step_switching', function(e, v) { | |
console.log(e, v); // This will log the event and the step object | |
if (v.current_step === 'two_step') { | |
// Your custom jQuery code for the second step goes here | |
console.log("User has reached the second step!"); | |
// Example: Change the background color of the body |
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 address fields auto for the Credit card fields | |
*/ | |
add_filter( 'fkwcs_stripe_payment_element_data', function ( $element_config ) { | |
$element_config['element_options']['fields']['billingDetails'] = []; | |
$element_config['element_options']['fields']['billingDetails']['address'] = 'auto'; | |
return $element_config; | |
} ); |
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 FKCART_FastCredit_For_WC { | |
private $subtotal_price = null; | |
private $text_find = 'Credit'; | |
public function __construct() { | |
add_filter( 'fkcart_enable_item_link', [ $this, 'add_item_meta' ] ); | |
add_action( 'wfacp_after_template_found', [ $this, 'actions' ] ); | |
} |
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
function render_custom_script_tracking( $general_data ) { | |
if ( ! is_array( $general_data ) || 0 === count( $general_data ) ) { | |
return; | |
} | |
$order_id = isset( $general_data['order_id'] ) ? $general_data['order_id'] : 0; | |
if ( 0 === $order_id && isset( $_GET['order_id'] ) ) { | |
$order_id = $_GET['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
class Add_Custom_Fee_On_Change_Checkbox { | |
private $field_lable = 'Shipping Way Fee'; | |
private $checkout_fields = [ | |
'shipping_way_0' => [ | |
'label' => 'Fast shipping', | |
'price' => 10 | |
], | |
'shipping_way_1' => [ | |
'label' => 'Deliver in evening', |
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
// Note - Do not add any product here https://i.imgur.com/mcVGiNP.png | |
class WFFN_Change_Action_Of_Add_To_Cart { | |
public $checkout_url = 'http://funnellocal1.local/checkouts/checkout-copy-4/'; // redirect to this link | |
public function __construct() { | |
add_action( 'wfacp_after_checkout_page_found', [ $this, 'remove_notice' ] ); | |
add_filter( 'woocommerce_add_to_cart_form_action', [ $this, 'change_form_action' ] ); | |
} |
NewerOlder