#63794 closed defect (bug) (invalid)
PHP notice: Array to string conversion in general-template.php
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 6.8.2 |
| Component: | General | Keywords: | |
| Focuses: | Cc: |
Description (last modified by )
Test Case: PHP Notice - Array to String Conversion with Multiple Coupons
Environment:
- Cart/Checkout: Classic and Block tested
- WooCommerce version: (assumed to be recent, e.g., 9.x)
| Step No. | Action | Expected Result |
|---|---|---|
| 1 | Login as a registered user. | Login successful |
| 2 | Add a product to the cart. | Product is added successfully |
| 3 | Go to the Cart page. | Both coupons are auto/applied manually and reflected correctly |
| 4 | Proceed to Checkout and place the order. | Order is placed successfully |
| 5 | Check the debug.log (or other PHP error logs). | ❌ PHP Notice: Array to string conversion appears if improper coupon formatting or output exists.
|
This error show in log file
[07-Aug-2025 05:33:32 UTC] $helper: free_gift
[07-Aug-2025 05:33:32 UTC] $current: smart_coupon
[07-Aug-2025 05:33:32 UTC] $helper: smart_coupon
[07-Aug-2025 05:33:32 UTC] $current: smart_coupon
[07-Aug-2025 05:33:32 UTC] $helper: no
[07-Aug-2025 05:33:32 UTC] $current: yes
[07-Aug-2025 05:33:32 UTC] $helper: Array
(
[0] =>
)
[07-Aug-2025 05:33:32 UTC] $current: yes
**[07-Aug-2025 05:33:32 UTC] PHP Notice: Array to string conversion in C:\laragon\www\StoreApps\wp-includes\general-template.php on line 5313**
[07-Aug-2025 05:33:32 UTC] $helper: no
[07-Aug-2025 05:33:32 UTC] $current: yes
[07-Aug-2025 05:33:32 UTC] $helper: no
[07-Aug-2025 05:33:32 UTC] $current: yes
Attachments (2)
Change History (6)
#2
@
6 months ago
- Keywords needs-testing has-patch removed
- Resolution set to invalid
- Status changed from new to closed
Hey @balvantk - thanks for the patch and welcome to WP Core trac. WooCommerce is maintained separately and not part of the WordPress Core. Can you submit this issue on https://wordpress.org/support/plugin/woocommerce/
Note: See
TracTickets for help on using
tickets.
Patch uploaded to fix array to string conversion warning. Please review.