Try This Code
<?php global $post;
$terms = get_the_terms( $post->ID, 'product_cat' );
foreach ($terms as $term) {
$product_cat_id = $term->term_id;
break;
}
if ($product_cat_id == "6" && $product_cat_id == "7" ) {
echo "aaabbb";
}
else if ($product_cat_id == "6" ) {
echo "aaa";
}
else if ($product_cat_id == "7") {
echo "bbb";
}
?>
Related Posts:
- retrieve thumbnail from post ID of best selling product in category
- Woocommerce – remove product from category
- combine Code 1 with Code 2
- get current product name in functions.php
- Issue adding sub category programmatically
- Pass Category Name, Description and Photo into variables to pass to jQuery
- get taxonomy thumbnail and use it as a variable in code
- Only show size attributes in product box woocommerce when available
- Display Sibling WooCommerce Product Categories on Archive Page
- Woocommerce. Get a list of products in the current category on the archive page and product page
- Add Custom Category Description When Empty
- Add a product category to a specific product via a button
- random woocommerce categories are not showing when count enabled?
- Need Quick Help With Product Category Page
- WordPress using get_term to retreive slug not working as expected
- Product Category Page in Full Width
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- How to add product in woocommerce with php code [closed]
- Display current category title on category page
- Inject post (from specific category) between posts in Loop
- Creating custom Woocommerce attribute taxonomies from a plugin
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- How to get the original price of the product in woocommerce?
- How to Remove a Filter from the Admin List Table?
- Remove commas from WooCommerce checkout addresses fields
- WooCommerce Link to Product Category
- Edit category output
- using woocommerce_template_single_add_to_cart in shop-loop – javascript issues [closed]
- Different background-image by category
- Writing scripts using WordPress / WooCommerce classes?
- How to make custom total price reactive in navigation
- Change description on specific WooCommerce product status change
- Woocommerce – Filter Variable Products by Variation Attributes and Variations Regular Price
- How to add a second ‘place order’ button in WooCommerce [closed]
- Woocommerce redirect thankyou page based on product ID doesn’t empty Cart
- tracking number field in Woocommerce order [closed]
- WooCommerce Related Products by Attribute
- how do I get a specific post from a post with a subcategory in WP
- Add a product to checkout via form
- Trying to place a custom field after the total section in the checkout page in woocommerce
- Get page that displays all children of taxonomy parent
- WordPress default Search function inconsistent in WooCommerce Product Titles
- How can I get the values of my WordPress $wpdb query in Jquery?
- Trouble checking if custom woocommerce checkout field is empty or not
- My new button is in the wrong place
- Function returns text instead of html [closed]
- Get all categories post is not in
- How to display SQL query that ran in WC_Order_Query?
- How to disable delivery on certain date at checkout page in WooCommerce?
- How do I change this function from two returns to one string to show sku and dimensions in WooCommerce cart?
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- woocommerce wc_create_order(); is creating multiple orders instead of one?
- Post not populating for custom post type based on category selection
- Removing sidebar on category pages
- Remove Custom Post Category In WordPress Slug Using .Htaccess
- Dynamically added custom fields not displayed on WooCommerce email notifications
- Payment field disappears on custom Paypal plugin
- Creating a brand attribute as a variable
- Get main parent category for post (WordPress/Advanced Custom Fields)
- How to remove Login from in my account page
- I am having errors with checkout on wordpress
- How to access specific product id on other pages/posts?
- Programmatically add a product to the cart and set price to zero when buying from certain category
- I want to show cart items number if any or nothing, simple CART text
- How to retrieve quantity input field by id in woocommerce
- Category Page Displaying all Pages
- Get only relevant sub-category of category “Genre” that applies to current product only
- Using zip code to display custom data in Admin Order Details
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Including user data in “new user notification email”
- Hide a specific category title from displaying on site
- Add Shortcode to ::before class
- i want add conditional for add category in wordpress
- Return to the beginning of the results of a for loop
- WooCommerce get products based on the taxonomy
- Woocommerce Add custom “Add to cart button” in single page with tags
- Woocommerce remove menu item on myaccount dashboard
- append data to mysql table via submit button coded in php – not working
- How to Retrieve All Category Images on Front-End
- PHP – Woocommerce 3.2 Add variable shipping insurance with multiple “else if ” conditions
- how to display woocomerce description of each category in wordpress? [closed]
- WordPress 3.0 PHP Error – notice WordPress_product_Type was called incorrectly
- woocommerce plugin bugs
- Adding my own custom template page but got white page
- Woocommerce Price Text
- Is there a way to randomize and connect a background and header image?
- dynamically filter by category via sub-menu
- Get unique post in parent category
- Incomplete term slugs output from a foreach loop with get_the_terms
- Ajax Load More or View More functionality for woocommerce category layout by template overriding
- wc_add_notice not working on cart page
- How do I update product shipping using PHP in WooCommerce?
- How can I edit the WooCommerce Mini DropDown Cart to read as follows
- Show button in header when product custom field is not empty
- WordPress 6.1.1 UTF8 Slug Limit Increase
- Woocommerce Convert existing order to the cart
- How to change shipping method title based on cart amount?
- How to add SKU and remove product title from WooCommerce url?
- Product Search in search.php
- using custom pages for myaccount in woocommerce