Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Boa tarde povo

    O plugin funciona, mas o link da página de configuração está errado

    As configurações do plugin levam a pessoa para a página de comprador teste. O endereço correto seria o de vendedor teste: https://sandbox.pagseguro.uol.com.br/vendedor/configuracoes.html, lá sim você deve copiar os itens e colar na página de configuração.

    Felipe, já faz um bom tempo, mas talvez ao invés de mostrar o campo todo, mostrar apenas os últimos números, como quando vou tirar o extrato do meu cartão no auto atendimento do banco, onde ele mostra todos os que tenho mas com números ocultos, não seria melhor? Talvez mostrar só os últimos, ou só as pontas talvez.

    <?php
    // no lugar de "echo $order->billing_phone;", mostrar apenas os últimos 4 números do telefone, por exemplo:
    $telefone = $order->billing_phone;
    $finalTelefone = str_repeat('*', strlen($telefone) - 4) . substr($telefone, -4, 4);
    echo $finalTelefone;

    Claudio, boa noite.

    Entendo que adicionar os campos ao registro não faz parte do plugin, mas veja se consegue me ajudar nisso:

    Estou adicionando alguns campos no cadastro, e gostaria de saber onde seria ideal alterar no plugin para ler estes campos para iniciar a tela já preenchida com alguns deles (CPF por exemplo)?

    Queria saber se posso usar algo como os add_action do wordpress, ou devo editar os arquivos do plugin diretamente?

    @mpatzekov, this will go in author.php of your (child?) theme.

    @mnlsr, if you want the order by addition in the favorites list, this will work:

    <ul>
    <?php
    global $wpdb;
    // in author's page, I show the last 3 favorites
    $favorites = array_reverse(get_user_favorites($author));
    $results = $wpdb->get_results('SELECT p.ID, p.post_title, p.post_name, FIELD(p.ID, ' . implode(',', $favorites) . ') ord
    FROM ' . $wpdb->posts . ' p WHERE p.ID IN (' . implode(',', $favorites) . ') ORDER BY ord LIMIT 3');
    foreach($results as $res) {
    	echo '<li><a href="' . get_permalink($res->ID) . '">' . esc_html($res->post_title) . '</a></li>';
    }
    ?>
    </ul>

    I have this problem too, but maybe tomorrow I will get some code for this. I need to test, but I think the array used to store post IDs in the meta table for the user is in the order of ‘clicks’.

    I hope my poor English can be understood by you…

    Hi i100anni

    I use this way, first

    1. get the list of favorites
    2. if there are any favorites:
    1. create a WP_Query that posts ID are the same of favorites array
    2. iterate over result
    • else, there is no favorites, print message
    • $favorites = get_user_favorites();
      if ( $favorites ) {
          $favorites_query = new WP_Query(array(
      	'post_type' => [],//'post', // If you have multiple post types, pass an array
      	'posts_per_page' => -1,
      	'ignore_sticky_posts' => true,
      	'post__in' => $favorites,
      	'orderby' => 'meta_value_num', // order by favorites count in this example
      	'meta_key'  => 'simplefavorites_count'
          ));
          if ( $favorites_query->have_posts() ) : while ( $favorites_query->have_posts() ) : $favorites_query->the_post();
              // here comes the loop
          endwhile; endif; wp_reset_postdata();
      } else {
          // no favorites yet
      }
Viewing 7 replies - 1 through 7 (of 7 total)