Skip to content

Instantly share code, notes, and snippets.

Musilek Vladislav Musilda

Block or report user

Report or block Musilda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View product-based-free-shipping.php
<?php
add_filter( 'woocommerce_package_rates', 'musilda_product_free_shipping', 10, 2 );
function musilda_product_free_shipping( $rates, $package ) {
$free = false;
$items = WC()->cart->get_cart();
foreach($items as $item => $values) {
View extend-fio-blocked-statuses.php
<?php
$statuses = array(
'completed',
'failed',
'cancelled',
'refunded'
);
return apply_filters( 'fio_blocked_order_statuses', $statuses );
View order-product-categories-by-menu_order
<?php
$args = array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
'meta_key' => 'order',
'orderby' => 'meta_value_num',
'parent' => 0
);
View idoklad-itam-name-with-sku.php
<?php
//Add sku code into item name for invoice
add_filter( 'idoklad_order_item_name', 'custom_idoklad_item_name', 10, 2 );
function custom_idoklad_item_name( $name, $data ){
$_product = wc_get_product( $data['variation_id'] ? $data['variation_id'] : $data['product_id'] );
$sku = $_product->get_sku();
if( !empty( $sku ) ){
$name = $name . ' ' . $sku;
}
View free_shipping_for_ceska_posta.php
<?php
add_filter( 'zasilkovna_cp_cz_cost', 'cz_post_free_shipping' );
function cz_post_free_shipping( $cost ){
$total = WC()->cart->get_cart_contents_total();
if( $total > 3000 ){
return 0;
}
View change_cost_zasilkovna_for_product.php
<?php
add_filter( 'zasilkovna_shipping_cost', 'change_cost_zasilkovna_for_product' );
function change_cost_zasilkovna_for_product( $cost ){
$items = WC()->cart->get_cart();
foreach($items as $item => $values) {
if( $values['data']->get_id() == 31 ){
$cost = $cost * 3;
View zasilkovna_hide_for_big_package
<?php
add_filter( 'zasilkovna_shipping_cost', 'hide_zasilkovna_for_big_package' );
function hide_zasilkovna_for_big_package( $cost ){
$items = WC()->cart->get_cart();
foreach($items as $item => $values) {
$_product = wc_get_product( $values['data']->get_id() );
$lenght = $_product->get_length();
if( $lenght > 50 ){
View add-columns-to-orders.php
<?php
add_filter( 'manage_edit-shop_order_columns', 'barcode_column', 99999 );
add_filter( 'manage_edit-page_columns', 'barcode_column', 99999 );
function barcode_column($columns) {
$new_columns = array();
foreach($columns as $key => $item){
$new_columns[$key] = $item;
if($key == 'cb'){
$new_columns['zasilkovna'] = __( 'Barcode', 'skoleni' );
View add-custom-button-to-order-action.php
<?php
// Add your custom order status action button (for orders with "processing" status)
add_filter( 'woocommerce_admin_order_actions', 'add_custom_order_status_actions_button', 100, 2 );
function add_custom_order_status_actions_button( $actions, $order ) {
// Display the button for all orders that have a 'processing' status
if ( $order->has_status( array( 'processing' ) ) ) {
// Get Order ID (compatibility all WC versions)
$order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
View add-column-to-order-list.php
<?php
add_filter( 'manage_edit-shop_order_columns', 'toret_barcode_column', 99999 );
function barcode_column($columns) {
$new_columns = array();
foreach($columns as $key => $item){
$new_columns[$key] = $item;
if($key == 'cb'){
$new_columns['barcode'] = __( 'Barcode', 'woocommerce' );
}
You can’t perform that action at this time.