Skip to content

Instantly share code, notes, and snippets.

View joeldasc's full-sized avatar

Joel Davila Soto joeldasc

View GitHub Profile
@ValeriiVasyliev
ValeriiVasyliev / Woocommerce Javascript events.md
Last active August 17, 2023 11:00
Woocommerce Javascript events

Woocommerce Javascript events
Woocommerce Checkout JS events

$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
$( document.body ).trigger( 'applied_coupon_in_checkout' );
@mjrulesamrat
mjrulesamrat / multiple_ssh_keys.md
Last active June 11, 2024 21:09
How to Setup Multiple Ssh Keys for Multiple Github/Bitbucket accounts

How to Setup Multiple Ssh Keys for Multiple Github/Bitbucket accounts

create the SSH keys.

ssh-keygen -t rsa -b 4096 -C "mjrulesamrat@gmail.com"

Add the SSH Keys to the SSH-Agent

@igorbenic
igorbenic / functions-2.php
Last active July 31, 2022 22:26
How to Move Payments on WooCommerce Checkout | https://www.ibenic.com/move-payments-woocommerce-checkout
<?php
/**
* Adding the payment fragment to the WC order review AJAX response
*/
add_filter( 'woocommerce_update_order_review_fragments', 'my_custom_payment_fragment' );
/**
* Adding our payment gateways to the fragment #checkout_payments so that this HTML is replaced with the updated one.
*/
function my_custom_payment_fragment( $fragments ) {
@alokstha1
alokstha1 / functions.php
Created September 14, 2017 08:13
WordPress custom pagination with $wpdb->get_results
<?php
$items_per_page = 2;
$page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
$offset = ( $page * $items_per_page ) - $items_per_page;
$query = 'SELECT * FROM '.$table_name;
$total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
$total = $wpdb->get_var( $total_query );