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 | |
/** | |
* Cria os campos na taxonomia | |
*/ | |
add_action('product_cat_edit_form_fields','nerdstore_taxonomy_edit_custom_meta_field', 10, 2); | |
add_action('marca_edit_form_fields','nerdstore_taxonomy_edit_custom_meta_field', 10, 2); | |
add_action('editora_edit_form_fields','nerdstore_taxonomy_edit_custom_meta_field', 10, 2); | |
add_action('autor_edit_form_fields','nerdstore_taxonomy_edit_custom_meta_field', 10, 2); | |
function nerdstore_taxonomy_edit_custom_meta_field($term) { |
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 | |
/** | |
* Adicona a coluna de frete nos meus pedidos | |
*/ | |
add_filter('woocommerce_account_orders_columns', 'nerdstore_add_shipping_header_on_my_orders', 10, 1); | |
function nerdstore_add_shipping_header_on_my_orders($columns){ | |
$new_columns = array(); | |
foreach ( $columns as $key => $name ) { | |
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 | |
/** | |
* Altera o status do de cuncluido para enviado | |
*/ | |
add_action('admin_post_update_processing_orders', 'nerdstore_update_processing_orders'); | |
function nerdstore_update_processing_orders() { | |
echo '<pre>'; |
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 | |
/** | |
* Altera o status do de cuncluido para enviado | |
* https://nerdstore.com.br/wp-admin/admin-post.php?action=update_completed_orders | |
*/ | |
add_action('admin_post_update_completed_orders', 'nerdstore_update_completed_orders'); | |
function nerdstore_update_completed_orders() { | |
echo '<pre>'; |
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 | |
/** | |
* Cria os campos na taxonomia | |
*/ | |
function nerdstore_taxonomy_edit_custom_meta_field($term) { | |
$t_id = $term->term_id; | |
$term_meta = get_option( "taxonomy_$t_id" ); | |
$mobile_image = isset($term_meta['mobile_image_term_meta']) ? $term_meta['mobile_image_term_meta'] : false; |
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
/** | |
* Cria os campos na taxonomia | |
*/ | |
function nerdstore_taxonomy_edit_custom_meta_field($term) { | |
$t_id = $term->term_id; | |
$term_meta = get_option( "taxonomy_$t_id" ); | |
$mobile_image = isset($term_meta['mobile_image_term_meta']) ? $term_meta['mobile_image_term_meta'] : false; | |
$desktop_image = isset($term_meta['desktop_image_term_meta']) ? $term_meta['desktop_image_term_meta'] : false; | |
?> |
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
import { firestore } from '../firebase/firebase.utils' | |
import moment from 'moment' | |
export function usePost() { | |
const createPost = async (post) => { | |
const { type, category, displayName, link, quote, sponsored, sponsoredclicks, target, title, userId } = post | |
let postAdd = { | |
type, | |
actionType: "Add", |
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 | |
/** | |
* Remove produtos fora de estoque do cross sell | |
* @See https://github.com/woocommerce/woocommerce/blob/444dffdda27750b98ce1517d5f6f4d8153c53967/includes/class-wc-cart.php#L817 | |
*/ | |
add_filter('woocommerce_cart_crosssell_ids', 'remove_out_of_stock_from_crosssell', 10, 1 ); | |
function remove_out_of_stock_from_crosssell( $wp_parse_id_list ){ | |
if (!empty($wp_parse_id_list)) { | |
foreach ($wp_parse_id_list as $product_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
/** | |
* 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) "; |