This file contains hidden or 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
add_action( 'woocommerce_email_header', array( $object, 'email_header' ) ); | |
add_action( 'woocommerce_email_footer', array( $object, 'email_footer' ) ); | |
add_action( 'woocommerce_email_order_details', array( $object, 'order_details' ), 10, 4 ); | |
add_action( 'woocommerce_email_order_details', array( $object, 'order_schema_markup' ), 20, 4 ); | |
add_action( 'woocommerce_email_order_meta', array( $object, 'order_meta' ), 10, 3 ); | |
add_action( 'woocommerce_email_customer_details', array( $object, 'customer_details' ), 10, 3 ); | |
add_action( 'woocommerce_email_customer_details', array( $object, 'email_addresses' ), 20, 3 ); | |
add_action( 'woocommerce_email_order_details', array( $this, 'generate_order_data' ), 20, 3 ); | |
add_action( 'woocommerce_email_order_details', array( $this, 'output_email_structured_data' ), 30, 3 ); | |
This file contains hidden or 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
/** | |
* @author Brad Dalton | |
* @link https://wpsites.net/?p=114708 | |
* @copyright https://wpsites.net/disclosure-privacy/ | |
*/ | |
// Hook to display stock quantity on the product page | |
add_action( 'woocommerce_before_add_to_cart_button', 'display_stock_quantity', 10 ); | |
// Function to display stock quantity for each product |
This file contains hidden or 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
function enqueue_custom_scripts() { | |
wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/js/custom-script.js', array('jquery'), '1.0', true); | |
} | |
add_action('wp_enqueue_scripts', 'enqueue_custom_scripts'); |
This file contains hidden or 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
jQuery(document).ready(function($) { | |
// Add click event to submenu items | |
$('.sub-menu li').on('click', function() { | |
// Remove 'active' class from all submenu items | |
$('.sub-menu li').removeClass('active'); | |
// Add 'active' class to the clicked submenu item | |
$(this).addClass('active'); | |
}); | |
}); |
This file contains hidden or 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
add_action('pre_get_posts', 'wc_exclude_sale_items_from_shop_page'); | |
function wc_exclude_sale_items_from_shop_page($query) { | |
if ( is_admin() || ! $query->is_main_query() ) { | |
return; | |
} | |
// Check if it's the main shop page | |
if ( is_shop() ) { | |
$query->set('meta_query', array( |
This file contains hidden or 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
add_action('woocommerce_settings_tabs_exchange_rates', 'add_exchange_rate_usd_field'); | |
add_action('woocommerce_admin_field_number', 'add_exchange_rate_usd_field'); | |
// Add custom exchange rate field to WooCommerce settings under a new tab | |
function add_exchange_rate_usd_field() { | |
woocommerce_admin_fields(array( | |
array( | |
'type' => 'title', | |
'id' => 'exchange_rates_tab_title', | |
'title' => __('Exchange Rates', 'woocommerce'), |
This file contains hidden or 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
add_action('woocommerce_new_order', 'set_custom_currency_for_manual_orders', 10, 1); | |
function set_custom_currency_for_manual_orders($order_id) { | |
// Check if the order is manual (admin-created) by looking at the order status | |
$order = wc_get_order($order_id); | |
$order_status = $order->get_status(); | |
// Specify the custom currency code you want to set for manual orders | |
$custom_currency_code = 'EUR'; | |
// Check if the order is manual (e.g., status is 'on-hold' for admin-created orders) |
This file contains hidden or 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
$options['rtl'] = true; // Example: Enable right-to-left support | |
$options['animation'] = 'fade'; // Example: Change animation type to fade | |
$options['smoothHeight'] = false; // Example: Disable smooth height transition | |
$options['directionNav'] = true; // Example: Enable direction navigation arrows | |
$options['controlNav'] = 'numbers'; // Example: Use numbers for navigation | |
$options['slideshow'] = true; // Example: Enable slideshow | |
$options['animationSpeed'] = 800; // Example: Change animation speed to 800 milliseconds | |
$options['animationLoop'] = true; // Example: Allow animation looping | |
$options['allowOneSlide'] = true; // Example: Allow carousel with only one slide |
This file contains hidden or 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
function set_default_product_type_variable() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
// Set the default product type to "variable" | |
$('#product-type').val('variable').change(); | |
}); | |
</script> | |
<?php | |
} |
This file contains hidden or 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
@media screen and (max-width: 1024px) { | |
.isotope-item { | |
display: inline-block; | |
width: 48%; /* Adjust the width of each item based on the number of columns you want */ | |
margin: 0 1% 20px; /* Adjust the margin between items and add margin below each item */ | |
vertical-align: top; /* Align items to the top of the container */ | |
box-sizing: border-box; /* Include padding and border in the width and height */ | |
} |