
This plugin will add an extended feature to the big name “ WooCommerce ” that will allow you to add document preview feature in single product pag
Document Preview For WooCommerce adds a document preview button to your WooCommerce single product pages. When a customer clicks the button, the document opens in a clean modal popup (powered by WordPress Thickbox), allowing them to read or browse the content without leaving the product page — and without downloading the file.
This is the ideal solution for stores selling eBooks, PDFs, templates, spreadsheets, presentations, manuals, and any other digital or downloadable document product. Showing customers a meaningful preview before purchase significantly reduces uncertainty and increases confidence at the point of sale.
How It Works
- Edit any WooCommerce product in your admin
- Scroll down to the “Preview Documents” meta box
- Enter a descriptive label and either upload a file from the Media Library or paste a document URL
- Save the product
- A “Preview” button appears on the product page automatically, just below the Add to Cart form
- Customers click the button to open the document in a full-size modal popup
Key Features
Supported File Formats
- PDF (.pdf) — rendered locally on your site by the bundled pdf.js viewer, with no request to Google or any third party (works on local, staging, and firewalled sites)
- Word Documents (.doc, .docx) — previewed via Google Docs Viewer (needs a publicly reachable file URL)
- Excel Spreadsheets (.xls, .xlsx) — previewed via Google Docs Viewer (needs a publicly reachable file URL)
- PowerPoint Presentations (.ppt, .pptx) — previewed via Google Docs Viewer (needs a publicly reachable file URL)
- Plain Text (.txt) — displayed in a formatted text reader
Cloud Document Support
- Google Docs — paste a published or shareable Google Docs link
- Google Sheets — paste a shareable Google Sheets link
- Google Slides — paste a shareable Google Slides link
- OneDrive — paste a Microsoft OneDrive shared document link
- Dropbox — paste a Dropbox shared link (automatically converted for embedding)
Document Management
- Multiple documents per product — add as many preview files as needed
- Each document gets its own labelled preview button on the product page
- Upload files directly from the WordPress Media Library
- Or paste any external document URL — no file upload required
- Remove individual documents without affecting others
Preview Display
- Documents open in a WordPress Thickbox modal popup (900x700px)
- Customers stay on the product page while previewing
- Clean, focused preview experience with no distractions
- Supported on all modern desktop and mobile browsers
Performance and Compatibility
- Minified CSS and JavaScript assets included
- RTL (right-to-left) stylesheet support
- Mobile-responsive preview button and modal layout
- Compatible with standard WooCommerce product page hooks
- No external JavaScript libraries required beyond jQuery and WordPress Thickbox
Perfect For
- eBook stores (PDF previews of chapters or sample pages)
- Template marketplaces (Word/Excel/PowerPoint template previews)
- Software documentation (user manual previews)
- Legal and compliance document stores (contract templates)
- Educational resource stores (worksheet and course material previews)
- Any WooCommerce store where document content is central to the buying decision
Pro Version
A Pro version is available with advanced features including document watermarking, partial-page preview control, and multi-vendor marketplace support. Visit wbcomdesigns.com for details.
Screenshots

Document preview modal on the product page: The Thickbox modal open showing a PDF document rendered inside the browser. The customer stays on the product page while the document is open, with a close button visible.

Preview button on the product page: The "Preview" button displayed on the WooCommerce single product page below the Add to Cart form, showing how it appears to customers before clicking.

Preview Documents meta box — admin: The product editor meta box showing a document row with a label field, a URL/file input, and a Media Library upload button. The Add button for additional rows is also visible.
FAQ
Does this plugin require WooCommerce?
Yes. Document Preview For WooCommerce requires WooCommerce 3.0 or higher to be installed and active. The plugin will deactivate itself automatically if WooCommerce is not active, and will display an admin notice with a link to install or activate it.
What document file types are supported?
Locally uploaded files: PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, and TXT.
Cloud and embeddable URLs: Google Docs, Google Sheets, Google Slides, OneDrive, and Dropbox shared links are all supported and automatically embedded without requiring a file upload.
Can I add more than one document preview per product?
Yes. Each product can have multiple document previews. Use the “Add” button in the Preview Documents meta box to add as many rows as needed. Each document gets its own labelled preview button on the product page, so customers can select which document they want to view.
Should I upload files or use external URLs?
Both approaches work. Uploading files to the WordPress Media Library gives you full control over the files and keeps them on your server. Using external URLs (Google Drive, Dropbox, OneDrive) avoids using server storage and is convenient for documents you already host elsewhere. Note that external URLs must remain publicly accessible for the preview to work.
Can customers download the preview files?
The preview is designed as a view-only experience inside a modal popup. PDFs open in the bundled pdf.js viewer and Office files open in the Google Docs Viewer, both read-only interfaces. Some browsers may still offer download options from within the viewer frame, but there is no direct download link exposed through the plugin.
How does the modal preview work?
The plugin uses WordPress’s built-in Thickbox library to open documents in a full-screen overlay modal. The document is embedded in an iframe within the modal. Customers can close the preview by clicking outside the modal or pressing Escape.
What happens if a preview is not loading?
Common causes and fixes: (1) PDFs render locally via the bundled pdf.js viewer and do not depend on Google — so a PDF that will not load is usually a file-path or cache issue, not a reachability one. Office formats and cloud links do need a publicly accessible URL; privately shared Google Drive or Dropbox links will not load. (2) Confirm the file format is supported (PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT). (3) Clear your site cache and browser cache. (4) Try a different browser or disable browser extensions. (5) Keep files under 50MB for reliable rendering. For persistent issues, contact the support team with details about the file type and hosting method.
Is the plugin compatible with Google Docs, Sheets, and Slides?
Yes. Paste a shareable link from Google Docs, Google Sheets, or Google Slides into the URL field. The plugin detects these URLs and embeds them using the appropriate Google preview endpoint, so customers see a clean, interactive preview of the document.
Does the plugin work with Dropbox or OneDrive links?
Yes. Dropbox shared links are automatically converted to direct embed URLs. OneDrive shared links are also supported and embedded via the Office Online viewer. Make sure your sharing settings allow public access to the linked file.
Is the plugin translation ready?
Yes. The plugin is fully internationalised with a .pot translation template file included. You can add translations through translate.wordpress.org or by placing .po/.mo files in the plugin’s languages/ directory.
ChangeLog
1.6.4 – October 2026
- Dev – Declared the plugin’s supported range in the header (Requires PHP 8.1, Requires at least 6.5, WooCommerce tested up to 11.2).
1.6.3 – September 2026
- Improve – Admin settings radio options no longer wrap mid-label and stack cleanly on phones (settings-bridge migration).
- Dev – Added the wcdp_admin_view_path filter so a Pro or third-party screen can change which view file a settings tab renders.
- Dev – Bridged the shared shell’s wcdp_settings_nav_groups filter and wcdp_settings_tab_content action so extensions can register settings tabs.
- Dev – Corrected the hooks reference (now covers all extension points), fixed the hook-docs generator, and removed dead scaffolding.
1.6.2 – August 2026
- New – Local PDF previews now render through a bundled pdf.js viewer instead of Google’s servers, so they work on staging, local, password-protected and firewalled sites.
- New – Added a [document_preview] shortcode and a Document Preview block so owners can place the preview anywhere, including product tabs and the Site Editor.
- New – Rebuilt the admin panel around an Overview screen where owners can see, filter, sort, export and query every document the store has attached.
- Improve – Plugin colours now bridge to the active theme’s design tokens, and per-format colours are overridable per site.
- Improve – Preview button and viewer now announce themselves to assistive technology, with visible focus rings and an undo action in place of the blocking confirm dialog.
- Fix – Documents attached to grouped, external, out-of-stock and catalogue-mode products now show a preview.
- Fix – OneDrive, Dropbox folder and SharePoint share links that saved but never rendered now preview correctly through one shared document-source detector.
- Fix – The local-environment developer notice no longer shows to logged-in shoppers and now appears only on the product edit screen for the store owner.
- Security – Removed the unauthenticated document-delete AJAX endpoint that could be reached without login.
- Dev – Added WCDP_Documents, WCDP_Renderer and WCDP_Document_Source as subclassable seams with documented filters (wcdp_renderer_for_document, wcdp_document_sources, wcdp_preview_hook, wcdp_render_preview) for Pro and third parties.
- Dev – Added a PHPUnit test suite, WPCS coding standards, a generated hook reference and a CI workflow running PHP lint, PHPStan and WPCS.
- Dev – Fixed distribution packaging to ship only runtime vendor code and exclude dev dependencies from the release zip.
1.6.1
- Fixed: Text domain corrected to match plugin slug for full translation compatibility
- Fixed: Replaced unsafe global $post usage with WooCommerce-safe product retrieval for page builder compatibility (Elementor, Divi, Beaver Builder)
- Fixed: Hardcoded button and UI colors replaced with CSS custom properties for better theme integration
- Fixed: Plugin options now use autoload=false to reduce database overhead on every page load
- Improved: Uninstall cleanup now properly removes all plugin data (post meta, options) when deleted
- Improved: Rebuilt minified CSS and RTL stylesheets
- Removed: Legacy BuddyPress code reference that was a copy-paste artifact
- Tested: WordPress 6.9 and WooCommerce 9.x compatibility
1.6.0
- Fixed: Issue preventing product publishing when no document had been added to the Preview Documents meta box
- Improved: Validation logic to allow product saving without requiring a document upload
- Improved: Error handling for smoother product management workflow
- Improved: Groundwork for minified asset delivery and RTL stylesheet distribution
1.5.0
- New: Google Docs Viewer integration for PDF and Office document preview on live sites
- New: Local development preview endpoint with native browser PDF rendering
- New: Dropbox shared link integration with automatic URL conversion for embedding
- New: Google Sheets and Google Slides shared link support
- New: Default file icon for unsupported or unrecognised document formats
- Improved: Document preview UI on both single product and product edit pages
- Improved: Mobile view styling for the preview button and document display area
- Improved: XLS file compatibility for preview and download
- Implemented: Media Library upload integration for document files
- Fixed: DOCX content rendering issues via Google Docs Viewer
- Fixed: FAQ accordion functionality and early text domain loading
- Improved: Admin settings screen icons and Pro tab layout
- Fixed: Various PHPCS coding standard issues
- Cleaned: Removed debug logs, duplicate CSS, and unused files
1.4.4
- Fixed: PHP 8.0 compatibility
- Fixed: iframe preview layout on mobile devices
- Added: Tooltip on the Preview Documents meta box fields
- Tested: WordPress 6.5 compatibility confirmed
1.4.3
- Fixed: PHPCS coding standard issues
- Fixed: Plugin activation redirect when multiple plugins are activated simultaneously
- Fixed: Admin notice conflict with BuddyBoss admin bar
- Improved: Preview item button UI design
1.4.2
- Updated: Wbcom shared admin wrapper to current version
1.4.1
- Fixed: Backend admin UI rendering on the product edit screen
- Fixed: Plugin showing wp_die on activation when WooCommerce is not active; replaced with admin notice
- Fixed: Fatal error on plugin activation in some environments
- Updated: Plugin documentation link
1.4.0
- Fixed: PHPCS compliance fixes throughout codebase
- Fixed: Undefined variable error
- Fixed: Removed install plugin button from admin wrapper
1.3.0
- Fixed: Blank area on product page when no document is attached
- Fixed: Activation redirect issue
- Added: Pro features preview in disabled mode in the admin settings
- Fixed: Cannot upload supported XLS file format
1.2.0
- Fixed: Deprecated jQuery .live() function replaced with .on()
- Fixed: Add button CSS class update
- Fixed: PHP notices and warnings
1.1.0
- Updated: Compatibility with WooCommerce 4.0
1.0.4
- Updated: Compatibility with WooCommerce 3.6.2
1.0.3
- Updated: WooCommerce 3.5.2 compatible
1.0.2
- Updated: General compatibility testing with current WooCommerce and WordPress releases
1.0.1
- Updated: General compatibility testing
1.0.0