Woocommerce: Some action hooks not firing inside class [closed]
This: array(&$this, ‘create_credit_note’, 10, 2)) Should be: array(&$this, ‘create_credit_note’), 10, 2)
This: array(&$this, ‘create_credit_note’, 10, 2)) Should be: array(&$this, ‘create_credit_note’), 10, 2)
If you have both post__in and post__not_in as input arguments for WP_Query, then only post__in is activated. See the source here. If you need to exclude IDs from the post__in, you should do it before passing on the array.
Build a simple WP Query, using the offset parameter and post_type => ‘product’. So for each page, you calculate your offset value with $posts_per_page * $page.
Assuming you would put this in a woocommerce template file, wherever you want it to display: <?php global $product; $regular_price = esc_attr( $product->get_display_price() ); $discount = 20; $currency = esc_attr( get_woocommerce_currency() ); $new_price = ($regular_price * $discount) / 100; echo ‘Get this product for ‘.$new_price.$currency.’ with (Promo code)’; ?> Untested, but should do the trick.
There is the option that you don’t allow the user to register on the main site, allowing them to register on the subsite only. The plugin network-subsite-user-registration allows this, if the user is already registered on the network then they are automatically added, by the plugin, to the site requesting registration. The hook that does … Read more
access Woo commerce | WordPress methods externally
So the solution was actually pretty simple. First I needed to modify my custom member login redirect to include the redirect_to portion in the redirect URL: function pb4r_redirect() { global $current_user; $refer=urlencode($_SERVER[“REQUEST_URI”]); $okay_pages = array(4, 10, 12, 13, 191, 200, 1380, 1381, 1382, 1383, 1449, 1631, 1643, 1652, 1653, 1654, 1666, 1718, 1725, 1840, ‘Checkout’, … Read more
Firstly, get_shipping_method is a function. You seem to be using it as a variable. Secondly $order->get_shipping_method() returns Shipping method label, which you’re trying to compare with id. Now you can either compare Titles, or use $order->get_items( ‘shipping’ ); which returns an array with name, type, method_id, cost and taxes, and use method_id for comparison.
You will need to check if a cookie of your website is set in the user’s browser. If so, display a message. If you’d like to delete all his cookies try this.
How to display products with multiple conditions, product_id and category_id