• Hi guys,

    After the last WC update we noticed that our “Download invoice” and “Reorder” buttons are not displaying anymore on the “view-order” pages.

    We use the same function for “woocommerce_thankyou_order_received_text” and it works, so our guess is that someone weird is going on with the “woocommerce_view_order” hook.

    Here’s our function :

    add_filter('woocommerce_view_order', 'wc_order_actions', 9, 2);
    add_filter('woocommerce_thankyou_order_received_text', 'wc_order_actions', 9, 2);
    function wc_order_actions( $output, $order ) {
    	if ( is_user_logged_in() ) {
    		$pdf_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=invoice&order_ids=' . $order->id  . '&my-account'), 'generate_wpo_wcpdf' );
        		$output = '<div class="order-actions"><a href="'.esc_attr($pdf_url).'" class="button">Download Invoice</a>';
    		if(isset($_GET['view-order'])) {
    				$order_id = $_GET['view-order'];
    				//$order = new WC_Order($order_id);
    				woocommerce_order_again_button( $order );
    		}
    		$output .= '</div>';
    	}
    	return $output;
    }

    System report :

    
    ### WordPress Environment ###
    
    Home URL: https://www.patchify.com
    Site URL: https://www.patchify.com
    WC Version: 2.6.9
    Log Directory Writable: ?
    WP Version: 4.7
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: ?
    WP Cron: ?
    Language: en_US
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.0.8-0ubuntu0.16.04.3
    PHP Post Max Size: 100 MB
    PHP Time Limit: 3600
    PHP Max Input Vars: 1000
    cURL Version: 7.47.0
    OpenSSL/1.0.2g
    
    SUHOSIN Installed: –
    MySQL Version: 5.7.14
    Max Upload Size: 50 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 2.6.9
    : 
    woocommerce_sessions: ?
    woocommerce_api_keys: ?
    woocommerce_attribute_taxonomies: ?
    woocommerce_downloadable_product_permissions: ?
    woocommerce_order_items: ?
    woocommerce_order_itemmeta: ?
    woocommerce_tax_rates: ?
    woocommerce_tax_rate_locations: ?
    woocommerce_shipping_zones: ?
    woocommerce_shipping_zone_locations: ?
    woocommerce_shipping_zone_methods: ?
    woocommerce_payment_tokens: ?
    woocommerce_payment_tokenmeta: ?
    MaxMind GeoIP Database: ?
    
    ### Active Plugins (33) ###
    
    Query Monitor: by John Blackbourn – 2.13.2
    Ultimate Addons for Visual Composer: by Brainstorm Force – 3.16.7
    Affiliates Enterprise: by itthinx – 2.16.5
    Affiliates Permanent: by itthinx – 1.3.0
    Affiliates WooCommerce Integration: by itthinx – 1.6.0
    Brozzme Multiple Admin Emails: by Benoti – 1.2.0
    Cloudflare: by John Wineman
    Furkan Yilmaz
    Junade Ali (Cloudflare Team) – 3.1.1
    
    Cornerstone: by Themeco – 1.3.3
    Formidable AWeber: by Strategy11 – 2.01
    Formidable: by Strategy11 – 2.02.11
    Global Content Blocks: by Dave Liske – 2.1.5
    Google Analytics by Yoast Premium: by Team Yoast – 5.4.7
    Groups: by itthinx – 1.13.1
    WPBakery Visual Composer: by Michael M - WPBakery.com – 5.0.1
    Popup Maker: by WP Popup Maker – 1.4.21
    WPML Multilingual CMS: by OnTheGoSystems – 3.6.2
    UberMenu Conditionals: by Chris Mavricos
    SevenSpark – 3.0
    
    UberMenu 3 - The Ultimate WordPress Mega Menu: by Chris Mavricos
    SevenSpark – 3.2.5
    
    Aelia Currency Switcher for WooCommerce: by Aelia – 3.9.11.160928
    WooCommerce Stripe Gateway: by Automattic – 3.0.6
    WooCommerce Google Analytics Integration: by WooThemes – 1.4.0
    Woocommerce Image Zoom: by wpbean – 1.0
    WooCommerce Multilingual: by OnTheGoSystems – 4.0.1
    WooCommerce Order Status Manager: by WooThemes / SkyVerge – 1.6.3
    WooCommerce PDF Invoices & Packing Slips: by Ewout Fernhout – 1.5.38
    woocommerce Price and size: by RWS – 1.0.0
    WooCommerce TM Extra Product Options: by themecomplete – 4.4
    WooCommerce WooCart Pro: by Festi Team – 2.4
    WooCommerce: by WooThemes – 2.6.9
    WP Mail Logging: by Christian Z?ller – 1.7.0
    WPML Media: by OnTheGoSystems – 2.1.23
    WPML String Translation: by OnTheGoSystems – 2.5.1
    WPML Translation Management: by OnTheGoSystems – 2.2.6
    
    ### Settings ###
    
    Force SSL: –
    Currency: USD (US$)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 16
    
    ### API ###
    
    API Enabled: ?
    
    ### WC Pages ###
    
    Shop Base: #4 - /marketplace/
    Cart: #5 - /cart/
    Checkout: #6 - /checkout/
    My Account: ? Page does not contain the shortcode: [woocommerce_my_account]
    
    ### Taxonomies ###
    
    Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    ### Theme ###
    
    Name: X - Child Theme: Integrity Light
    Version: 1.0.0
    Author URL: https://theme.co/
    Child Theme: ?
    Parent Theme Name: X
    Parent Theme Version: 4.6.4
    Parent Theme Author URL: https://theme.co/
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: Your theme has a woocommerce.php file
    you will not be able to override the woocommerce/archive-product.php custom template since woocommerce.php has priority over archive-product.php. This is intended to prevent display issues.
    
    Overrides: x/woocommerce/cart/cart-empty.php
    x-child-integrity-light/woocommerce/cart/cart-totals.php
    x/woocommerce/cart/cross-sells.php
    x-child-integrity-light/woocommerce/checkout/form-checkout.php
    x-child-integrity-light/woocommerce/checkout/review-order.php
    x-child-integrity-light/woocommerce/emails/email-order-details.php
    x/woocommerce/loop/loop-end.php
    x/woocommerce/loop/loop-start.php
    x/woocommerce/loop/pagination.php
    x-child-integrity-light/woocommerce/myaccount/my-account.php
    x/woocommerce/notices/error.php
    x/woocommerce/notices/notice.php
    x/woocommerce/notices/success.php
    x-child-integrity-light/woocommerce/order/order-details-item.php
    x-child-integrity-light/woocommerce/order/order-details.php
    x-child-integrity-light/woocommerce/single-product/add-to-cart/variation.php
    x/woocommerce/single-product/product-image.php
    x/woocommerce/single-product/product-thumbnails.php
    x/woocommerce/single-product/related.php
    x/woocommerce/single-product/tabs/tabs.php
    x/woocommerce/single-product/up-sells.php
    x/woocommerce/single-product-reviews.php
    
    
  • The topic ‘Hook woocommerce_view_order not working after update’ is closed to new replies.