The problem is this line:
$cat_info = get_term_by('slug', $cat, 'product_cat');
You’re trying to get a category by slug, but $cat
is undefined, so $cat_info
is false
, which means that this line:
$l_name = trim($ctitle) != '' ? $ctitle : $cat_info->name;
Is throwing the first error, because you can’t access ->name
on false
.
And on this line:
$l_href = get_term_link($cat, 'product_cat');
$l_href
is becoming a WP_Error
object because — again — $cat
doesn’t exist. This means that:
$output .= '<a class="cat-img" href="'.$l_href.'">';
Is throwing the second error, because you’re can’t concatenate a WP_Error
object into a string.
Related Posts:
- WooCommerce plugin won’t let me access settings
- Change Out of Stock Error Message in WooCommerce Cart
- Woocommerce checkout required field error
- WordPress Woocommerce REST API JSON Error
- Getting WordPress fatal error when hitting WooCommerce API
- Random 503 and 504 errors
- Getting error in debug : price was called incorrectly. Product properties should not be accessed directly
- SyntaxError: unterminated string literal – if WordPress Debug in wp-config is set to true
- Stop the “upload file size” error from printing [closed]
- WordPress error
- Critical error on woocommerce checkout page
- wc_get_template_part( ‘content’, ‘product’ ) | Where is this file located?
- how to get woocommerce product attribute slug
- Create WooCommerce custom stock option that is non-purchasable
- WooCommerce – Flat rate shipping based on X quantity steps?
- Custom URL for each product variation – rewrite rules
- Where can I find a single item template
- Get Woocommerce Subscription Product
- Change “Shipping” text to “Delivery” everywhere I appears in woocommerce
- Customize WooCommerce orders displayed shipping
- WooCommerce pages accessible to logged in members only
- Woocomerce language
- paypal not showing on woocommerce payments
- Target WooCommerce Product Gallery Image (rather than Featured Image) for og:image
- How to update the WooCommerce cart Icon to show new products added with JavaScript
- Remove the link from the thumbnail and product title on woocommerce
- How to configure Woocommerce Payment Methods programmatically?
- woocommerce_package_rates not fired everytime
- how to change woocommerce shop archive description? [closed]
- Add content to the last slide of each product
- Remove add to cart icon/view product button woocommerce
- Products Shortcode is Displaying Single Product Page Price for all Products [closed]
- Subscription on Checkout
- Woocommerce – display product in page but in list format with excerpt
- how to show store name when I add a product on cart in woocommerce(woocommerce multi store)?
- When Free shipping is available hide other shipping methods except Local pickup in WooCommerce [closed]
- Create archive page for woocommerce attribute
- How to increase execution time out limit in WordPress dashboard?
- Setting an attribute as variation in woo commerce via php [duplicate]
- WooCommerce – Conditionally enable shipping for virtual products
- How to apply these filters
- get_the_post_thumbnail_url does not return anything if image size is set
- Add to Cart button displaying twice on Shop Page Woocommerce
- How to exclude a taxonomy from shop & search page wooCommerce?
- How to remove unwanted text bug in wordpress site
- get woocommerce product image url and price from database [closed]
- Trying to style Woocommerce sidebar Cart Widget [closed]
- How can I compel alphanumeric entries for username textbox on woocommerce registration form
- Help me to intergrate product database to WordPress
- WooCommerce how to checkout a product without adding it to the cart
- How can i access woocommerce order variables inside shortcode?
- Using the WordPress and WooCommerce REST APIs in the same Node app
- How to add a “buy now” button below “add to cart” button [closed]
- Cart page displays the price and amount as zero regardless of price entered [closed]
- Custom action not working in Woocommerce
- Display list of only specific tags on product
- Change the “Register” headline in Woocommerce
- How to display customer mobile number in woocommerce customers page
- How to alter taxes amounts when updating an order
- Woocommerce variable product’s total amount by javascript
- Get all categories inside a Product Tag archive page
- Save product short description in order (without updating in order details if it is updated in product)
- Running JavaScript after using WooCommerce Filter Plugin
- Include stock information in WooCommerce order confirmation email
- use vendor address instead of store main address for shipping and taxes calculation
- where does $checkout in form-checkout.php woocommerce come from? [closed]
- woocommerce add button underneath order details
- Where do I remove admin order fields (unset doesn’t work)
- How to Get WooCommerce Product Price
- How to trace errors in debug.log for WooCommerce 3.0?
- Auto set Woocommerce product ID as SKU on save
- I want to show always 4 category boxes everytime in woocommerce
- Change the customer’s name to a link on an order management page
- Applying pre-production modifications
- Possible to have multiple Authorize.net accounts on the same site?
- Allow HTML in product attributes for WooCommerce
- Use woocomerce shop filters on other pages
- How to neutralize a parent theme php template?
- Woocommerce – change image issue
- Woocommerce: relevancy based related products
- Understanding WooCommerce Build-In Geolocation/ Geo_IP classes
- Same WooComerce shop for different WP sites?
- Custom Shipping Method: need non-instance settings and non-global settings
- how to query single product in woocommerce? [closed]
- woocommerce-how can i get all products by their groups! [closed]
- Anchor link to every product
- Plugin could not be activated because it triggered a fatal error
- Woocommerce custom product with JS script, can’t understand how it works [closed]
- Woocommerce 404 after chang default language
- When creating a new order (on the dashboard) how can I get the ID of the selected customer
- Setup WooCommerce to properly handle inventory with variable product?
- Link Back to Parent Category – Woocommerce
- Send data to external websites when there is an update or create a post
- Sort by price when price is set in multiple keys
- Add a custom code with custom link after add to cart for every product
- WooCommerce product permalink based on product’s current category
- Disable duplicate WC product category URLs
- how should i get products based on tags in woocommerce
- Add custom text to product category page
- Woocommerce permalink URL change in DB