Skip to content

Instantly share code, notes, and snippets.

View woogists's full-sized avatar

WooGists woogists

View GitHub Profile
@woogists
woogists / wc-change-the-speed.php
Last active March 9, 2018 15:23
[WooCommerce 360 Image] Change the speed of the animation
add_filter( 'wc360_js_speed', 'wcs_360_custom_speed' );
function wcs_360_custom_speed() {
return 30;
}
@woogists
woogists / wc-anti-fraud-remove-risk-countries.php
Created March 9, 2018 15:17
[WooCommerce Anti Fraud] You can add or remove risk countries by using the ‘wc_af_rule_countries’ filter.
function wc_af_example_rule_countries( $countries ) {
$countries[] = 'NL'; // Adding The Netherlands as a risk country
return $countries;
}
add_filter( 'wc_af_rule_countries', 'wc_af_example_rule_countries' );
@woogists
woogists / wc-ninja-forms-product-add-ons-hide-sub-prices.php
Created March 9, 2018 15:22
[WooCommerce Ninja Forms Product Add-ons] Hide All Sub Prices
/*
* Snippet to hide all sub prices
* Code goes in the functions.php file in your theme.
*/
add_filter( 'wc_nf_addons_cart_option', 'wc_ninja_forms_price' );
function wc_ninja_forms_price( $display ) {
return '';
}
@woogists
woogists / wc-360-rotate90.php
Created March 9, 2018 15:56
[WooCommerce 360 Image] Custom Rotation
/* Rotate 360 Image 90 Degrees */
.threesixty .threesixty_images img {
-ms-transform: rotate(90deg); /* IE 9 */
-webkit-transform: rotate(90deg); /* Chrome, Safari, Opera */
transform: rotate(90deg);
}
@woogists
woogists / wc-rotate-minus90degrees.php
Created March 9, 2018 15:58
[WooCommerce 360 Image] Rotate -90 degrees
/* Rotate 360 Image -90 Degrees */
.threesixty .threesixty_images img {
-ms-transform: rotate(-90deg); /* IE 9 */
-webkit-transform: rotate(-90deg); /* Chrome, Safari, Opera */
transform: rotate(-90deg);
}
@woogists
woogists / wc-rotate180degrees.php
Created March 9, 2018 15:59
[WooCommerce 360 Image] Rotate 360 Image 180 Degrees
/* Rotate 360 Image 180 Degrees (upside down) */
.threesixty .threesixty_images img {
-ms-transform: rotate(180deg); /* IE 9 */
-webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */
transform: rotate(180deg);
}
@woogists
woogists / wc-order-barcodes-security-check-failed.php
Created March 9, 2018 16:03
[WooCommerce Order Barcodes] Security Check Failed
/*
* Snippet to prevent security check failed error.
* Code goes in the functions.php file in your theme.
*/
add_filter( 'woocommerce_order_barcodes_do_nonce_check', 'disable_woocommerce_order_barcodes_nonce_check' );
function disable_woocommerce_order_barcodes_nonce_check( $do_check ) {
// Do any required pressing here
$do_check = false;
@woogists
woogists / wc-filter-imagesize.php
Created March 9, 2018 16:03
[WooCommerce 360 Image] Filter image size
add_filter( 'wc360_image_size', 'wcs_360_image_name' );
function wcs_360_image_name() {
return 'shop_thumbnail';
}
@woogists
woogists / wc-order-barcodes-no-sufficient-permission-error-fix.php
Created March 9, 2018 16:05
[WooCommerce Order Barcodes] Fixes No Sufficient Permission To Scan Barcodes Error
/*
* Snippet to fix No Sufficient Permission To Scan Barcodes Error.
* Code goes in the functions.php file in your theme.
*/
add_filter( 'woocommerce_order_barcodes_scan_permission', 'modify_woocommerce_order_barcodes_scan_permission' );
function modify_woocommerce_order_barcodes_scan_permission( $has_permission ) {
// Do any required permission checks here
$has_permission = true;
return $has_permission;
@woogists
woogists / wc-do-not-output-full-size.php
Created March 9, 2018 16:06
[WooCommerce 360 Image] Do not output the default full size
add_filter( 'wc360_output_image_size', 'wcs_360_image_size_output' );
function wcs_360_image_size_output() {
return 'shop_single';
}