Skip to content

Instantly share code, notes, and snippets.

View wsenjer's full-sized avatar
🇵🇸
Focusing

Waseem Senjer wsenjer

🇵🇸
Focusing
View GitHub Profile
@wsenjer
wsenjer / functions.php
Last active September 23, 2020 11:49 — forked from frankschrijvers/functions.php
Hide AUS_PARCEL_EXPRESS
/**
* woocommerce_package_rates is a 2.1+ hook
*/
add_filter( 'woocommerce_package_rates', 'hide_express_post', 10, 2 );
/**
* Hide shipping rates when free shipping is available
*
* @param array $rates Array of rates found for the package
* @param array $package The package array/object being shipped
@wsenjer
wsenjer / functions.php
Created August 1, 2017 22:50
Change WC order status
<?php
function my_change_status_function() {
 global $wp;
if ( ! empty( $wp->query_vars['order-received'] ) ) {
$order_id  = absint( $wp->query_vars['order-received'] );
$order_key = isset( $_GET['key'] ) ? wc_clean( $_GET['key'] ) : '';
@wsenjer
wsenjer / gist:eda4b6fa622f038089bc2b67f95da205
Last active February 17, 2017 13:57 — forked from mikejolley/gist:3012597
WooCommerce - Manipulate the states
/**
* Code goes in functions.php or a custom plugin. Replace XX with the country code your changing.
*/
add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
function custom_woocommerce_states( $states ) {
$states['PS'] = array(
'Gaza' => 'غزة',
'Rafah' => 'رفح'