Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V8.4.0] WC Shortcode [product_page id="xxxx"] Prevents Page Editing, Opens WooCommerce Product Details #42785

Open
5 tasks done
shameemreza opened this issue Dec 13, 2023 · 8 comments
Labels
focus: product management Related to product creation and editing. team: Mothra type: bug The issue is a confirmed bug. type: community contribution

Comments

@shameemreza
Copy link

shameemreza commented Dec 13, 2023

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

After updating to WooCommerce 8.4.0, pages with the shortcode [product_page id="xxxx"] open the WooCommerce product page instead. This problem occurs when editing a normal page with the shortcode.

This bug was reported here: https://wordpress.org/support/topic/update-8-4-0-opens-the-product-page-instead-of-normal-page

7445720-zen

Expected behavior

The page should show the shortcode instead of the product details.

Actual behavior

The issue causes pages with the shortcode [product_page id=”xxxx”] to open the WooCommerce product page directly, making it impossible to edit these pages. The problem was temporarily resolved by reverting back to version 8.3.1.

Steps to reproduce

  • Create a new page and insert the [product_page id="xxxx"] shortcode.
  • Next, publish the page.
  • When you open the page in the editor, you'll notice that the product information is displayed, not the shortcode.
CleanShot.2023-12-13.at.21.54.48.mp4

WordPress Environment

WooC0mmerce 8.4.0
WordPress 6.4.2

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.
@anastas10s-afk
Copy link
Contributor

@twobirdshealing
Copy link

What is the cycle for fixes like these to make it to the final release? This is one that has caused us alot of issues as well.

@carolframen
Copy link

7721682-zen

@twobirdshealing
Copy link

was this fixed? or were there multiple issues with the prodcutpage shortcode?

  • Fix - Fix the product_page shortcode not working if "status" is passed in as "any". #44698

@thisissandip
Copy link

thisissandip commented Mar 11, 2024

Another Workaround:

  • Add the below snippet (replace the page ID):

function disable_block_editor_for_page_ids( $use_block_editor, $post ) {

    $excluded_ids = array(461); // page ids
    if ( in_array( $post->ID, $excluded_ids ) ) {
        return false;
    }
    return $use_block_editor;
}
add_filter( 'use_block_editor_for_post', 'disable_block_editor_for_page_ids', 10, 2 );

The above snippet will disable the block editor for the specific pages added in the array and you will be able to edit the page using the WordPress classic editor

@thisissandip
Copy link

7842224-zen

@shaunkuschel
Copy link

shaunkuschel commented Mar 22, 2024

Received another report of this on 7929699-zen.

When I tested this on my site using WC 8.7.0, the page that had the product_page id shortcode continued to work as expected on the front end but the edit version of the page would not load at all (it was just a blank, white page).

Workaround: When I used the snippet @thisissandip shared above, that resolved the issue on my site and allowed me to view the edit version of the page as expected.

@shaunkuschel shaunkuschel added the type: bug The issue is a confirmed bug. label Mar 22, 2024
@whebb
Copy link

whebb commented Apr 16, 2024

Just discovered this issue yesterday. I thought it was related to the theme, but it is certainly woocommerce. Also can confirm it is not a problem on the frontend, only when going to edit pages. Can confirm 8.3.1 works. Will try the workaround, but seeing as this originated back in 8.4, what is the timetable for a fix? Is causing headaches on many websites for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: product management Related to product creation and editing. team: Mothra type: bug The issue is a confirmed bug. type: community contribution
Projects
None yet
Development

No branches or pull requests

8 participants