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 | |
class db{ | |
protected $con = false; | |
public function __destruct(){ | |
return null; | |
} | |
public function connect($dbhost, $dbname, $dbuser, $dbpass){ |
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 | |
/** | |
* Redirect users after add to cart. Works with WooCommerce 3.0+ | |
*/ | |
function custom_add_to_cart_redirect( $url ) { | |
$url = WC()->cart->get_checkout_url(); | |
return $url; | |
} | |
add_filter( 'woocommerce_add_to_cart_redirect', 'custom_add_to_cart_redirect' ); |
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 | |
/** | |
* Empty cart. New product will be added. Works with WooCommerce 3.0+ | |
*/ | |
add_filter( 'woocommerce_add_to_cart_validation', 'custom_only_one_in_cart', 99, 2 ); | |
function custom_only_one_in_cart( $passed, $added_product_id ) { | |
wc_empty_cart(); | |
return $passed; | |
} |
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_filter( 'wc_add_to_cart_message_html', '__return_null' ); |
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
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.ResultSetMetaData; | |
import java.sql.Statement; | |
import java.util.ArrayList; | |
import java.util.LinkedHashMap; | |
import java.util.Map.Entry; | |
import java.util.regex.Matcher; |