Ver código fonte

Update documentation for v1.2.0 features

- Document auto-download status change (ready -> downloaded)
- Document bulk action confirmation dialogs
- Document pagination filter preservation
- Document thumb_url order item meta key
- Fix duplicate step numbering in CLAUDE.md frontend flow
- Clarify session persistence (not cleared after add-to-cart)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dalibor Votruba 3 meses atrás
pai
commit
38823442f0

+ 5 - 4
studiou-wc-free-photo-product/CLAUDE.md

@@ -39,7 +39,7 @@ Allows publishing special variable products where customers upload custom raw im
 - `Studiou_WC_FPP_Single_Product` - Upload area on product page (`woocommerce_single_product_summary` priority 35), WC session storage, server-side validation (`woocommerce_add_to_cart_validation` priority 1) + safety net (`woocommerce_add_to_cart` removes items without photo)
 - `Studiou_WC_FPP_Shortcode` - `[studiou_free_photo_product id="X"]` renders product with WC native variation form
 - `Studiou_WC_FPP_Cart` - Reads file data from WC session via `woocommerce_add_cart_item_data`, replaces cart/order item thumbnails (classic cart via `woocommerce_cart_item_thumbnail`, block cart via `woocommerce_product_get_image_id`/`woocommerce_product_variation_get_image_id`), order item meta, order linking
-- `Studiou_WC_FPP_Admin` - Summary page, status management, ZIP download
+- `Studiou_WC_FPP_Admin` - Summary page with filters/pagination, status management, ZIP download, file download with auto-status-change, bulk actions with confirmation dialogs
 
 ## Frontend Flow
 
@@ -53,9 +53,10 @@ Allows publishing special variable products where customers upload custom raw im
 8. `woocommerce_add_to_cart` safety net — removes item if it was added without photo data
 9. `woocommerce_add_cart_item_data` reads file data from WC session (session NOT cleared — same photo reusable for multiple variants)
 10. Cart thumbnails: classic cart via `woocommerce_cart_item_thumbnail`, block cart via `woocommerce_product_get_image_id`/`woocommerce_product_variation_get_image_id`
-11. Order admin thumbnails via `woocommerce_admin_order_item_thumbnail`
-11. On checkout, file record linked to order via `woocommerce_checkout_order_processed` (classic), `woocommerce_store_api_checkout_order_processed` (block), `woocommerce_thankyou` (fallback)
-12. Session only cleared when user clicks Remove
+11. Order admin: thumbnail via `woocommerce_admin_order_item_thumbnail`, download link via `woocommerce_after_order_itemmeta` (auto-marks status as "downloaded")
+12. On checkout, file record linked to order via `woocommerce_checkout_order_processed` (classic), `woocommerce_store_api_checkout_order_processed` (block), `woocommerce_thankyou` (fallback)
+13. Session only cleared when user clicks Remove
+14. Admin photo files view: download marks "ready" -> "downloaded", bulk actions with confirmations, pagination preserves filters
 
 ## Coding Conventions
 

+ 8 - 7
studiou-wc-free-photo-product/readme.md

@@ -74,25 +74,25 @@ Navigate to **Products > Free Photo Files** to manage uploaded files.
 ### Features
 
 - Filter by status (Ready / Downloaded / Solved), product, or file name search
-- Inline status change per file
-- Single file download link
+- Inline status change per file via dropdown
+- Single file download (automatically marks status as "downloaded" if currently "ready")
 - Single file delete with media attachment cleanup
-- Bulk actions: Download as ZIP, Set Status, Delete
+- Bulk actions with confirmation dialogs: Download as ZIP, Set Status (Ready / Downloaded / Solved), Delete
 - Order number links (HPOS-compatible)
 - Customer name display
-- Pagination (30 files per page)
+- Pagination (30 files per page, preserves active filters across pages)
 
 ### File Statuses
 
 | Status | Meaning |
 |---|---|
 | Ready | File uploaded, awaiting processing |
-| Downloaded | File has been downloaded by admin |
+| Downloaded | File has been downloaded by admin (set automatically on download) |
 | Solved | File has been printed / order fulfilled |
 
 ## Cart and Order Integration
 
-The plugin integrates with WooCommerce's native add-to-cart flow using WC session storage. When a photo is uploaded, the file reference is stored in the WC session via AJAX. When any add-to-cart button is clicked, `woocommerce_add_cart_item_data` reads the file data from the session and attaches it to the cart item. The session data is cleared after use. The `woocommerce_add_to_cart_validation` filter ensures a photo is uploaded before the item can be added. This approach works with any theme or plugin that handles variable product display (individual variation buttons, dropdowns, tables, etc.).
+The plugin integrates with WooCommerce's native add-to-cart flow using WC session storage. When a photo is uploaded, the file reference is stored in the WC session via AJAX. When any add-to-cart button is clicked, `woocommerce_add_cart_item_data` reads the file data from the session and attaches it to the cart item. The session persists so the same photo can be reused for multiple variants. The `woocommerce_add_to_cart_validation` filter ensures a photo is uploaded before the item can be added. This approach works with any theme or plugin that handles variable product display (individual variation buttons, dropdowns, tables, etc.).
 
 When a customer adds a photo product to the cart:
 - The cart item thumbnail shows the uploaded photo — works with both **classic cart** (`woocommerce_cart_item_thumbnail` filter) and **block cart** (`woocommerce_product_get_image_id` / `woocommerce_product_variation_get_image_id` filters that override the product image for the Store API)
@@ -100,7 +100,7 @@ When a customer adds a photo product to the cart:
 - On checkout, the file record is linked to the order and order item
 - In the order admin, order item thumbnails show the uploaded photo instead of the product image
 - The uploaded photo file name appears as order item metadata
-- A **Download uploaded photo** button with the original file name is shown below the order item meta in admin
+- A **Download uploaded photo** button with the original file name is shown below the order item meta in admin (downloading automatically marks the file status as "downloaded")
 - Files linked to orders cannot be removed by the customer
 
 ## Media Categories
@@ -239,6 +239,7 @@ studiou-wc-free-photo-product/
 | `_studiou_fpp_attachment_id` | WP attachment ID |
 | `_studiou_fpp_file_record_id` | File record ID in custom table |
 | `_studiou_fpp_file_name` | Original file name |
+| `_studiou_fpp_thumb_url` | Thumbnail URL (for reliable display) |
 
 ## License