Skip to content

Instantly share code, notes, and snippets.

Avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / remove all query string from address bar liek ?add-to-cart, after page load
Created Dec 8, 2021
remove all query string from address bar liek ?add-to-cart, after page load
View remove all query string from address bar liek ?add-to-cart, after page load
add_action( 'wfacp_internal_css', function () {
?>
<script>
window.addEventListener('bwf_checkout_load', function () {
window.history.pushState(null, null, window.location.origin + window.location.pathname);
});
</script>
<?php
} );
View germany-custom-address.php
add_action( 'wfacp_internal_css', function () {
?>
<script>
window.addEventListener('bwf_checkout_load', function () {
wfacp_frontend.hooks.addFilter('wfacp_country_address_google_format', function (country_format, format, code) {
if (code == 'de') {
country_format._address_1 = {'keys': {'route': 'long_name'}, 'separator': ' '};
country_format._address_2 = {
'keys': {'street_number': 'long_name'},
'separator': ' '
@xlplugins
xlplugins / AeroCheckout: Oxygen Editor Break due to `Yaad Sarig Payment Gateway` this gateway reload the editor
Created Dec 8, 2021
AeroCheckout: Oxygen Editor Break due to `Yaad Sarig Payment Gateway` this gateway reload the editor
View AeroCheckout: Oxygen Editor Break due to `Yaad Sarig Payment Gateway` this gateway reload the editor
add_action('wfacp_internal_css',function ($status){
if(WFACP_Common::is_theme_builder()){
remove_action('woocommerce_before_checkout_form', 'yaad_break_out_of_frames');
}
return $status;
});
@xlplugins
xlplugins / Create_Confirm_Email_Field
Last active Dec 6, 2021
Create confirm Email field after email field
View Create_Confirm_Email_Field
class Create_Confirm_Email_Field {
public function __construct() {
add_action( 'wfacp_after_billing_email_field', [ $this, 'create_field' ] );
add_action( 'wfacp_template_load', [ $this, 'action' ] );
}
@xlplugins
xlplugins / uk-sublocality-in-checkout
Created Dec 6, 2021
UK sublocality field in checkout
View uk-sublocality-in-checkout
<script>(function (){
window.addEventListener('bwf_checkout_load',function(){
wfacp_frontend.hooks.addFilter('wfacp_countries_address_format', function(format){
format.gb._address_1={'keys': {'street_number': 'long_name', 'route': 'long_name', 'sublocality_level_1': 'long_name', 'sublocality_level_2': 'long_name'}, 'separator': ', '};
return format;
});
})
})();</script>
@xlplugins
xlplugins / gist:86cc7b286666fe159458fa9ffef16a41
Last active Dec 7, 2021
Compatability plugin with DIGITS: Merge Phone Number Addon
View gist:86cc7b286666fe159458fa9ffef16a41
class WFACP_Do_Not_Fill_username {
public function __construct() {
add_action( 'wfacp_internal_css',[$this,'add_css'] );
}
public function add_css(){
@xlplugins
xlplugins / Woofunnel_Disable_Side_Cart
Created Dec 3, 2021
Disabled side cart of plugin Woocommerce Side Cart Premium By XootiX
View Woofunnel_Disable_Side_Cart
class Woofunnel_Disable_Side_Cart {
public function __construct() {
add_action( 'wfacp_after_checkout_page_found', [ $this, 'action' ] );
add_action( 'wp', [ $this, 'remove_offer_action' ] );
}
public function remove_offer_action() {
global $post;
@xlplugins
xlplugins / gist:aa734172bd18ba9eb9cf91cdfc2b4e34
Created Dec 3, 2021
pass order total and order ID and Order Data in script on Thank you page
View gist:aa734172bd18ba9eb9cf91cdfc2b4e34
add_action( 'woocommerce_thankyou', function ( $order_id ) {
$order = wc_get_order( $order_id );
if ( $order instanceof WC_Order ) {
?>
<script src="https://app.bentonow.com/c5f06303f8a5af309e3d3084f4dd7882.js"></script>
<script>
if (typeof(bento$) != 'undefined') {
bento$(function() {
bento.identify(<?php echo $order->get_billing_email(); ?>);
@xlplugins
xlplugins / Disable Aerocheckout page At Phone Order page
Created Dec 2, 2021
Disable Aerocheckout page At Phone Order page by ignitwoo
View Disable Aerocheckout page At Phone Order page
add_filter( 'wfacp_skip_checkout_page_detection', function ( $status ) {
if ( false !== strpos( $_SERVER['REQUEST_URI'], '/phone-order/' ) ) {
return true;
}
return $status;
} );
@xlplugins
xlplugins / gist:fb1d988bc15e69a11a082424994f25fa
Created Dec 2, 2021
Set Shipping method pre selected when cart total is greater than 50
View gist:fb1d988bc15e69a11a082424994f25fa
if ( ! class_exists( 'WFACP_TT_FREE_Shipping' ) ) {
class WFACP_TT_FREE_Shipping {
private $run = false;
public function __construct() {
add_action( 'woocommerce_after_calculate_totals', [ $this, 'set_shipping' ] );
}