Get cart item name, quantity all details woocommerce

Try this : <?php global $woocommerce; $items = $woocommerce->cart->get_cart(); foreach($items as $item => $values) { $_product = wc_get_product( $values[‘data’]->get_id()); echo “<b>”.$_product->get_title().'</b> <br> Quantity: ‘.$values[‘quantity’].'<br>’; $price = get_post_meta($values[‘product_id’] , ‘_price’, true); echo ” Price: “.$price.”<br>”; } ?> To get Product Image and Regular & Sale Price: <?php global $woocommerce; $items = $woocommerce->cart->get_cart(); foreach($items as $item => … Read more

WooCommerce: Finding the products in database

Update 2020 Products are located mainly in the following tables: wp_posts table with post_type like product (or product_variation), wp_postmeta table with post_id as relational index (the product ID). wp_wc_product_meta_lookup table with product_id as relational index (the post ID) | Allow fast queries on specific product data (since WooCommerce 3.7) wp_wc_order_product_lookuptable with product_id as relational index … Read more

Get custom product attributes in Woocommerce

Edited: The woocommerce_get_product_terms is deprecated since Woocommerce version 3 Go with the following as @datafeedr wrote in his answer: global $product; $koostis = array_shift( wc_get_product_terms( $product->id, ‘pa_koostis’, array( ‘fields’ => ‘names’ ) ) ); or even more compact: global $product; $koostis = $product->get_attribute( ‘pa_koostis’ ); Original answer: $result = array_shift(woocommerce_get_product_terms($product->id, ‘pa_koostis’, ‘names’));

How to get WooCommerce order details

WOOCOMMERCE ORDERS IN VERSION 3.0+ Since Woocommerce mega major Update 3.0+ things have changed quite a lot: For WC_Order Object, properties can’t be accessed directly anymore as before and will throw some errors. New WC_Order and WC_Abstract_Order getter and setter methods are now required on the WC_Order object instance. Also, there are some New classes … Read more

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