• Resolved gibonwebbuppsala

    (@gibonwebbuppsala)


    Hello David,

    Thank you for a brilliant plugin. I’m working with at project where we need a front end field (customer price) that is going to override the prices on the PDF.

    The idea is that a whole seller can then create a quote for an end customer by entering the prices that he wants. I’m planning to create the fields with ACF but I’m open for suggestions.

    How would you suggest that I get the information to the template of the plugin?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Jensen

    (@dkjensen)

    Hello

    What you can do is create your frontend form w/ text fields, and the form method is GET (can maybe do POST too but haven’t tried that). The form action would be:

    <?php echo esc_url( wp_nonce_url( add_query_arg( array( 'cart-pdf' => '1' ), wc_get_cart_url() ), 'cart-pdf' ) ); ?>

    That will pass your form fields to the PDF via the URL.

    Then you can override the PDF template, copy the PDF template from the plugin folder wc-cart-pdf/templates/cart-table.php into your child theme folder child-theme/woocommerce/wc-cart-pdf/cart-table.php and grab your URL parameters there.

    Thread Starter gibonwebbuppsala

    (@gibonwebbuppsala)

    Thank you David! 🙂

    Plugin Author David Jensen

    (@dkjensen)

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add custom front-end field to the pdf’ is closed to new replies.