Tag: woocommerce

WooCommerce: Easily get Order info from $order Object

WooCommerce: Easily get Order info from $order Object

1. You have access to $order Hooks (do_action and apply_filters) use additional arguments which are passed on to the function. If they allow you to use the $order object you’re in business. Here’s how to get all the order information: // Get Order ID $order->get_id(); // Get Order Totals $0.00 $order->get_formatted_order_total(); $order->get_cart_tax(); $order->get_currency(); $order->get_discount_tax(); $order->get_discount_to_display();…

Read More Read More

Content Egg Range Offer prices in WC Product

Content Egg Range Offer prices in WC Product

If you have the Content Egg plugin installed you can know that this plugin has a shortcode which allows list the Offers in the WooCommerce Product. Usually, the plugin displays the price of the cheapest product from the Offer list but with help of this snippet you can get price from the cheapest to the…

Read More Read More

WooCommerce: How to get Product data from $product Object

WooCommerce: How to get Product data from $product Object

These simple PHP snippets will help you in your work with WooCommerce Products. 1. You have access to $product Hooks (do_action and apply_filters) use additional arguments which are passed on to the function. If they allow you to use the “$product” object you are in business. Alternatively, you can declare the “global $product” inside your…

Read More Read More