julianosb
Forum Replies Created
-
Forum: Plugins
In reply to: [Calculadora de Frete e Campos Checkout para o Brasil] Perdeu a identidade?Concordo, na minha verificação diária, vi que tinha 2 campos de calculo de frete, desativei do carrinho e do produto para continuar como era antes, pois a ideia é usar o padrão que já tem, e o plugin é apenas para remover campos extras desnecessários para calculo de frete, minhas vendas saíram sem frete e sem endereço do cliente.
Tive que habilitar o do carrinho para voltar ao normal e entrar em contato com o cliente solicitando o endereço completo e o valor do frete (Chato pra caramba) em algumas vendas, o cliente não quis pagar o frete.- This reply was modified 11 months, 2 weeks ago by julianosb.
Forum: Plugins
In reply to: [Calculadora de Frete e Campos Checkout para o Brasil] Não calcula o frete@linknacional aparentemente, reativei o plugin e voltou a funcionar.
Forum: Plugins
In reply to: [Calculadora de Frete e Campos Checkout para o Brasil] Não calcula o freteUtilizo a Frenet, e aparece a mensagem: Nenhuma opção de entrega foi encontrada para (…)
Desativei o plugin Calculadora de frete melhorada para lojas brasileiras e voltou a funcionar, tendo que preencher os dados de Cidade, Estado, etc… embora eu não precise colocar esses dados corretamente, somente o CEP correto.@rabbitwordpress Try this:
function change_add_coupon_text( $translated_text, $text, $domain ) {
// Target only WooCommerce text domain
if ( 'woocommerce' === $domain ) {
// Change "Add a coupon" on Cart and Checkout
if ( 'Add a coupon' === $text ) {
$translated_text = 'Apply Discount Code'; // Replace with your custom text
}
}
return $translated_text;
}
add_filter( 'gettext', 'change_add_coupon_text', 10, 3 );Forum: Plugins
In reply to: [WooCommerce] GTIN, UPC, EAN, or ISBN Import / ExportForum: Plugins
In reply to: [WooCommerce] GTIN, UPC, EAN, or ISBN Import / ExportUse the codes so that the column appears in the product export and export in CSV.
add_filter('woocommerce_product_export_columns', 'add_ean_to_export_columns');
function add_ean_to_export_columns($columns) {
// Add a new column to the CSV for the _global_unique_id field
$columns['ean_gtin_mpn'] = 'EAN/GTIN/MPN';
return $columns;
}
add_filter('woocommerce_product_export_product_default_columns', 'add_ean_to_default_export_columns');
function add_ean_to_default_export_columns($columns) {
// Add the column to the default set of exported columns
$columns['ean_gtin_mpn'] = 'EAN/GTIN/MPN';
return $columns;
}
add_filter('woocommerce_product_export_product_column_ean_gtin_mpn', 'export_ean_meta_data', 10, 2);
function export_ean_meta_data($value, $product) {
// Retrieve the value of the custom field _global_unique_id
return $product->get_meta('_global_unique_id', true);
}
// Add EAN to Import
add_filter('woocommerce_csv_product_import_mapping_options', 'add_ean_to_import_mapping_options');
function add_ean_to_import_mapping_options($options) {
// Add EAN/GTIN/MPN to the list of mapping options during import
$options['ean_gtin_mpn'] = 'EAN/GTIN/MPN';
return $options;
}
add_filter('woocommerce_csv_product_import_mapping_default_columns', 'map_ean_column_to_meta_key');
function map_ean_column_to_meta_key($columns) {
// Map the EAN/GTIN/MPN column to the _global_unique_id meta key
$columns['EAN/GTIN/MPN'] = '_global_unique_id';
$columns['ean_gtin_mpn'] = '_global_unique_id';
return $columns;
}
add_action('woocommerce_product_import_inserted_product_object', 'import_ean_meta_data', 10, 2);
function import_ean_meta_data($product, $data) {
// Save the value from the EAN/GTIN/MPN column to the _global_unique_id meta key
if (!empty($data['ean_gtin_mpn'])) {
$product->update_meta_data('_global_unique_id', $data['ean_gtin_mpn']);
}
}- This reply was modified 1 year, 7 months ago by julianosb.
I wrote some code in the functions.php of my active theme and it worked for me.
add_action('template_redirect', 'remove_gla_prefix_from_add_to_cart_url');
function remove_gla_prefix_from_add_to_cart_url() {
// Check if the 'add-to-cart' parameter is present in the URL
if (isset($_GET['add-to-cart'])) {
$add_to_cart = $_GET['add-to-cart'];
// Check if the 'add-to-cart' parameter starts with 'gla_'
if (strpos($add_to_cart, 'gla_') === 0) {
// Remove the 'gla_' prefix and update the product ID
$product_id = str_replace('gla_', '', $add_to_cart);
// Redirect to the correct URL without the 'gla_' prefix
wp_safe_redirect(add_query_arg('add-to-cart', $product_id));
exit;
}
}
}Explanation:
template_redirect: This hook runs just before WooCommerce processes the URL and loads the template, giving us the chance to modify the URL.isset($_GET['add-to-cart']): Checks if theadd-to-cartparameter is present in the URL.strpos($add_to_cart, 'gla_') === 0: Ensures that theadd-to-cartvalue starts with thegla_prefix.str_replace('gla_', '', $add_to_cart): Removes thegla_prefix so that only the product ID is left.wp_safe_redirect(): Redirects the user to the same URL but with the correctedadd-to-cartvalue without the prefix.
This code should now handle the URL redirection in WooCommerce properly by removing the
gla_prefix before processing theadd-to-cartparameter.Conforme solicitado, segue print screen dos temas citados
Plugins Ativos:
Plugins Inativos:
Print Screen do Erro:- This reply was modified 2 years ago by julianosb.
@diegogaona Verdade, eu já estou vendo outros gateways que não fazem isso, as taxas são muito parecidas de todos, não vai mudar minha vida…
https://plugintests.com/plugins/wporg/woocommerce-mercadopago/latest
O Plugintests acusa erro no Plugin do Mercado Pago@diegogaona Essa dica do hermano ai de cima parece ser bem interessante, não testei, mas eu realmente gostaria de ouvir do Mercado Pago o porque desses múltiplos carregamentos de scripts na pagina inicial…
Forum: Plugins
In reply to: [Pagar.me para WooCommerce] Conflitos JS com plugin B2BkingVcs precisam atualizar o Sweet Alert
“I see they are using an old version (v6) of sweetalert, whereas B2BKing uses v11”
Resposta que recebi do B2BKing
Forum: Plugins
In reply to: [Pagar.me para WooCommerce] Conflitos JS com plugin B2BkingInstalei o pagar.me e também tive esse problema… desativei o pagar.me e ativei outro gateway.
Mais uma vez, obrigado pelos esclarecimentos… vou tentar não focar neste ponto, não tenho muita experiência em WordPress mas acredito ter construído um e-commerce razoavelmente rápido…
Obrigado @denisgomesfranco, a velocidade é algo que eu estou sempre cuidando e otimizando, pois o Google e outras ferramentas (ahref, semrush, diib entre outras estão sempre me enviando mensagens falando sobre CLS, TTFB, LCP, etc…