• I am not able to select existed products(woocommerce )when inserting a URL link, only posts are available.

    I think it is more important to support products insertion. Could you consider to make it possible? thanks a lot!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Imagebcworkz

    (@bcworkz)

    Because products are not part of core WP, core WP is unable to include products in the initial post/page list. However such functionality would be a great enhancement for the WooCommerce plugin. I recommend posting your suggestion in WooCommerce’s dedicated support forum. If you’ve purchased any WooCommerce themes or extensions, contacting customer support at WooCommerce.com might be a better approach.

    In case you were unaware, it is possible to search for products and have them show up as link suggestions. They just don’t show up in the initial list. Any word(s) used in the product title or description will be found by using the search feature.

    Thread Starter Imagebefantasy

    (@befantasy)

    I don’t think this feature can be implemented within WooCommerce. Isn’t the link insertion functionality part of the UI in the WordPress mobile app?

    Also, when using “Link to existing content,” I can only search for posts and pages by entering keywords — products don’t appear in the results. I believe the key to resolving this issue lies in the WordPress mobile app, not WooCommerce.

    In the built-in block editor on the WordPress web version, I can search for products when inserting a link.

    Image
    Image
    Image
    Moderator Imagebcworkz

    (@bcworkz)

    Isn’t the link insertion functionality part of the UI in the WordPress mobile app?

    Yes, however plugins can influence the query being made to populate the list to include products. It’s ill advised for core WP to include post types that don’t exist in its queries. While doing so might not adversely affect actual SQL queries too much, the supporting PHP code will throw several errors if it tried to include non-existent post types in its processes. Don’t ask me how I know 😉

    The fact that keyword searches on the desktop version includes products confirms that the Woo plugin is influencing at least some queries. Even though it’s not currently influencing initial lists or mobile app queries, it’s still feasible for it to do so. The onus is on plugin devs to add support for their own post types. Core WP cannot be expected to directly support any random post type that happens to get introduced from a plugin. Core WP does provide mechanisms that allow plugin devs to add support.

    Thread Starter Imagebefantasy

    (@befantasy)

    Thank you for the explanation. I don’t quite understand—do you mean that the link insertion feature in the desktop block editor can search for products, and this is made possible by the WooCommerce plugin? Is it also possible for WooCommerce to enable this feature in WordPress mobile app?

    Moderator Imagebcworkz

    (@bcworkz)

    I’ve confirmed that the link search feature does find products using my laptop. I assumed that WooCommerce was thus modifying the search query. However, upon further investigation, it looks like most custom post types are included in the search automatically, so WooCommerce may have nothing to do with it directly. The product or any post type would need to be registered to be accessible via the REST API since that’s how the search is requested. Presumably WooCommerce does this since it’s common practice. My apologies for earlier erroneous assertions.

    In examining the API requests, I think it’s possible in theory that products could appear in the initial list, except the results are limited to 20 hits and posts and pages are always found first. Since most sites have more than 20 posts and pages, no products appear in the initial list.

    Apparently the app manages searches differently? I don’t have any experience with the app, so I’m unable to speculate on why products are not found. It’s apparently making a different search request than the desktop version does? It still should be possible to modify the search query like I initially assumed was happening. It’s something WooCommerce could do, or you could customize your site to ensure products are searched.

    If you’re confident that the app’s search feature is defective in any way, you can raise an issue in the appropriate GitHub repository. Which one depends on whether you use the iOS or Android app. Links for both repositories can be found in the right sidebar of the Mobile Team’s “Make” page. Free GitHub registration is required to raise issues there.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.