Woocommerce discount by user role
EDIT: As you see I'm new here. So sorry for giving you a headache This is the problem at the moment: The code is working now! But maybe it has something to do with taxes when the product price on…
EDIT: As you see I'm new here. So sorry for giving you a headache This is the problem at the moment: The code is working now! But maybe it has something to do with taxes when the product price on…
I just launched my store on wordpress and I ran into a problem: When I am on the home page of the site, all my product titles are in H2 and should be in h3 (SEO reasons), my recommendation products…
I want to echo some text before the cart on a product archive page (shop listings) but ONLY on the products that are by a certain author. I have this code which shows the information I want where I want…
I'm looking to hook into the woocommerce_cart_item_name filter in WooCommerce and would like to display the product ID after the name ONLY for a specific Product. I'm looking at this code: add_filter( 'woocommerce_cart_item_name', 'just_a_test', 10, 3 ); function just_a_test( $item_name,…
Recently found a topic that really attracts me, which is the React Route and Framer Motion. I mainly build website with WordPress and Elementor, I'm curious if there are any way to achieve similar effect as React's Framer motion? For…
Based on Get product custom attributes to display them in WooCommerce product loop answer code. I am displaying specific product attributes on the single product page with this: add_action('woocommerce_single_product_summary', 'display_custom_attributes', 36 ); function display_custom_attributes() { global $product; $attributes_names = array('Brand',…
I have done all the child category shows in each parent category. Now I want the current or active category not to be displayed when I am on the category page. $queried_object = get_queried_object(); $child_terms = get_term_children ( $queried_object->term_id, 'product_cat'…
I have clothes products. One product is in multiples categories, like "gender" ("men" or "women") and "type" (such as "pants", "shirts", etc.). I want to list all categories and subcategories of "type" from products that exist in "men" category. ID…
I wonder what's wrong with this code: if ( isset( $_POST['add-to-cart'] ) ) && $matched_id = (int) $_POST['add-to-cart'] ) { $url = 'https://website.com/cart/?add-to-cart=363053'; } It returned a syntax error, unexpected '&&' (T_BOOLEAN_AND)
I'm coming across an issue when trying to register a second user account once someone registers as a customer via WooCommerce. I have added the following woocommerce_created_customer hook: add_action('woocommerce_created_customer', function($customer_id) { if(isset($_POST['second_user_first_name']) && isset($_POST['second_user_last_name'])) { $createSecondUserId = wp_create_user(strtolower($_POST['second_user_first_name'].'-'.$_POST['second_user_last_name']).'-'.$customer_id, wp_generate_password(), '[email protected]');…