This file contains 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 ($) { | |
{ | |
var visited = Cookies.get('visited'); | |
if (visited == undefined) { | |
Cookies.set('visited', 0, {path: '/'}); | |
} | |
else if (visited < 2) { | |
Cookies.set('visited', ++visited, {path: '/'}); | |
} | |
else if (visited == 2) { |
This file contains 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
<?php | |
/** | |
* Plugin Name: EVD - Card Discount Rules | |
* Plugin URI: https://rwky.ro | |
* Description: Discount rules for cart | |
* Version: 1.0 | |
* Author: Eduard Vasile Doloc | |
* Author URI: http://rwky.ro | |
* Developer: Eduard Vasile Doloc | |
* Developer URI: http://rwky.ro |
This file contains 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_after_shop_loop_item_title', 'loc_show_free_shipping_badge' ); | |
function loc_show_free_shipping_badge() { | |
global $post, $product; | |
if ( $product && $product->get_price() >= 100 ) { | |
echo '<span class="free-shipping">' . __( 'Livrare Gratuită!' ) . '</span>'; | |
} | |
} |
This file contains 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 add_after_product_title_rwk() {?> | |
<p class="small"><?php echo 'hello world'; ?></p> | |
<?php } | |
add_action( 'woocommerce_single_product_summary', 'add_after_product_title_rwk', 6 ); |
This file contains 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 customer email to Cancelled Order recipient list | |
*/ | |
function wc_cancelled_order_add_customer_email( $recipient, $order ){ | |
return $recipient . ',' . $order->billing_email; | |
} | |
add_filter( 'woocommerce_email_recipient_cancelled_order', 'wc_cancelled_order_add_customer_email', 10, 2 ); |
This file contains 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 rwk_redirect_b2b() { | |
if ( | |
! is_user_logged_in() | |
&& (is_woocommerce() || is_cart() || is_checkout()) | |
) { | |
// feel free to customize the following line | |
wp_redirect( site_url('autentificare/') ) | |
exit; | |
} | |
} |
This file contains 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_admin_order_data_after_order_details', 'failed_orders_evd', 10, 2 ); | |
function failed_orders_evd( $order ) { | |
$customer_orders = get_posts( array( | |
'numberposts' => -1, | |
// 'meta_key' => '_customer_user', | |
'meta_value' => $order->get_billing_email(), | |
'post_type' => 'shop_order', | |
'post_status' => array('wc-failed'), | |
) ); |
This file contains 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
select post_id from wprh_postmeta pm where pm.post_in not in (select ID from wprh_posts) |
This file contains 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
// remove admin notices except admin | |
add_action('admin_head', function() { | |
if(!current_user_can('manage_options')){ | |
remove_action( 'admin_notices', 'update_nag', 3 ); | |
remove_action( 'admin_notices', 'maintenance_nag', 5 ); | |
echo "<style>.notice, .update-nag , .error, .updated{ display:none!important; }</style>"; | |
} | |
}); | |
@todo: find all actions and remove them and if it's not enough, CSS will do the trick! |
This file contains 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 the column, we need to display it, right? | |
function wc_order_extras_column_evd( $columns ) { | |
$new_columns = array(); | |
foreach ( $columns as $column_name => $column_info ) { | |
$new_columns[ $column_name ] = $column_info; | |
if ( 'order_total' === $column_name ) { | |
$new_columns['order_phone'] = __( 'Phone no.', 'rwky_ro' ); | |
} | |
} | |
return $new_columns; |
OlderNewer