Skip to content

Instantly share code, notes, and snippets.

View majeedraza1's full-sized avatar
🎯
Focusing

Majeed Raza majeedraza1

🎯
Focusing
View GitHub Profile
<?php
/**
* When you hover a product image when on the single product page, you can zoom on the products images; I love this feature, however
* Some people would like to remove it.
* To do so, simply paste this snippet in your functions.php file
*/
add_action( 'after_setup_theme', 'theme_name_setup' );
function theme_name_setup() {
remove_theme_support( 'wc-product-gallery-zoom' );
<?php
/*
* Create order dynamically
*/
add_action( 'woocommerce_before_checkout_form', 'create_order' );
function create_order() {
global $woocommerce;
/*
* Remove the default WooCommerce 3 JSON/LD structured data format
*/
function remove_output_structured_data() {
remove_action( 'wp_footer', array( WC()->structured_data, 'output_structured_data' ), 10 ); // Frontend pages
remove_action( 'woocommerce_email_order_details', array( WC()->structured_data, 'output_email_structured_data' ), 30 ); // Emails
}
add_action( 'init', 'remove_output_structured_data' );