The BookChoix Bookstore theme includes action hooks for integrating your own PDF viewer using the action hooks shown below.
Before integrating your custom PDF viewer, you have to tell the BookChoix theme that you’re going to use a Custom viewer by adding the below PHP constant.
define( 'BKC_CUSTOM_PDFVIEWER', true );
bookchoix_main_pdf_single
For embedding custom viewer in WooCommerce single page for attaching the Main PDF (all pages).
Example code snippet
add_action( 'bookchoix_main_pdf_single', 'custom_main_viewer', 10, 2 ); function custom_main_viewer( $book_url, $pdf_id ) { // do something with $book_url and $pdf_id }
bookchoix_sample_pdf_single
For embedding custom viewer in WooCommerce single page for attaching the Sample PDF.
add_action( 'bookchoix_sample_pdf_single', 'custom_sample_viewer', 10, 2 ); function custom_sample_viewer( $book_url, $pdf_id ) { // do something with $book_url and $pdf_id }
bookchoix_main_pdf_my_accounts
For embedding custom viewer in WooCommerce My accounts -> My Books page for attaching the Main PDF (all pages).
add_action( 'bookchoix_main_pdf_my_accounts', 'custom_mybooks_viewer', 10, 2 ); function custom_mybooks_viewer( $book_url, $pdf_id ) { // do something with $book_url and $pdf_id }