PrestaShop 8.2: Resolving Virtual Product Download Issues with Bank Transfer Payments

PrestaShop 8.2: Resolving Virtual Product Download Issues with Bank Transfer Payments

Selling virtual products like e-books or online services is a popular e-commerce model. However, ensuring automatic delivery with all payment methods, especially bank transfers, can present challenges. A recent PrestaShop forum thread highlighted a specific issue in PrestaShop 8.2.0 where virtual product download links were not sent after a bank transfer payment was manually marked as 'Payment accepted', despite working correctly with card payments.

The Core Problem: Order Status Configuration & Download Trigger

The merchant manually changed the order status from 'Awaiting bank wire payment' to 'Payment accepted'. While 'Payment accepted' had 'Consider the associated order as validated' checked, the download link email was not sent, nor was the link visible in the customer's order history.

The solution lies in understanding two critical flags within PrestaShop's order status configuration:

  • "Consider the associated order as validated" (logable): This flag is essential for triggering the download_product email. The email sends when an order transitions from a non-logable state to a logable state.
  • "Set the order as paid" (paid): This flag controls the visibility of the download link in the customer's order history and on the download page. The current order state must have this checked for the link to be accessible.

For bank transfers, ensure the initial 'Awaiting bank wire payment' status does not have 'Consider the associated order as validated' (logable) checked (it's unchecked by default). If it's checked, the crucial non-logable to logable transition never occurs, preventing the download email. The 'Payment accepted' status, however, must have both 'Consider the associated order as validated' and 'Set the order as paid' checked.

Technical Diagnosis & Download Hash Timing

PrestaShop sends the download_product email via OrderHistory::changeIdOrderState() if three conditions are met:

  1. The order line has a non-empty download_hash.
  2. The order transitions from a non-logable to a logable state.
  3. The virtual product has a filename displayed.

If card payments work, the third condition is likely met. The download_hash is generated and written into the order detail line at the moment the order is placed. If the virtual product file was attached to the product after a test order was made, that specific order will lack the download link. Always re-test with a new order after making product file changes.

To diagnose, use this SQL query (adapt prefix):

SELECT product_id, download_hash, download_deadline FROM ps_order_detail WHERE id_order = XX;
SELECT id_order_state, logable, paid FROM ps_order_state;

An empty download_hash for a bank transfer order points to incorrect file association at order creation; otherwise, check status configurations.

Virtual Product Validity & Consulting Sessions

The download deadline (e.g., 30 days) is calculated at order creation, not payment validation. For slow methods like bank transfers, customers lose validity days. A workaround is to extend the duration (e.g., 30 + 5 days) to compensate.

For services like consulting sessions requiring date selection, a simple text customization field is limited. Without a paid module, consider using product combinations (déclinaisons). Each combination can represent a time slot with its stock quantity indicating availability, preventing double bookings but requiring manual updates.

Conclusion

This thread offers crucial insights into PrestaShop's virtual product delivery system, particularly with manual payment validation. Understanding the 'validated' (logable) and 'paid' flags, along with download_hash generation and validity period calculation, is vital for any merchant selling digital goods. Correctly configuring order statuses and understanding these mechanics ensures a reliable delivery experience for all payment methods.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools