• Resolved kockylau

    (@kockylau)


    Hi

    We have noticed that since the last update to 5.3 we can’t allow other downloadable products (not in the order) when it was possible before…
    It was super practical when we need to allow an extra product for some customers.

    We have noticed in your changelogs that:
    Fix – Added parameter $item (instance of WC_Order_Item) to both the function wc_downloadable_file_permission and the filter hook woocommerce_downloadable_file_permission. #23188

    So I assume that if the item id is not in the order, it won’t allow it.
    Is there a way to allow it?

    Many thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Are you adding a downloadable product to an existing order from back-end? Could you please provide more details as well as the following?

    System Status:?You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”. Once you’ve done that, paste it here in your response.

    Error log:?share a copy of the fatal error log found under WooCommerce > System Status > Logs (if available)

    Thread Starter kockylau

    (@kockylau)

    Hi Maykato

    Many thanks for your answer.
    Sorry, yes I meant from the backend order.
    After an order is placed, if I need to grant access to another product, I got a popup error as the product is not part of the order. Which was not an issue before the last update.
    If I roll back the function function grant_access_to_download() then it is working as I was happy with. So I was wondering if a hook has been put in place to allow to grant access to the product we want without checking if this is part of the order.

    With the last update, if I want to add a product which was not part of the order then I can’t. I got the error popup to let me know that the product access can’t be granted.

    Here the System status:
    `
    ### WordPress Environment ###

    WordPress address (URL): https://xxxxx.fr
    Site address (URL): https://xxxxx.fr
    WC Version: 5.3.0
    REST API Version: ? 5.3.0
    WC Blocks Version: ? 4.9.1
    Action Scheduler Version: ? 3.1.6
    WC Admin Version: ? 2.2.6
    Log Directory Writable: ?
    WP Version: 5.7.2
    WP Multisite: –
    WP Memory Limit: 256 Mo
    WP Debug Mode: ?
    WP Cron: ?
    Language: fr_FR
    External object cache: –

    ### Server Environment ###

    Server Info: nginx/1.19.10
    PHP Version: 7.4.18
    PHP Post Max Size: 128 Mo
    PHP Time Limit: 300
    PHP Max Input Vars: 10000
    cURL Version: 7.68.0
    OpenSSL/1.1.1f

    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.5.9-MariaDB-1:10.5.9+maria~focal
    Max Upload Size: 128 Mo
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?

    ### Database ###

    WC Database Version: 5.3.0
    WC Database Prefix: wp_
    Taille totale de la base de données: 3261.48MB
    Taille de la base de données: 1675.35MB
    Taille de l’index: 1586.13MB
    wp_woocommerce_sessions: Données?: 27.06MB + Index?: 1.50MB + Moteur InnoDB
    wp_woocommerce_api_keys: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_woocommerce_attribute_taxonomies: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_woocommerce_downloadable_product_permissions: Données?: 9.52MB + Index?: 37.77MB + Moteur InnoDB
    wp_woocommerce_order_items: Données?: 7.52MB + Index?: 5.03MB + Moteur InnoDB
    wp_woocommerce_order_itemmeta: Données?: 74.61MB + Index?: 82.72MB + Moteur InnoDB
    wp_woocommerce_tax_rates: Données?: 0.02MB + Index?: 0.08MB + Moteur InnoDB
    wp_woocommerce_tax_rate_locations: Données?: 0.02MB + Index?: 0.05MB + Moteur InnoDB
    wp_woocommerce_shipping_zones: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_woocommerce_shipping_zone_locations: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_woocommerce_shipping_zone_methods: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_woocommerce_payment_tokens: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_woocommerce_payment_tokenmeta: Données?: 0.02MB + Index?: 0.05MB + Moteur InnoDB
    wp_woocommerce_log: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_actionscheduler_actions: Données?: 2.02MB + Index?: 2.66MB + Moteur InnoDB
    wp_actionscheduler_claims: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_actionscheduler_groups: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_actionscheduler_logs: Données?: 2.02MB + Index?: 2.03MB + Moteur InnoDB
    wp_commentmeta: Données?: 2.52MB + Index?: 3.03MB + Moteur InnoDB
    wp_comments: Données?: 12.44MB + Index?: 14.95MB + Moteur InnoDB
    wp_icl_content_status: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_icl_core_status: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_icl_flags: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_icl_languages: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_icl_languages_translations: Données?: 0.19MB + Index?: 0.11MB + Moteur InnoDB
    wp_icl_locale_map: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_icl_message_status: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_icl_mo_files_domains: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_icl_node: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_icl_reminders: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_icl_strings: Données?: 11.52MB + Index?: 14.88MB + Moteur InnoDB
    wp_icl_string_batches: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_icl_string_packages: Données?: 0.06MB + Index?: 0.00MB + Moteur InnoDB
    wp_icl_string_pages: Données?: 1008.00MB + Index?: 1156.00MB + Moteur InnoDB
    wp_icl_string_positions: Données?: 5.25MB + Index?: 1.14MB + Moteur InnoDB
    wp_icl_string_status: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_icl_string_translations: Données?: 5.52MB + Index?: 3.03MB + Moteur InnoDB
    wp_icl_string_urls: Données?: 1.52MB + Index?: 0.48MB + Moteur InnoDB
    wp_icl_translate: Données?: 46.55MB + Index?: 1.52MB + Moteur InnoDB
    wp_icl_translate_job: Données?: 0.08MB + Index?: 0.05MB + Moteur InnoDB
    wp_icl_translations: Données?: 0.47MB + Index?: 1.09MB + Moteur InnoDB
    wp_icl_translation_batches: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_icl_translation_downloads: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_icl_translation_status: Données?: 20.06MB + Index?: 0.16MB + Moteur InnoDB
    wp_ju_queue: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_links: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_options: Données?: 6.08MB + Index?: 1.19MB + Moteur InnoDB
    wp_pimwick_gift_card: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_pimwick_gift_card_activity: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_postmeta: Données?: 210.64MB + Index?: 141.17MB + Moteur InnoDB
    wp_posts: Données?: 103.45MB + Index?: 12.25MB + Moteur InnoDB
    wp_sbi_instagram_feeds_posts: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_sbi_instagram_feed_locator: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_sbi_instagram_posts: Données?: 0.25MB + Index?: 0.00MB + Moteur InnoDB
    wp_sib_model_forms: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_sib_model_lang: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_sib_model_users: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_smush_dir_images: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_socialsnap_stats: Données?: 0.34MB + Index?: 0.00MB + Moteur InnoDB
    wp_termmeta: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_terms: Données?: 0.05MB + Index?: 0.03MB + Moteur InnoDB
    wp_term_relationships: Données?: 0.41MB + Index?: 0.27MB + Moteur InnoDB
    wp_term_taxonomy: Données?: 0.06MB + Index?: 0.03MB + Moteur InnoDB
    wp_usermeta: Données?: 70.58MB + Index?: 56.03MB + Moteur InnoDB
    wp_users: Données?: 4.52MB + Index?: 4.42MB + Moteur InnoDB
    wp_wcpdf_invoice_number: Données?: 0.47MB + Index?: 0.00MB + Moteur InnoDB
    wp_wc_admin_notes: Données?: 0.05MB + Index?: 0.00MB + Moteur InnoDB
    wp_wc_admin_note_actions: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_wc_category_lookup: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_wc_customer_lookup: Données?: 2.52MB + Index?: 2.02MB + Moteur InnoDB
    wp_wc_download_log: Données?: 5.52MB + Index?: 6.55MB + Moteur InnoDB
    wp_wc_order_coupon_lookup: Données?: 0.06MB + Index?: 0.09MB + Moteur InnoDB
    wp_wc_order_product_lookup: Données?: 5.52MB + Index?: 10.61MB + Moteur InnoDB
    wp_wc_order_stats: Données?: 2.52MB + Index?: 4.83MB + Moteur InnoDB
    wp_wc_order_tax_lookup: Données?: 1.52MB + Index?: 0.77MB + Moteur InnoDB
    wp_wc_product_meta_lookup: Données?: 0.09MB + Index?: 0.13MB + Moteur InnoDB
    wp_wc_reserved_stock: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_wc_tax_rate_classes: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_wc_webhooks: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
    wp_wpmf_queue: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_wpmm_subscribers: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
    wp_yith_wcwl: Données?: 1.03MB + Index?: 0.06MB + Moteur InnoDB
    wp_yith_wcwl_lists: Données?: 2.09MB + Index?: 6.06MB + Moteur InnoDB
    wp_yoast_indexable: Données?: 16.53MB + Index?: 9.53MB + Moteur InnoDB
    wp_yoast_indexable_hierarchy: Données?: 0.39MB + Index?: 0.52MB + Moteur InnoDB
    wp_yoast_migrations: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
    wp_yoast_primary_term: Données?: 0.05MB + Index?: 0.03MB + Moteur InnoDB
    wp_yoast_seo_links: Données?: 2.39MB + Index?: 0.58MB + Moteur InnoDB
    wp_yoast_seo_meta: Données?: 0.41MB + Index?: 0.00MB + Moteur InnoDB

    ### Post Type Counts ###

    advgb_profiles: 1
    attachment: 5603
    custom_css: 2
    nav_menu_item: 101
    oembed_cache: 419
    page: 53
    portfolio: 28
    post: 143
    product: 224
    product_variation: 288
    revision: 3537
    shop_coupon: 126
    shop_order: 40759
    shop_order_refund: 20
    vc_settings_preset: 5
    wp_block: 4

    ### Security ###

    Secure connection (HTTPS): ?
    Hide errors from visitors: ?

    ### Active Plugins (43) ###

    WPML Multilingual CMS: par OnTheGoSystems – 4.4.10
    PublishPress Blocks: par PublishPress – 2.7.0
    PublishPress Capabilities: par PublishPress – 2.0.2
    Cart2Cart: Password Migration: par MagneticOne – 1.1
    Envato Market: par Envato – 2.0.6
    HookMeUp – Additional Content for WooCommerce: par GetBowtied – 1.3.3
    Smash Balloon Instagram Feed: par Smash Balloon – 2.9.1
    éditeur de page: par Michael M – WPBakery.com – 6.4.1
    Newsletter, SMTP, Email marketing and Subscribe forms by Sendinblue: par Sendinblue – 3.1.13
    MIMO Woocommerce Order Tracking: par Surakrai Nookong – 1.0.2
    PayPlug pour WooCommerce (Officiel): par PayPlug – 1.2.6
    PW WooCommerce Gift Cards Pro: par Pimwick
    LLC – 1.306

    PW WooCommerce Copy Coupon: par Pimwick
    LLC – 1.17

    Regenerate Thumbnails: par Alex Mills (Viper007Bond) – 3.1.5
    Shopkeeper Deprecated Features: par GetBowtied – 1.1.6
    Shopkeeper Extender: par GetBowtied – 1.6.9
    Shopkeeper Portfolio Addon: par GetBowtied – 1.3.5
    Social Snap: par Social Snap – 1.1.15
    Stackable – Gutenberg Blocks: par Gambit Technologies
    Inc – 2.15.2

    Sucuri Security – Auditing, Malware Scanner and Hardening: par Sucuri Inc. – 1.8.26
    Ultimate Addons for Gutenberg: par Brainstorm Force – 1.22.4
    User Switching: par John Blackbourn & les contributeurs – 1.5.7
    WooCommerce Weight Based Shipping: par weightbasedshipping.com – 5.3.11
    Advanced Order Export For WooCommerce: par AlgolPlus – 3.1.8
    WooCommerce Print Address Labels: par Ewout Fernhout – 1.7.1
    WooCommerce Checkout Field Editor: par WooCommerce – 1.5.21
    WooCommerce PayPal Checkout Gateway: par WooCommerce – 2.1.1
    WooCommerce Multilingual: par OnTheGoSystems – 4.11.5
    WooCommerce PDF Invoices & Packing Slips: par Ewout Fernhout – 2.8.3
    WooCommerce Sequential Order Numbers: par SkyVerge – 1.9.5
    WooCommerce Shipping & Tax: par WooCommerce – 1.25.12 (une mise à jour de la version 1.25.13 est disponible)
    WooCommerce Wholesale Order Form: par Rymera Web Co – 1.18
    WooCommerce Wholesale Prices Premium: par Rymera Web Co – 1.25.2
    WooCommerce Wholesale Prices: par Rymera Web Co – 1.14.1
    WooCommerce: par Automattic – 5.3.0
    Yoast SEO: par L’équipe Yoast – 16.3
    WP Media folder: par Joomunited – 5.3.16
    WPML Media: par OnTheGoSystems – 2.6.4
    WPML String Translation: par OnTheGoSystems – 3.1.8
    WPML Translation Management: par OnTheGoSystems – 2.10.6
    WP Overnight Sidekick: par Jeremiah Prummer
    Ewout Fernhout
    Michael Kluver – 2.3.1

    WPS Hide Login: par WPServeur
    NicolasKulka
    wpformation – 1.8.5

    YITH Cost of Goods for WooCommerce: par YITH – 1.2.14

    ### Inactive Plugins (4) ###

    One Click Demo Import: par ProteusThemes – 2.6.1
    WordPress Importer: par wordpressdotorg – 0.7
    WP Maintenance Mode: par Designmodo – 2.4.0
    YITH WooCommerce Wishlist: par YITH – 3.0.22

    ### Must Use Plugins (1) ###

    Kinsta Must-use Plugins: par Kinsta Team – 2.3.1

    ### Settings ###

    API Enabled: –
    Force SSL: –
    Currency: EUR (€)
    Currency Position: right
    Thousand Separator:
    Decimal Separator: ,
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    pw gift card (pw-gift-card)
    simple (simple)
    variable (variable)

    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)

    Connected to WooCommerce.com: –

    ### WC Pages ###

    Base de la boutique: #29 – https://xxxxx.fr/boutique/
    Panier: #30 – https://xxxxx.fr/cart/
    Commander: #31 – https://xxxxx.fr/checkout/
    Mon compte: #32 – https://xxxxx.fr/my-account/
    Conditions générales de vente et d’utilisation: #1406 – https://xxxxx.fr/cgv/

    ### Theme ###

    Name: Shopkeeper Child
    Version: 1.0
    Author URL:
    Child Theme: ?
    Parent Theme Name: Shopkeeper
    Parent Theme Version: 2.9.43
    Parent Theme Author URL: https://www.getbowtied.com/
    WooCommerce Support: ?

    ### Templates ###

    Overrides: shopkeeper/woocommerce/archive-product.php
    shopkeeper/woocommerce/checkout/form-coupon.php
    shopkeeper/woocommerce/checkout/form-login.php
    shopkeeper/woocommerce/content-product.php
    shopkeeper/woocommerce/content-single-product.php
    shopkeeper/woocommerce/global/quantity-input.php
    shopkeeper/woocommerce/global/sidebar.php
    shopkeeper/woocommerce/global/wrapper-end.php
    shopkeeper/woocommerce/global/wrapper-start.php
    shopkeeper/woocommerce/myaccount/form-login.php
    shopkeeper/woocommerce/single-product/add-to-cart/simple.php
    shopkeeper-child/woocommerce/single-product/meta.php
    shopkeeper-child/woocommerce/single-product/product-image.php
    shopkeeper/woocommerce/single-product/product-thumbnails.php
    shopkeeper-child/woocommerce/single-product/related.php
    shopkeeper-child/woocommerce/single-product/tabs/tabs.php
    shopkeeper/woocommerce/single-product.php

    ### Action Scheduler ###

    Terminé: 4?247
    Oldest: 2021-04-27 16:21:21 +0000
    Newest: 2021-05-28 14:39:43 +0000

    échoué: 2
    Oldest: 2019-06-24 19:16:59 +0000
    Newest: 2019-06-24 19:17:23 +0000

    ### Status report information ###

    Generated at: 2021-05-28 17:32:55 +02:00

    Many thanks

    Hi,

    After an order is placed, if I need to grant access to another product, I got a popup error as the product is not part of the order. Which was not an issue before the last update.

    Thank you for your reply and clarification. I could see the issue on my end – on my test site with WooCommerce 5.3.0, I did get the “Could not grant access” error when I tried to grant access another downloadable file under Downloadable product permissions. But I was able to add another file with older version of WooCommerce.

    If you feel that this is a bug, you can submit it to the core GitHub repo so our developers can take a look: https://github.com/woocommerce/woocommerce/issues/new/choose

    Hi @kockylau

    It looks like this issue has been reported here: https://github.com/woocommerce/woocommerce/issues/29884

    For now, please try this workaround until the issue is fixed.
    https://github.com/woocommerce/woocommerce/issues/29884#issuecomment-840421600

    I’ll mark this thread as resolved now, but if you have any further questions, please feel free to open a new topic.

    • This reply was modified 3 years, 9 months ago by MayKato.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can’t add a downloadable product anymore’ is closed to new replies.