I don’t have an extra WC instance around to try on but I do see one possible issue.
$_REQUEST['id']
is a string (always). WC_Product_Factory->get_product()
may very well be expecting an int. PHP is not, and WP definitely is not, always clever about transparent recasting.
Try this to see if it helps:
function get_Title() {
$id = $_REQUEST['id'];
if (is_string($id) && is_numeric($id))
$id = intval($id);
$_pf = new WC_Product_Factory();
$product = $_pf->get_product($id);
echo $product;
die();
}
Unable to test I can’t diagnose if that’s really what’s going on but it’s a quick change so it’s worth trying.
Related Posts:
- Getting the gallery images from products in woocommerce?
- add_filter to modify woocommerce_cart_item_name hyperlink
- Get product details by url key in WordPress woocommerce
- How to get rid of the hover zoom in WooCommerce single products
- How do I display certain products via their category on a section of a page using PHP?
- Display orders instead of woocommerce my account dashboard for logged in users [closed]
- Detect whether a page is a product subcategory page?
- Programmatically change Payment Methods WooCommerce
- pre_get_posts with WooCommerce Shortcode Query
- WooCommerce is slow with many categories [closed]
- Reverse engineering of WooCommerce Storefront filters
- Use WooCommerce function in other WordPress plugin
- How to remove recurring totals information for a particular subscription product? [closed]
- WordPress codex: apply_filters – clarification on creating a new hook on the fly. How do we use it?
- Add product description (content) to WooCommerce customer processing order email
- How to get all attributes with their terms related to specific Woocommerce product category [closed]
- Woocommerce – disable «place order» until user checks Privacy Policy
- Calling calculate_shipping() with ajax in woocommerce
- Adding product SKU before cart item name in WooCommerce
- global $post; in WooCommerce
- Woocommerce template single-product.php in theme folder not working
- is_user_logged_in() always returns false for woocommerce_login_redirect
- WordPress ‘on behalf of’ email
- Display description on cart page
- Which hook should I use to capture $_POST(‘password’) via profile update and password reset
- How to change a column width on WooCommerce orders page (Admin)
- display first sale product in shop
- Problems adding in-store product managers
- differentiate hooks and filters on the same page [closed]
- Keep getting Notice: Trying to get property of non-object in …\wp-includes\post.php on line 4153 when generating woocommerce coupon
- How to subscribe free subscription on user registration in woocommerce subscription plugin?
- WooCommerce Product URL re-writing
- Automatically running Scheduled Actions
- Hook to use when customer placing order
- Woocommerce cart page – Add “Free” to the shipping label when shipping is 0
- Change product in cart when billing country is changed
- Calculate tax on sales price excluding discount [closed]
- One file for all virtual, downloadable product variations [closed]
- How to override the title tag for woocommerce endpoints?
- WooCommerce – Global $product is returning value null
- How to re-arrange this hooked content?
- Pre filter woocommerce products to remove a certain category of products
- WooCommerce Stripe Plugin not showing up in settings [closed]
- Remove “?add-to-cart=product-id” from Add to Cart URL when on the Cart page
- How to show total amount on woocommerce?
- WooCommerce plaintext mail doesn’t display currency symbol
- Woocommerce, finding the ordinal number of a purchase for a certain product
- WooCommerce order refund get qty refunded
- Disable Order Review Page when the id product
- Set both meta_query and tax_query using wp_query->set
- WooCommerce add_to_cart
- WooCommerce Simple Product Options List
- Add custom body tag if product is out of stock
- Protecting WooCommerce Customizations with Update
- Setting WooCommerce SKU programmatically [closed]
- How to edit mobile view of my wordpress website without affecting the desktop view? [closed]
- Woocommerce replace product page image with product tabs [closed]
- WooCommerce: How to insert filtered attribute(s) in page title of archive?
- Multiple Pricing [closed]
- WOOF product filter prevent from loading on wordpress search result page
- WooCommerce login redirect based on cart
- Adding product on sale into specific category after creation
- How to select the first product variant as a default?
- call_user_func_array() expects parameter 1 to be a valid callback, class ‘WC_Rapyd’ does not have a method ‘install’
- Conditional for product attribute page
- Setting Page Visibility for WooCommerce Default Page Doesn’t Work
- Deleted products from woocommerce are still in the database
- Remove cart functionality from WooCommerce so it doesn’t remember the products [closed]
- Apply CSS to certain product thumbnails only
- Pass values to ajax
- Send Email to Custom Field in Custom Post Type when order is Completed
- Fragments to Update Cart Counter not working on homepage – Woocommerce
- Order Woocommerce Products by On Sale and Alphabetically
- How to track product price changes?
- Woocommerce Flexslider touch functionality on desktop not working
- Filter orders in Admin area based on logged in user
- Customer Email Address
- How to echo woocomerce attributes values in dropdown box
- Add new page in WooCommerce My Account page
- Adding time of order to Admin email for new order
- Uninitialised Parameters using woocommerce_checkout_update_order_meta hook
- Woocommerce customer role doesn’t change if user is already a subscriber [closed]
- Tags pages for different Custom Post Types and WooCommerce Products sharing Post Tags
- Hide add to cart when product variation has no price or is unavailable
- get_posts only getting most recent product
- How to only show featured products in wooCommerce using function.php function
- How to insert link, with lightbox, that opens specific page content only
- How to get the WooCommercer product variation image
- how add css class to product boxes li, for img, add cart button, decs, price… [closed]
- Vendor Listing by Location
- How can I hide the entire “Shipping Details” block on the admin side of Woocommerce? [closed]
- Decrease stock quantity when a variation is sold using Woocommerce
- WooCommerce show decimals in totals [closed]
- Woocommerce Mandatory Field on Shipping Details [closed]
- Create a shortcode to show product tag name on tag archive
- How to access Woo Commerce products from within custom theme? [closed]
- Auto generating API keys using the Application Authentication Endpoint [closed]
- Critical error on woocommerce checkout page
- Can’t add variable products since update WooCommerce [closed]
- Add custom ID to WooCommerce product tab