Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Contributor CloudCatch

    (@cloudcatch)

    The plugin has been updated and should solve this issue for you.

    Plugin Author CloudCatch

    (@cloudcatch)

    Hello

    You can add the cart number to your email subject by adding something like the below to your child theme functions.php file or in a code snippet:

    add_filter( 'wc_cart_pdf_admin_copy_subject', function( $subject ) {
    $incremented_num = absint( get_option( 'wc_cart_pdf_unique_increment_num', 1 ) );

    $subject = sprintf( esc_html__( 'Cart Number: %s' ), sprintf( '%04d', $incremented_num ) );

    // $subject = sprintf( esc_html__( 'Cart Number: %d' ), $incremented_num ); // Non formatted string

    return $subject;
    } );

    Hope this helps

    Plugin Author CloudCatch

    (@cloudcatch)

    Hello

    Could you please visit your URL /wp-admin/options.php, e.g.:

    https://example.com/wp-admin/options.php

    When that page loads, search for the value wc_cart_pdf_unique_increment_num

    Change that back to 0 (or another number), and then save. WC Cart PDF will start from that number.

    Plugin Author CloudCatch

    (@cloudcatch)

    Hello

    Please navigate to WooCommerce > Settings > Integrations > Cart PDF and enable the option Require customer to populate their information before download PDF.

    This will enable a popup to be displayed to the customer prior to download the PDF.

    To add the name field, please add the following file to child-theme/woocommerce/wc-cart-pdf/modal-capture.php:

    <?php
    /**
    * WC Cart PDF template
    *
    * @package dkjensen/wc-cart-pdf
    */

    ?>

    <dialog id="wc-cart-pdf-modal" class="wc-cart-pdf-modal" role="dialog" aria-labelledby="dialogTitle" aria-describedby="dialogDesc">
    <div class="wc-cart-pdf-modal-content">
    <button class="wc-cart-pdf-modal-close" role="button" aria-label="Close">&times;</button>
    <p id="dialogTitle"><?php esc_html_e( 'Please enter your email address to receive your cart as a PDF.', 'wc-cart-pdf' ); ?></p>
    <div id="wc-cart-pdf-capture-form-errors"></div>
    <form id="wc-cart-pdf-capture-form" class="wc-cart-pdf-capture-form" method="post" action="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'cart-pdf' => '1' ), wc_get_cart_url() ), 'cart-pdf' ) ); ?>">
    <div><input type="email" name="billing_email" id="billing_email" placeholder="<?php esc_html_e( 'Email', 'wc-cart-pdf' ); ?>" value="<?php echo esc_attr( $customer->get_billing_email() ); ?>" required aria-required="true"></div>
    <div><input type="text" name="billing_first_name" id="billing_first_name" placeholder="<?php esc_html_e( 'Name', 'wc-cart-pdf' ); ?>" value="<?php echo esc_attr( $customer->get_billing_first_name() ); ?>" required aria-required="true" /></div>
    <div>
    <label for="email_copy">
    <input type="checkbox" name="email_copy" id="email_copy" value="1" <?php checked( apply_filters( 'wc_cart_pdf_modal_email_copy_default', true ), true ); ?>>
    <?php esc_html_e( 'Send a copy of the PDF via email.', 'wc-cart-pdf' ); ?>
    </label>
    </div>
    <div><button type="submit" class="button wp-element-button"><?php esc_html_e( 'Submit', 'wc-cart-pdf' ); ?></button></div>
    </form>
    </div>
    </dialog>
    Plugin Author CloudCatch

    (@cloudcatch)

    @adamgabor Nice! I believe this answer is related to the issue you were having.

    You should be able to remove previous code added to the wp-config.php file and child theme functions.php file and just keep that newest snippet that worked.

    Plugin Author CloudCatch

    (@cloudcatch)

    Could you try adding the following snippet to your child theme functions.php file?

    /**
    * Replace image URLs with local paths in the cart PDF.
    *
    * @param string $content The cart PDF content.
    * @return string
    */
    add_filter( 'wc_cart_pdf_content', function( $content ) {
    $wp_upload_dir = wp_upload_dir();

    $content = str_replace( $wp_upload_dir['baseurl'], $wp_upload_dir['basedir'], $content );

    return $content;
    } );

    Plugin Author CloudCatch

    (@cloudcatch)

    @revxx14 Version 2.0.0 was released which should fix this issue. I would like to warn however if you have any custom CSS applied to the tabs, to test the plugin update on a staging environment before upgrading on production

    Plugin Author CloudCatch

    (@cloudcatch)

    @revxx14 Thanks for bringing this to my attention. The tabs plugin uses the block clientId as a unique identifier, it seems when other blocks outside of the tabs are modified/removed, it can change the clientId of the tabs.

    I’m currently working on refactoring this plugin, and I will be sure this is fixed in the next update.

    Plugin Author CloudCatch

    (@cloudcatch)

    @pahedomotica I’m not too familiar with WebP, and a quick Google does not bring up any issues with the PDF library this plugin issues. You could try disabling WebP conversion on PDFs?

    add_action( 'wc_cart_pdf_before_process', function() {
        add_filter( 'webpc_supported_source_file', '__return_false' );
    } );
    Plugin Author CloudCatch

    (@cloudcatch)

    @pahedomotica Are you using a plugin such as WebP Express to convert PNG to WebP?

    Plugin Author CloudCatch

    (@cloudcatch)

    @yesudream The latest update version 2.3.0 should fix Korean fonts being broken.

    Plugin Author CloudCatch

    (@cloudcatch)

    Hi @yesudream

    Could you try the following code snippet

    add_filter( 'wc_cart_pdf_mpdf_args', function( $args ) {
    	$args['mode'] = 'ja+aCJK';
    
    	return $args;
    } );
    Plugin Author CloudCatch

    (@cloudcatch)

    @boo6ie It sounds like you may need to capture the customer data, regardless if the user visits the checkout or not. The plugin will pull the users data from their account if they are logged in, so a simple fix would be to require the user to register prior to downloading the PDF. Alternatively, you could create a form that the user must fill out with their data, prior to downloading the cart PDF.

    The latter has been requested a few times, and I am working on implementing such a feature that will be released in the future.

    Plugin Author CloudCatch

    (@cloudcatch)

    Hi @rocoart

    Yes it is possible, though I am not that familiar with Gravity Forms. According to the documentation it looks like you can use the following to output an entry field value:

    rgar( $entry, '1' ); // returns the value associated with field 1

    Plugin Author CloudCatch

    (@cloudcatch)

    @pahedomotica Did you perhaps add a filter to modify the button? Out of the box the button labels changes on cart and checkout page.

Viewing 15 replies - 1 through 15 (of 15 total)