Where is the “default attribute” values located in the phpMyAdmin in Woocommerce?

Default attributes of WooCommerce variable products are stored as post meta in the database. You can find them in the wp_postmeta table, where the post_id column is the post ID of the parent product (Variable product), and the meta_key column is _default_attributes. You can clear and remove default attributes of all products by replacing all … Read more

WooCommerce: add different order item meta for each item in order

Try, woocommerce_checkout_create_order_line_item It has 4 available arguments and available after version WooCommerce 3.3+. $item is an instance of WC_Order_Item_Product new introduced Class $cart_item_key is the cart item unique hash key $values is the cart item $order an instance of the WC_Order object (This is a very useful additional argument in some specific cases) In this … Read more

Detect whether a page is a product subcategory page?

is_category() only check the built in post category. Product categories are custom taxonomies. So you need to use is_tax() instead of is_category() and get_term() instead of get_category(). Check this example:- function is_subcategory($cat_id = null) { if (is_tax(‘product_cat’)) { if (empty($cat_id)){ $cat_id = get_queried_object_id(); } $cat = get_term(get_queried_object_id(), ‘product_cat’); if ( empty($cat->parent) ){ return false; }else{ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)