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_filter( 'woocommerce_single_product_carousel_options', 'filter_single_product_carousel_options' ); | |
function filter_single_product_carousel_options( $options ) { | |
$options['slideshow'] = true; | |
$options['animationLoop'] = true; | |
$options['slideshowSpeed'] = 3000; | |
return $options; | |
} |
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( 'admin_notices', 'fix_wc_notice_472021' ); | |
/* | |
* Change notice 'name' as needed. | |
*/ | |
function fix_wc_notice_472021() { | |
global $wpdb; | |
$wpdb->update( $wpdb->prefix . 'wc_admin_notes', ['status'=>'actioned'], ['name'=>'woocommerce-core-paypal-march-2022-updated'] ); | |
} |
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
const defaultParams = { | |
title: '', | |
titleText: '', | |
text: '', | |
html: '', | |
footer: '', | |
icon: undefined, | |
iconColor: undefined, | |
iconHtml: undefined, | |
template: undefined, |
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
document.addEventListener('DOMContentLoaded', function () { | |
// Check if we're on a product category archive page | |
if (document.body.classList.contains('archive') && document.body.classList.contains('woocommerce')) { | |
// Get a reference to the select element | |
const sortingSelect = document.querySelector('.woocommerce-ordering select'); | |
// Hide the default select box | |
sortingSelect.style.display = 'none'; | |
// Create a new div for the sorting buttons |
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 a custom filter to the query | |
add_action('pre_get_posts', 'featured_products_admin_filter_query'); | |
function featured_products_admin_filter_query($query) { | |
global $pagenow; | |
if (is_admin() && $pagenow == 'edit.php' && isset($_GET['post_type']) && $_GET['post_type'] == 'product' && isset($_GET['is_featured']) && $_GET['is_featured'] == '1') { | |
$query->set('tax_query', array( | |
array( | |
'taxonomy' => 'product_visibility', | |
'field' => 'name', | |
'terms' => 'featured', |
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
// Tested with Turkish letters like İ or Ğ, should work with other languages as well like German Ç or Czech Č etc. etc. | |
add_filter( 'woocommerce_coupon_code', 'make_coupons_case_insensitive' ); | |
function make_coupons_case_insensitive( $coupon_code ) { | |
// Convert special characters to ASCII | |
$coupon_code = iconv('UTF-8', 'ASCII//TRANSLIT', $coupon_code); | |
// Change all coupon codes to lowercase | |
return strtolower( $coupon_code ); | |
} |
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
edit_themes | |
activate_plugins | |
edit_plugins | |
edit_users | |
edit_files | |
manage_options | |
moderate_comments | |
manage_categories | |
manage_links | |
upload_files |
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
You should be able to access them via | |
$params = $request->get_params(); | |
normally, if you cant, try these: | |
$request->get_body_params(),$request->get_url_params()) | |
$request->get_body(); | |
Also make sure you are using "application/x-www-form-urlencoded" and NOT "form-data" |