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 | |
/** | |
* 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 | |
/** | |
* 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 | |
/** | |
* 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
jQuery(function($) { | |
console.log(window.location.href); | |
if (window.location.href == 'https://erp.tiny.com.br/expedicao' || window.location.href == 'https://erp.tiny.com.br/expedicao#add') { | |
console.log('gerando plp'); | |
var position = $('.form-group-section-simple'); | |
var wrapper = $('<div class="form-group-section"> <div class="row"> <div class="col-md-4 form-group"> <div class="input-group search-sale-slip-wrapper"> <span class="input-group-btn"><button class="btn btn-default search-slip-note-indicator" type="button"><i class="fas fa-search"></i></button> </span> </div> </div> </div> </div>'); | |
var input = $('<input class="form-control" placeholder="Pesquisar nota" />'); |
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
/** | |
* Lista a visibilidade do catálogo de todos os itens | |
*/ | |
add_action('admin_post_check_products_visibility', 'check_products_visibility'); | |
function check_products_visibility() { | |
$args = array( | |
'post_type' => 'product', | |
'posts_per_page' => -1, | |
); |
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 | |
// Register Custom Taxonomy | |
function register_product_origem() { | |
$labels = array( | |
'name' => 'Origens', | |
'singular_name' => 'Origem', | |
'menu_name' => 'Origem', | |
); | |
$rewrite = 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
CREATE TABLE `user` ( | |
`id` int(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, | |
`email` varchar(100) NOT NULL, | |
`password` varchar(255) NOT NULL, | |
`first_name` varchar(255), | |
`last_name` varchar(255), | |
`created_at` datetime NOT NULL, | |
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
); |
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
CREATE TABLE `user` ( | |
`id` int(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY, | |
`email` varchar(100) NOT NULL, | |
`password` varchar(255) NOT NULL, | |
`first_name` varchar(255), | |
`last_name` varchar(255), | |
`billing_first_name` varchar(255), | |
`billing_last_name` varchar(255), |
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 | |
// http://www.example.com/wp-admin/admin-post.php?action=update_all_products | |
add_action('admin_post_update_all_products', 'update_all_products'); | |
function update_all_products() { | |
$args = array( | |
'post_type' => 'product', | |
'posts_per_page' => 1, // para testar só com 1 | |
); | |