Forum Replies Created

Viewing 15 replies - 1 through 15 (of 308 total)
  • Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi
    Would you mind share a link where I can review plugin settings?
    Thnaks

    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi,

    Apologies, I think I didn’t explain the issue clearly.

    Even if the gift card product is configured as Taxable with the correct tax class in WooCommerce, the problem is not the product’s tax settings themselves.

    The issue occurs when the gift card is applied to an order. The amount is not deducted as a product line affecting the taxable base and VAT proportionally. Instead, it is applied as a fee.

    In practice, this means:

    • It does not reduce the taxable base of the products.
    • It does not proportionally adjust the VAT amounts.
    • It appears as a separate fee line in the order.

    This creates a problem for us from an accounting and tax perspective. When we break down the order for reporting purposes (specifically for submission to the Spanish Tax Agency), the discount is not correctly allocated across the taxable bases and VAT amounts of the affected products.

    What we need is for the gift card amount, when redeemed, to reduce the taxable base and VAT of the order items proportionally (similar to how a coupon behaves), rather than being treated as an independent fee.

    Is there any way to configure the plugin so that the gift card is applied as a proportional line-item discount instead of as an order fee?

    Thanks

    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi @bradpimwick

    I’m afraid I did not understand your answer because I’ve never asked about Pro version.

    Do you mean that only Pro version includes the feature to set tax status to the gift cards ?

    Thanks

    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi
    Yes , I’m a SG customer.
    I’ll contact Help Desk.
    Thanks

    Faster method:

    • Download Yoast SEO 26.8 to your computer
    • Navigate to WordPress > Plugins > Add New > Upload Plugin to choose the zipped folder you had downloaded to your computer
    • Press [Replace current with uploaded].

    An automated upgrade would be appreciated.

    Thanks

    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi
    Sorry for the delay.
    I’ve discovered the reason of the bug.
    Something has changed in Download Monitor since 5.0.20 and our sanitize filenames function broke the download file url

    Now it’s fixed

    Thanks

    function custom_sanitize_filename_on_upload($file)
    {
    if ( !is_string($file) || trim($file) === '' )
    {
    return;
    }

    $invalidCharacters = array(' ', '_', '—', '.', 'À', 'Á', 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', 'Ÿ', 'Ź', 'ź', 'Ż', 'ż', 'Ž', 'ž', 'ſ', 'ƒ', 'Ơ', 'ơ', 'Ư', 'ư', 'Ǎ', 'ǎ', 'Ǐ', 'ǐ', 'Ǒ', 'ǒ', 'Ǔ', 'ǔ', 'Ǖ', 'ǖ', 'Ǘ', 'ǘ', 'Ǚ', 'ǚ', 'Ǜ', 'ǜ', 'Ǻ', 'ǻ', 'Ǽ', 'ǽ', 'Ǿ', 'ǿ', '_');
    $validCharacters = array('-', '-', '-', '-', 'A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'D', 'N', 'O', 'O', 'O', 'O', 'O', 'O', 'U', 'U', 'U', 'U', 'Y', 's', 'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', 'y', 'y', 'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd', 'D', 'd', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g', 'G', 'g', 'G', 'g', 'H', 'h', 'H', 'h', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'IJ', 'ij', 'J', 'j', 'K', 'k', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'l', 'l', 'N', 'n', 'N', 'n', 'N', 'n', 'n', 'O', 'o', 'O', 'o', 'O', 'o', 'OE', 'oe', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', 'S', 's', 'T', 't', 'T', 't', 'T', 't', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', 'Y', 'Z', 'z', 'Z', 'z', 'Z', 'z', 's', 'f', 'O', 'o', 'U', 'u', 'A', 'a', 'I', 'i', 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'A', 'a', 'AE', 'ae', 'O', 'o', '-');

    $excluded_extensions = ['csv', 'csv.txt']; // para que no falle CSV Import

    // Extraer nombre del archivo
    $filename = strtolower(pathinfo($file, PATHINFO_FILENAME));
    // Extraer extensión del archivo
    $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
    // Extraer nombre completo
    $fullname = strtolower(pathinfo($file, PATHINFO_BASENAME));

    // Si no es un nombre simple, no tocar (evita romper Download Monitor)
    if (str_contains($file, '://') || str_contains($file, '/') || str_contains($file, '\\')) {
    return $file;
    }

    // Quitar query/fragmento por si viene "archivo.pdf?x=1"
    $clean = preg_split('/[?#]/', $file, 2)[0];

    $filename = strtolower(pathinfo($clean, PATHINFO_FILENAME));
    $ext = strtolower(pathinfo($clean, PATHINFO_EXTENSION));
    $fullname = strtolower(pathinfo($clean, PATHINFO_BASENAME));

    $ends_with_csv_txt = (strlen($fullname) >= 7 && substr($fullname, -7) === 'csv.txt');

    if ($filename !== '' && $ext !== '' && !$ends_with_csv_txt && !in_array($ext, $excluded_extensions, true)) {

    $sanitized = str_replace($invalidCharacters, $validCharacters, $filename);
    $sanitized = preg_replace(['/-+/', '/[^a-zA-Z0-9-_.]+/'], ['-', ''], $sanitized);
    $sanitized = rtrim($sanitized, '-');

    return strtolower($sanitized . '.' . $ext);
    }

    return $file;
    }

    add_filter('sanitize_file_name', 'custom_sanitize_filename_on_upload');
    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Thanks

    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi @shahzeenfarooq

    Thanks for your reply and confirm that it occurs like this.
    I cannot understand the reason of this behaviour.
    As you suggest I will request that order change would include order items.

    @thelmachido sorry for the delay of my answer.

    Thanks

    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi @lovingbro,

    Yes, please check the database. A refund is stored as a post where the parent column points to the original order. So it’s a new order — a child order.
    But as you mentioned, it’s hidden and does not appear as a new order in WP Admin → WooCommerce → Orders.

    We checked the database, and this refund entry only stores the total amount, without taxes, fees, or items.

    For example, if you buy a T-shirt for €121 (100€ + 21€ tax), the refund entry will simply store 121€, including taxes, but without listing any line items.

    It’s easier to understand if you can look directly into MySQL.

    Thanks!

    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi @mosesmedh

    WP Admin > WooCommerce > Orders
    Just edit any order.
    On the top left, there is a selector for Order Statuses. Change it to Refunded.
    WooCommerce will create a refund order, but it will not include any order items.

    You can verify that it contains no items by doing a var_dump() of the WC_Order object.
    And what issues does this cause?
    If you try to generate a PDF for the refund, it will only show the totals — no products will be listed.
    Additionally, when the refund invoice is sent to the Spanish Tax Agency (Agencia Tributaria), it arrives incomplete, since it lacks the required line items.

    The question is: why aren’t the products added to the generated refund order?
    WooCommerce simply does not populate line items when an order is manually switched to the Refunded status.
    This status change only updates the order state — it does not trigger the refund logic nor create itemized refund data. What happens with stock?

    Since no items are added to the refund order:

    • Stock is not adjusted.
    • The quantities from the parent order remain untouched.
    • WooCommerce does not restore stock unless you create an actual refund entry, which requires selecting line items and quantities.

    In other words:

    • Changing the status to Refunded is only a label.
    • Creating a real refund (with items, quantities, tax breakdown, totals, and stock adjustments) requires using the “Refund” button inside the order.

    Please confirm if the question is now clear; maybe I didn’t explain myself well in previous messages.

    Thanks
    Jairo

    Hi @saivutukuru,

    You’re totally right — WooCommerce itself does not issue invoices.
    This new requirement to comply with Verifactu must therefore be handled by the developers of the plugins that do generate invoices, since Verifactu is strictly tied to invoicing and not to other ecommerce concepts.

    Regarding POS systems, there are two possible approaches:

    1. Replicate the same workflow used by PDF Invoices + FactuPress, because in Spain a “ticket” is legally equivalent to a Simplified Invoice, so the requirements are exactly the same as for full invoices.
    2. Use PDF Invoices as a bridge, relying on its documents to legally validate the POS tickets (as suggested in my previous message).

    The last option — and unfortunately the least desirable — is to use proprietary software and avoid generating tickets directly within WooCommerce.

    I believe @ffoonnkk has a good panoramic view of the overall scenario and can decide how to approach this new challenge for 2026.

    Regards,
    Jairo

    Hi @saivutukuru ,

    It’s completely understandable that WooCommerce cannot adapt to every country-specific invoicing regulation worldwide — especially in a case like VERI*FACTU, which requires interpreting a legally complex Spanish regulation and using a digital certificate that only Spanish users can obtain.

    That said, I want to clarify that the VERIFACTU workflow is already fully functional in WooCommerce for PDF invoice generation. The WP Overnight PDF Invoices plugin together with the FactuPress add-on can generate the VERIFACTU QR in real time and submit the invoice to the Spanish Tax Agency as required.

    For POS systems, the same workflow is entirely achievable as long as the POS plugin provides a hook during the receipt creation/printing process. The technical process is:

    1. When the POS starts generating the receipt, a background request is triggered to create the VERI*FACTU invoice.
    2. That invoice stores the required data in the WC_Order object:
      • Invoice number
      • Invoice date
      • VERI*FACTU QR code
    3. During the receipt-building process, the POS simply reads those fields from the order and inserts them into the receipt template.
    4. The receipt is printed already containing all VERI*FACTU-required elements.

    This is not theoretical: it is already implemented and working with YITH POS and VitePOS, and likely soon with WCPOS as well. Therefore, the only information we need is whether this particular POS plugin exposes a hook or action before printing the receipt so we can attach our integration logic.

    If such a hook exists, real-time QR integration is fully possible; if not, then it cannot be implemented on the POS side.

    Thanks,
    Jairo

    Hi @lovingbro

    As you correctly point out, the Verifactu law will be a turning point for all ecommerce businesses in Spain.
    If they do not comply with Verifactu, they will still be able to sell products, but they will not be allowed to issue invoices within WooCommerce. The alternatives would be to send orders to an ERP via API or to create invoices manually in an external application.

    If they comply with Verifactu, they will be able to continue issuing invoices directly from WooCommerce, and in this case the invoices are automatically sent to the Spanish Tax Agency the moment they are issued.

    For those who use WooCommerce connected to a POS, if the POS plugin does not handle sending receipts to the Tax Agency, they can use another plugin that issues the invoices in the background and immediately submits them to the Tax Agency.

    To enable this connection with the Tax Agency, a digital certificate issued by the Spanish Royal Mint (Fábrica Nacional de Moneda y Timbre) is required.
    The requirement to have this certificate applies only to Spanish citizens and companies, which makes the implementation more complex for developers from other countries.

    On January 1st, the new law becomes mandatory for companies and July 1st for freelancers, so many companies and freelancers are now looking for a solution that allows them to continue operating and keep their online store within a free-software environment, without depending on proprietary solutions such as Shopify + Holded.
    This is why it is important to provide solutions that ensure users’ independence.

    If you don’t mind, I will provide my responses in Spanish to make it easier for other users to understand, since this topic is exclusively intended for users located in Spain.

    Thanks

    Hola @ffoonnkk @lovingbro

    El desarrollo de una solución que cumpla Verifactu tiene dos puntos de dificultad añadidos:

    • Es necesario entender la ley española y leerse la Orden HAC/1177/2024 donde se especifica como debe ser el software que haga el envío de las facturas a la Agencia Tributaria.
    • Es necesario un certificado digital español para hacer las conexiones a la Agencia Tributaria.

    Estos dos puntos dejan fuera a desarrolladores de Codeable y otras plataformas si no tienen a un español en el equipo.
    Te recomiendo hablar con la gente de FactuPress que tiene un plugin que funciona con PDF Invoices y recientemente han implementado la solución para Yith POS y Vite POS.
    Es posible que lancen una solución para WCPOS también.

    Saludos

    Thread Starter Jairo Ochoa

    (@jairoochoa)

    Hi @shahzeenfarooq

    Yes, my fault, I was talking about the field “order_status” which is on the top-left side on the Order Edit page.

    If you change the Order Status with this selector instead of adding, below at order items block, units to be refunded, the Refund Order only have Totals but no Items.
    So weird, isn’t it ?
    I also have to check if stock is restored after status is changed.

    I’ve notice that even PDF Invoices has a fix in their Settings to show Order Items instead of showing an invoice empty. So it’s not an issue that only occurs in our shop.

    Thanks

Viewing 15 replies - 1 through 15 (of 308 total)