Skip to content

Instantly share code, notes, and snippets.

View Uriel1339's full-sized avatar

Andreas Lopez Uriel1339

View GitHub Profile
@rynaldos-zz
rynaldos-zz / wc-upsells-increase.php
Last active March 20, 2021 02:38
[WooCommerce 3.0] Change number of upsells on single products
add_filter( 'woocommerce_output_related_products_args', 'wc_change_number_related_products' );
function wc_change_number_related_products( $args ) {
$args['posts_per_page'] = 1;
$args['columns'] = 4; //change number of upsells here
return $args;
}
@Jerry0022
Jerry0022 / PHP Google oAuth2.php
Last active February 27, 2021 22:37
Google oAuth2, sign up, sign in, logout and show user data. Need to set REDIRECT_URL from google developer console and the https://github.com/google/google-api-php-client cloned in the web directory.
<?php
// Enable error reporting
error_reporting(E_ALL);
ini_set('display_errors', 1);
$google_redirect_url = 'REDIRECT_URL';
//start session
session_start();