Forum Replies Created

Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter bluebirdwebdev

    (@bluebirdwebdev)

    Hi Ewout,

    Firstly, I should mention that while the invoice payment gateway is installed, it isn’t an active/enabled payment method.

    I have some interesting things to report back:

    Click Disabled – Only enabled payment option = Cash on Delivery
    – Admin email successfully automatically attaches PDF invoice

    Click Enabled, but chosen payment option = Cash on Delivery
    – Admin email successfully automatically attaches PDF invoice
    – Customer completed order email successfully automatically attaches PDF invoice

    Click Enabled, but using a 100% discount voucher to skip payment gateway and automatically refresh to WooCommerce successful order page. Cash on delivery also enabled.
    – Admin email successfully automatically attaches PDF invoice
    – Customer completed order email successfully automatically attaches PDF invoice

    Click enabled and a live transaction of $0.10 processed with live credit card details. Cash on delivery disabled.
    – Admin email missing PDF invoice
    – Customer completed order email successfully automatically attaches PDF invoice

    Yes, the payment gateway you linked in your post is the correct one – Click by Paymark. Whilst it hasn’t been updated in a while, it still functions fine, except for this apparent conflict with PDF invoices.

    Thread Starter bluebirdwebdev

    (@bluebirdwebdev)

    Hi Ewout,

    Thanks for the prompt reply.

    I don’t use the MultiSafePay payment plugin.

    I don’t use your plugin to generate any other emails (eg packing slips) so can’t say whether or not this is occurring elsewhere.

    I don’t have a staging site set up, but could potentially look at doing this to help rule out plugin conflicts.

    I must admit, the functionality was working correctly up until a point that it wasn’t… Not helpful I know, however I can’t recall at what point it stopped working or if any new plugins were installed that caused it to stop it working.

    Here is a list of what is installed:

    Better Font Awesome
    Contact Form 7
    Duplicate Post
    Flamingo
    Google Analytics Dashboard for WP (GADWP)
    Postcode Based Order Restriction
    Really Simple SSL
    Compress JPEG & PNG images
    UpdraftPlus – Backup/Restore
    User Role Editor
    User Switching
    WooCommerce Invoice Gateway
    WooCommerce No Shipping Message
    White Label CMS
    WooCommerce Shipping Method Display Style
    WooCommerce Click Gateway
    WooCommerce PDF Invoices & Packing Slips
    WooCommerce Table Rate Shipping
    WooCommerce Wholesale Prices Premium
    WooCommerce Wholesale Prices
    WooCommerce
    WooSidebars
    Wordfence Security
    Yoast SEO

    Here is a list of some changes to the function.php file in my child theme. However I am unsure how these would affect the PDF invoice attaching to the email.

    
    /**
     * AUTO COMPLETE PAID ORDERS IN WOOCOMMERCE
     */
    add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_paid_order', 10, 1 );
    function custom_woocommerce_auto_complete_paid_order( $order_id ) {
      if ( ! $order_id )
        return;
    
      $order = wc_get_order( $order_id );
    
      // No updated status for orders delivered with Bank wire, Cash on delivery and Cheque payment methods.
      if ( ( 'invoice' == get_post_meta($order_id, '_payment_method', true) ) || ( 'cod' == get_post_meta($order_id, '_payment_method', true) ) || ( 'cheque' == get_post_meta($order_id, '_payment_method', true) ) ) {
        return;
      } 
      // "completed" updated status for paid Orders with all others payment methods
      else {
        $order->update_status( 'completed' );
      }
    }
    
    /**
     * Format order number with invoice number settings
     */
    add_filter( 'wpo_wcpdf_raw_document_number', 'wpo_wcpdf_raw_document_number', 10, 4 );
    function wpo_wcpdf_raw_document_number( $number, $settings, $document, $order ) {
        if ( $document->get_type() == 'invoice' ) {
            $number = $order->get_order_number();
        }
     
        return $number;
    }
    
    /**
    * @snippet Notice with $$$ remaining to Free Shipping @ WooCommerce Cart
    */
     
    function bbloomer_free_shipping_cart_notice_zones() {
     
    global $woocommerce;
     
    // Get Free Shipping Methods for Rest of the World Zone & populate array $min_amounts
     
    $default_zone = new WC_Shipping_Zone(0);
    $default_methods = $default_zone->get_shipping_methods();
     
    foreach( $default_methods as $key => $value ) {
        if ( $value->id === "free_shipping" ) {
          if ( $value->min_amount > 0 ) $min_amounts[] = $value->min_amount;
        }
    }
     
    // Get Free Shipping Methods for all other ZONES & populate array $min_amounts
     
    $delivery_zones = WC_Shipping_Zones::get_zones();
     
    foreach ( $delivery_zones as $key => $delivery_zone ) {
      foreach ( $delivery_zone['shipping_methods'] as $key => $value ) {
        if ( $value->id === "free_shipping" ) {
        if ( $value->min_amount > 0 ) $min_amounts[] = $value->min_amount;
        }
      }
    }
     
    // Find lowest min_amount
     
    if ( is_array($min_amounts) ) {
     
    $min_amount = min($min_amounts);
     
    // Get Cart Subtotal inc. Tax excl. Shipping
     
    $current = WC()->cart->subtotal;
     
    // If Subtotal < Min Amount Echo Notice
    // and add "Continue Shopping" button
     
    if ( $current < $min_amount ) {
    $added_text = esc_html__('Get free shipping if you spend ', 'woocommerce' ) . wc_price( $min_amount - $current ) . esc_html__(' more!', 'woocommerce' );
    $return_to = apply_filters( 'woocommerce_continue_shopping_redirect', wc_get_raw_referer() ? wp_validate_redirect( wc_get_raw_referer(), false ) : wc_get_page_permalink( 'shop' ) );
    $notice = sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', esc_url( $return_to ), esc_html__( 'Continue Shopping', 'woocommerce' ), $added_text );
    wc_print_notice( $notice, 'notice' );
    }
     
    }
     
    }
     
    add_action( 'woocommerce_before_cart', 'bbloomer_free_shipping_cart_notice_zones' );
    
    ?>
    Thread Starter bluebirdwebdev

    (@bluebirdwebdev)

    Hi Stuart,

    Thanks, appreciate the reply.

    Is it standard that the payment gateway plugin itself should take care of the return url?

    Meaning I do not have to specify this anywhere myself?

    Thread Starter bluebirdwebdev

    (@bluebirdwebdev)

    Bump – Surely someone must have an idea!

Viewing 4 replies - 16 through 19 (of 19 total)