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
<?php | |
// Asuming you have a default setup | |
// we remove the default tabs | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); | |
// alternative (depending on setup): | |
// add_filter( 'woocommerce_product_tabs', 'my_remove_all_product_tabs', 98 ); | |
// function my_remove_all_product_tabs( $tabs ) { |
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 rwk_order_notes_column( $columns ) { | |
$ordered_columns = array(); | |
foreach ( $columns as $key => $column ) { | |
$ordered_columns[ $key ] = $column; | |
if ( 'order_date' == $key ) { | |
$ordered_columns['order_notes'] = __( 'Order notes', '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('wp_footer', 'add_cookie_notice_function'); | |
function add_cookie_notice_function(){ | |
$url = get_privacy_policy_url(); | |
$link = ''; | |
if (get_privacy_policy_url() != ''){ | |
$link = '<a style="font-size: small; text-align: right" rel="nofollow" href="' . $url . '">Detalii</a>'; | |
} | |
echo '<p id="cookie-notice">Lorem ipsum sil dolor. <br><button onclick="acceptCookie();">OK</button> ' . $link. ' </p>'; | |
echo '<script>function acceptCookie(){document.cookie="cookieaccepted=1; expires=Thu, 18 Dec 2030 12:00:00 UTC; path=/",document.getElementById("cookie-notice").style.visibility="hidden"}document.cookie.indexOf("cookieaccepted")<0&&(document.getElementById("cookie-notice").style.visibility="visible");</script>'; |
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
//breadcrumbs | |
function get_breadcrumb() { | |
//default link (home | |
echo '<a href="' . home_url() . '" rel="nofollow">Home</a>'; | |
//polylang conditional, you can remove this if you do not need | |
if (pll_current_language() == 'ro') { | |
echo '<a href="' . home_url() . '" rel="nofollow">Acasă</a>'; | |
} else if (pll_current_language() == 'en') { |
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
/*Order*/ | |
DELETE FROM wp_woocommerce_order_itemmeta; | |
DELETE FROM wp_woocommerce_order_items; | |
DELETE FROM wp_comments WHERE comment_type = 'order_note'; | |
DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type = 'shop_order' ); | |
DELETE FROM wp_posts WHERE post_type = 'shop_order'; | |
/*Products*/ | |
DELETE FROM wp_postmeta WHERE post_id IN ( SELECT ID FROM wp_posts WHERE post_type IN ( 'product', 'product_variation' )); | |
DELETE FROM wp_posts WHERE post_type IN ( 'product', 'product_variation' ); |
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
UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'oldurl.com','newurl.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'oldurl.com', 'newurl.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl.com','newurl.com'); |
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('wp_head', 'head_meta_hookin'); | |
function head_meta_hookin() { | |
echo '<meta name="theme-color" content="#6eb726">'; | |
echo '<meta name="msapplication-navbutton-color" content="#6eb726">'; | |
echo '<meta name="apple-mobile-web-app-capable" content="yes">'; | |
echo '<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">'; | |
} |
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
// fix catalog visibility | |
// original author + credits to https://dev.to/kalimahapps/enable-gutenberg-editor-in-woocommerce-466m | |
function enable_taxonomy_rest( $args ) { | |
$args['show_in_rest'] = true; | |
return $args; | |
} | |
add_filter( 'woocommerce_taxonomy_args_product_tag', 'enable_taxonomy_rest' ); |
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
//searched a lot for this, ended up coding it myself -- based on WOOCS and WPML. | |
add_filter('wp_head', function() { | |
$lang = get_locale(); | |
switch ($lang) | |
{ | |
case 'ro_RO': | |
wcj_session_set( 'wcj-currency', 'RON' ); | |
break; | |
case 'fr_FR': | |
wcj_session_set( 'wcj-currency', 'EUR' ); |
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 rwky_display_awb_mail( $order, $sent_to_admin, $plain_text ) { | |
// global $wpdb; | |
$awb = SamedayCourierQueryDb::getAwbForOrderId( sanitize_key( $order->get_id() ) ); | |
$awbNumber = $awb->awb_number; | |
if ( $awbNumber ) { | |
echo 'Poți urmări expediția aici:<br><a href="https://sameday.ro/#awb=' . $awbNumber . '" class="button" >AWB: ' . $awbNumber . '</a></br></br>'; | |
} else { | |
echo ''; |