Can woocommerse be used dynamically for billing from another plugin for payment processing?

It is possible, but you’re going to need a product to log in your orders. You could create a product ‘placeholder’ and then pass variables to the cart before checkout. This way the actual product already exists but everything else in WooCommerce will perform as normal. Orders don’t store a link to the current price … Read more

Force meta data on specific product type

You can try the wp_head hook: add_action( ‘wp_head’, ‘check_for_enviso_group_ticket’ ); function check_for_enviso_group_ticket() { if ( is_product() && ( ‘enviso_group_ticket’ == get_the_terms( get_the_ID(), ‘product_type’ )[0]->slug ) ) { echo ‘<meta name=”robots” content=”noindex,nofollow”/>’, PHP_EOL; } } or to not break your site in case the WooCommerce is disabled and the is_product() function isn’t defined: add_action( ‘wp_head’, ‘check_for_enviso_group_ticket’ … Read more

Wooocommerce disable check_cart_item_stock if cart item has specific meta

Finally, I did it like this: function bo_disable_stock_check(){ if(bo_cart_contain_birthlist()){ remove_action(‘woocommerce_check_cart_items’, [WC()->cart, ‘check_cart_items’], 1); add_filter(“woocommerce_product_is_in_stock”, “__return_true”); add_filter(“woocommerce_cart_item_required_stock_is_not_enough”, “__return_false”); } } add_action(‘wp’,’bo_disable_stock_check’); But maybe there are more specific hooks to call than “wp”.

Woocommerce – Change the template?

The dropdown box that you are talking about is for custom WordPress template that WordPress supports by default. In order to override woocomerce template e.g. single-product.php what you have to do is to create a folder with name woocommerce inside your theme folder e.g. /wp-content/themes/{your_theme_name}/woocommerce/ and copy the file from /wp-content/plugins/woocommerce/templates/single-product.php into your theme’s woocommerce … Read more

Adding author option to [products] woocommerce shortcode

Try this: function htdat_shortcode_atts_products( $out, $pairs, $atts, $shortcode ) { if ( isset ( $atts[‘author’] ) ) $out[‘author’] = $atts[‘author’]; return $out; } add_filter(‘shortcode_atts_products’, ‘htdat_shortcode_atts_products’, 10, 4); function htdat_woocommerce_shortcode_products_query( $query_args, $attributes ) { if ( isset( $attributes[‘author’] ) ) $query_args[‘author’] = $attributes[‘author’]; return $query_args; } add_filter( ‘woocommerce_shortcode_products_query’, ‘htdat_woocommerce_shortcode_products_query’, 10, 2 );

Remove item in Checkout

that function is deprecated, use wc_get_cart_remove_url( $cart_item_key ) instead if (is_checkout()) { $product_name .= apply_filters(‘woocommerce_cart_item_remove_link’, sprintf( ‘<a href=”%s” rel=”nofollow” class=”remove” style=”float:left;”>&times;</a>’, esc_url(wc_get_cart_remove_url($cart_item_key)), __(‘Remove this item’, ‘woocommerce’), esc_attr($cart_item[‘product_id’]), esc_attr($cart_item[‘data’]->get_sku()) ), $cart_item_key); return $product_name; }

Create custom function for hero image

get_the_title() returns the post (product) title including all HTML, whitespaces and symbols not allowed in URLs, etc. Use post slug instead. Also, you don’t need to use any actions. function custom_hero_image( $post_id ) { $product = get_post( $post_id ); $slug = $product->post_name; if ( is_product( $post_id ) ) { $html=”<img class=”jarallax-img” src=””. get_template_directory_uri() .’/inc/assets/img/shop/hero/’.$slug.’.jpg”>’; } … Read more