woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.38k stars 10.76k forks source link

Buttons added via woocommerce_order_item_add_action_buttons are lost when a refresh is triggered via other action buttons. #34139

Closed tommybutter closed 2 years ago

tommybutter commented 2 years ago

Prerequisites

Describe the bug

When a custom button is added to the Order Item Action section via the action 'woocommerce_order_item_add_action_buttons' the button functions as expected however the other default ajax actions such as adding and removing items trigger a refresh on the frame when their AJAX completes, this loads the html template and does not execute the action meaning the custom buttons are lost until the page is refreshed.

Expected behavior

Executing any action should keep the buttons in their place in the UI

Actual behavior

Buttons disappear after other actions trigger

Steps to reproduce

  1. Add custom button via plugin
  2. Execute any other order item action from the default buttons

WordPress Environment

`

WordPress Environment

WordPress address (URL): https://development.local Site address (URL): https://development.local WC Version: 6.7.0 REST API Version: ✔ 6.7.0 WC Blocks Version: ✔ 7.8.3 Action Scheduler Version: ✔ 3.4.0 Log Directory Writable: ✔ WP Version: 6.0.1 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: ✔ WP Cron: ✔ Language: en_US External object cache: –

Server Environment

Server Info: Apache/2.4.43 (Win32) PHP Version: 7.4.1 PHP Post Max Size: 1,000 MB PHP Time Limit: 1200 PHP Max Input Vars: 4000 cURL Version: 7.67.0 OpenSSL/1.1.1d

SUHOSIN Installed: – MySQL Version: 8.0.16 Max Upload Size: 300 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔

Database

WC Database Version: 6.7.0 WC Database Prefix: wp_ Total Database Size: 32.56MB Database Data Size: 26.82MB Database Index Size: 5.74MB wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.05MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.31MB + Index: 0.33MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB fakenames: Data: 2.52MB + Index: 0.00MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.11MB + Index: 0.13MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.08MB + Index: 0.03MB + Engine InnoDB wp_automatewoo_abandoned_carts: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_automatewoo_customer_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_automatewoo_customers: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_automatewoo_events: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_automatewoo_guest_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_automatewoo_guests: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_automatewoo_log_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_automatewoo_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_automatewoo_queue: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_automatewoo_queue_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_cfm_product_switches: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.38MB + Index: 0.33MB + Engine InnoDB wp_e_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_import_detail_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_import_log_detail: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_import_postid: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 18.06MB + Index: 0.09MB + Engine InnoDB wp_postmeta: Data: 2.41MB + Index: 2.66MB + Engine InnoDB wp_posts: Data: 0.44MB + Index: 0.14MB + Engine InnoDB wp_revslider_css: Data: 0.20MB + Index: 0.00MB + Engine InnoDB wp_revslider_css_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_layer_animations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_layer_animations_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_navigations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_navigations_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_sliders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_sliders_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_slides_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_static_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_static_slides_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_smackcsv_file_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_smackuci_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_ultimate_csv_importer_acf_fields: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ultimate_csv_importer_mappingtemplate: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ultimate_csv_importer_media: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ultimate_csv_importer_shortcode_manager: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_usermeta: Data: 0.19MB + Index: 0.22MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB wp_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.06MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.06MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_exported_csv_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_campaign: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_campaign_list: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_custom_field: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_email: Data: 0.05MB + Index: 0.00MB + Engine InnoDB wp_wysija_email_user_stat: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_email_user_url: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_form: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_list: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_queue: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wysija_subscriber_ips: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wysija_url: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_url_mail: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_user: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wysija_user_field: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_user_history: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wysija_user_list: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_yoast_indexable: Data: 0.05MB + Index: 0.08MB + Engine InnoDB wp_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_yoast_seo_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yoast_seo_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB

Post Type Counts

attachment: 6 deprecated_log: 5 elementor_library: 1 nav_menu_item: 4 page: 11 post: 2 product: 1 product_variation: 50 revision: 8 shop_coupon: 1 shop_order: 422 shop_subscription: 15 wpcf7_contact_form: 1 wysijap: 1 yith_wcan_preset: 1

Security

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

Active Plugins (18)

Classic Editor: by WordPress Contributors – 1.6.2 Contact Form 7: by Takayuki Miyoshi – 5.5.6 Dynamic Featured Image: by Ankit Pokhrel – 3.7.0 Envato Market: by Envato – 2.0.7 Header and Footer Scripts: by Digital Liberation – 2.2.1 Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.5 User Switching: by John Blackbourn & contributors – 1.5.8 WP Sheet Editor - WooCommerce Products (Premium): by WP Sheet Editor – 1.7.2 Free Trial Coupon for Woocommerce Subscriptions: by Jahid – 1.0.1 WooCommerce Customer/Order/Coupon Export: by SkyVerge – 5.3.2 WooCommerce Stripe Gateway: by WooCommerce – 6.3.0 WooCommerce Subscriptions CSV Importer and Exporter: by Prospress Inc – 2.1.0 WooCommerce Subscriptions: by WooCommerce – 4.1.0 WooCommerce URL Coupons: by SkyVerge – 2.12.0 WooCommerce: by Automattic – 6.7.0 WP Sitemap Page: by Tony Archambeau – 1.9.1 YITH WooCommerce Ajax Product Filter: by YITH – 4.9.0 YITH WooCommerce Ajax Search: by YITH – 1.19.0

Inactive Plugins (46)

Advanced Cron Manager: by BracketSpace – 2.4.2 AutomateWoo: by WooCommerce – 5.4.1 BackupBuddy: by iThemes – 7.2.0.8 CF Page or Post Duplicator: by Carlos Fazenda – 6.0 Change Author: by Martin Teley – 1.3 Check & Log Email: by WPChill – 1.0.6 Column Shortcodes: by Codepress – 1.0.1 Documentor Lite: by Tejaswini Deshpande – 1.5.2 Duplicator: by Snap Creek – 1.4.5 Easy Accordion: by ShapedPlugin – 2.1.12 Email Log: by Sudar – 2.4.8 Envato WordPress Toolkit (Deprecated): by Envato – 1.8.0 Facebook for WooCommerce: by Facebook – 2.6.13 GTmetrix for WordPress: by GTmetrix – 0.4.4 Health Check & Troubleshooting: by The WordPress.org community – 1.4.5 Log Deprecated Notices: by Andrew Nacin – 0.4.1 MailPoet 2: by MailPoet – 2.21 Organic Builder Widgets: by Organic Themes – 1.4.16 PixelYourSite PRO: by PixelYourSite – 8.0.7 PixelYourSite Super Pack: by PixelYourSite – 2.1.4 Porto Theme - Functionality: by ilistheme – 1.1.1 Product Feed PRO for WooCommerce: by AdTribes.io – 11.5.6 Query Monitor: by John Blackbourn – 3.9.0 Really Simple CAPTCHA: by Takayuki Miyoshi – 2.1 Redirection: by John Godley – 5.2.3 Slider Revolution: by ThemePunch – 5.4.6.4 Two Factor Authentication: by David Anderson original plugin by Oskar Hane and enhanced by Dee Nutbourne – 1.14.3

Ultimate Addons for Visual Composer: by Brainstorm Force – 3.16.12 Update Theme and Plugins from Zip File: by Jeff Sherk – 2.0.0 Visual Composer Clipboard: by bitorbit – 4.1.1 WooCommerce Email Test: by RaiserWeb – 1.8 WooCommerce Google Analytics Integration: by WooCommerce – 1.5.9 WooCommerce PDF Invoices & Packing Slips: by WP Overnight – 2.14.5 WooCommerce Subscriptions - Disable Report Cache Updates: by Prospress Inc. – 1.0 WooCommerce Subscriptions - Disable Reports Tab: by Prospress Inc. – 1.0.0 WordPress Responsive CSS3 Pricing Tables: by Realwebcare – 2.3.1 WPBakery Page Builder: by Michael M - WPBakery.com – 5.4.5 WP Crontrol: by John Blackbourn & crontributors – 1.12.1 WP External Links: by WebFactory Ltd – 2.51 WP fail2ban: by Charles Lecklider – 4.4.0.4 WP Offload SES Lite: by Delicious Brains – 1.4.6 WP Rocket: by WP Media – 3.7.5 WP STAGING: by WP-STAGING – 2.9.10 WRC Pricing Tables Ultimate: by Realwebcare.com – 1.0.9 YITH WooCommerce Wishlist: by YITH – 3.8.0 Yoast SEO: by Team Yoast – 18.8

Must Use Plugins (1)

DecaLog Early Loader: by Pierre Lannoy –

Settings

API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) subscription (subscription) variable (variable) variable subscription (variable-subscription)

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: – Enforce Approved Product Download Directories: –

WC Pages

Shop base: #64 - /shop/ Cart: #65 - /cart/ Checkout: #66 - /checkout/ My account: #67 - /my-account/ Terms and conditions: ❌ Page not set

Theme

Name: Porto Version: 6.2.3 Author URL: https://www.portotheme.com/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔

Templates

Overrides: porto/woocommerce/archive-product.php porto/woocommerce/cart\cart-empty.php porto/woocommerce/cart\cart-shipping.php porto/woocommerce/cart\cart-totals.php porto/woocommerce/cart\cart.php porto/woocommerce/cart\cross-sells.php porto/woocommerce/cart\mini-cart.php porto/woocommerce/cart\proceed-to-checkout-button.php porto/woocommerce/cart\shipping-calculator.php porto/woocommerce/checkout\form-billing.php porto/woocommerce/checkout\form-checkout.php porto/woocommerce/checkout\form-coupon.php porto/woocommerce/checkout\form-login.php porto/woocommerce/checkout\form-pay.php porto/woocommerce/checkout\form-shipping.php porto/woocommerce/checkout\payment-method.php porto/woocommerce/checkout\payment.php porto/woocommerce/checkout\review-order.php porto/woocommerce/checkout\thankyou.php porto/woocommerce/content-product-cat.php porto/woocommerce/content-product.php porto/woocommerce/content-single-product.php porto/woocommerce/content-widget-product.php porto/woocommerce/global\form-login.php porto/woocommerce/global\quantity-input.php porto/woocommerce/global\wrapper-start.php porto/woocommerce/loop\add-to-cart.php porto/woocommerce/loop\loop-end.php porto/woocommerce/loop\loop-start.php porto/woocommerce/loop\no-products-found.php porto/woocommerce/loop\orderby.php porto/woocommerce/loop\pagination.php porto/woocommerce/loop\rating.php porto/woocommerce/loop\sale-flash.php porto/woocommerce/myaccount\dashboard.php porto/woocommerce/myaccount\downloads.php porto/woocommerce/myaccount\form-add-payment-method.php porto/woocommerce/myaccount\form-edit-account.php porto/woocommerce/myaccount\form-edit-address.php porto/woocommerce/myaccount\form-login.php porto/woocommerce/myaccount\form-lost-password.php porto/woocommerce/myaccount\form-reset-password.php porto/woocommerce/myaccount\lost-password-confirmation.php porto/woocommerce/myaccount\my-account.php porto/woocommerce/myaccount\my-address.php porto/woocommerce/myaccount\my-downloads.php porto/woocommerce/myaccount\my-orders.php porto/woocommerce/myaccount\navigation.php porto/woocommerce/myaccount\orders.php porto/woocommerce/myaccount\payment-methods.php porto/woocommerce/myaccount\view-order.php porto/woocommerce/order\form-tracking.php version 3.6.0 is out of date. The core version is 6.5.0 porto/woocommerce/order\order-details-customer.php porto/woocommerce/order\order-details.php porto/woocommerce/order\order-downloads.php porto/woocommerce/order\tracking.php porto/woocommerce/single-product\add-to-cart\simple.php porto/woocommerce/single-product\add-to-cart\variable.php porto/woocommerce/single-product\meta.php porto/woocommerce/single-product\product-attributes.php porto/woocommerce/single-product\product-image.php porto/woocommerce/single-product\product-thumbnails.php porto/woocommerce/single-product\rating.php porto/woocommerce/single-product\related.php porto/woocommerce/single-product\review-meta.php porto/woocommerce/single-product\review-rating.php porto/woocommerce/single-product\review.php porto/woocommerce/single-product\sale-flash.php porto/woocommerce/single-product\short-description.php porto/woocommerce/single-product\tabs\tabs.php porto/woocommerce/single-product\title.php porto/woocommerce/single-product\up-sells.php porto/woocommerce/single-product-reviews.php

Outdated Templates: ❌

                    Learn how to update

Subscriptions

WCS_DEBUG: ✔ No Subscriptions Mode: ✔ Live Subscriptions Live URL: https://development.local Subscription Statuses: wc-active: 15 WooCommerce Account Connected: ❌ No Report Cache Enabled: ✔ Yes Cache Update Failures: ✔ 0 failure

Store Setup

Country / State: Australia — South Australia

Subscriptions by Payment Gateway

Stripe: wc-active: 15

Payment Gateway Support

Stripe: products refunds tokenization add_payment_method subscriptions subscription_cancellation subscription_suspension subscription_reactivation subscription_amount_changes subscription_date_changes subscription_payment_method_change subscription_payment_method_change_customer subscription_payment_method_change_admin multiple_subscriptions

Admin

Enabled Features: activity-panels analytics coupons customer-effort-score-tracks experimental-products-task experimental-import-products-task experimental-fashion-sample-products experimental-product-tour homescreen marketing mobile-app-banner navigation onboarding onboarding-tasks remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices wc-pay-promotion wc-pay-welcome-page wc-pay-subscriptions-page

Disabled Features: minified-js settings

Daily Cron: ✔ Next scheduled: 2022-08-02 02:13:39 +00:00 Options: ✔ Notes: 86 Onboarding: completed

WooCommerce Customer/Order/Coupon Export

Automated exports: 0 Custom formats: 0 Next export: Not scheduled

Action Scheduler

Complete: 179 Oldest: 2022-07-04 00:20:50 +0000 Newest: 2022-08-01 06:49:36 +0000

Failed: 14 Oldest: 2021-09-17 03:50:55 +0000 Newest: 2022-07-14 05:37:35 +0000

Pending: 19 Oldest: 2022-08-01 06:59:24 +0000 Newest: 2022-09-19 03:07:39 +0000

Status report information

Generated at: 2022-08-01 06:57:21 +00:00 `

Isolating the problem

woocommercebot commented 2 years ago

Hi @tommybutter,

While our goal is to address all the issues reported in this repository, GitHub should be treated as a place to report confirmed bugs only.

The type of issue you submitted looks like a support request which may or may not reveal a bug once proper troubleshooting is done. In order to confirm the bug, please follow one of the steps below: