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 | |
rs::metabox(array( | |
'title' => 'Select custom date sale', | |
'layout' => 'none', | |
'rules' => array( | |
'post_type' => 'product' | |
), | |
'context' => 'normal', | |
'priority' => 'default', | |
'controls' => array( |
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 | |
/* | |
Plugin Name: Tracking Info to WooCommerce order | |
Plugin URI: https://www.damiencarbery.com/2020/01/add-tracking-info-to-woocommerce-order/ | |
Description: Use CMB2 to add a custom metabox to add tracking information to WooCommerce orders. The information is then added to the "Completed Order" email. | |
Author: Damien Carbery | |
Author URI: https://www.damiencarbery.com | |
Version: 0.2 | |
$Id: tracking-info-to-wc-order.php 4947 2020-01-04 14:52:28Z damien $ |
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 | |
/* | |
Plugin Name: Woo Close Store | |
Plugin URI: https://github.com/gabriserra/woo-close-store | |
Description: Woo Close Store handle store closing phase. | |
Version: 0.1 | |
Author: Gabriele Serra | |
Author URI: https://gabripr0.altervista.org | |
Text Domain: woo-close-store | |
License: MIT |
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
/** | |
* Não permitir a troca de status de pedidos cancelados. | |
* Muda o pedido para apovação manual | |
*/ | |
add_filter( 'woocommerce_before_order_object_save', 'prevent_cancelled_order_status_change', 10, 2 ); | |
function prevent_cancelled_order_status_change( $order, $data_store ) { | |
$changes = $order->get_changes(); | |
if (isset($changes['status'])) { |
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
/** | |
* Ordena produtos fora de estoque no final do catálogo | |
* source: https://stackoverflow.com/a/44597448 | |
*/ | |
add_filter('posts_clauses', 'order_by_stock_status'); | |
function order_by_stock_status($posts_clauses) { | |
global $wpdb; | |
// only change query on WooCommerce loops | |
if (is_woocommerce() && (is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy())) { | |
$posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) "; |
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 | |
/** | |
* Ordena produtos fora de estoque no final do catálogo | |
* source: https://stackoverflow.com/a/44597448 | |
*/ | |
add_filter('posts_clauses', 'order_by_stock_status'); | |
function order_by_stock_status($posts_clauses) { | |
global $wpdb; | |
// only change query on WooCommerce loops |
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
/** | |
* Remove produtos que a variação não tem em estoque | |
* Removes products from Filter where the variation is out of stock | |
* @see https://github.com/woocommerce/woocommerce/issues/20689 | |
*/ | |
add_action( 'woocommerce_before_shop_loop_item_title', 'remove_out_of_stock_products_from_active_filter' ); | |
function remove_out_of_stock_products_from_active_filter(){ | |
if (isset($_GET['filter_size'])) { | |
global $product; | |
if ($product->is_type('variable')) { |
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
User-agent: * | |
Disallow: /wp-admin/ | |
Disallow: /?s= | |
Disallow: /search/ | |
Allow: /admin/admin-ajax.php | |
Disallow: /cgi-bin/ | |
Disallow: /wp-content/cache/ | |
Disallow: /trackback/ | |
Disallow: */trackback/ |
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 woo_seo_noindex_special_pages () { | |
global $post; | |
$woocommerce_pages = array('cart', 'checkout', 'order-received', 'order-tracking', | |
'my-account', 'logout', 'lost-password', 'mijireh-secure-checkout'); | |
$slug = get_post($post)->post_name; | |
if (in_array($slug, $woocommerce_pages)) { | |
echo '<meta name="robots" content="noindex,follow"/>' . "\n"; | |
} |
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
// 06-05-2019 Retain Quote Billing & Shipping Country ELSE assign Location based on IP (Geolocation) | |
function remove_checkout_optional_fields_label_script() { | |
// Only on checkout page | |
if( ! ( is_checkout() && ! is_wc_endpoint_url() ) ) return; | |
$optional = ' <span class="optional">(' . esc_html__( 'optional', 'woocommerce' ) . ')</span>'; | |
?> | |
<script> | |
jQuery(function($){ | |
// On "update" checkout form event remove option to select countries | |
$(document.body).on('update_checkout', function(){ |