product

Display only products from the logged in author on WooCommerce admin products list

戏子无情 提交于 2021-01-28 04:59:27
问题 Is there a way, by which this Admin product dashboard shows only the products created by the logged-in user? I am trying manage_{$post->post_type}_posts_custom_column function but cannot move much E.g. I want something like this add_action( 'manage_product_posts_custom_column', 'custom_column_content', 10, 2 ); function custom_column_content( $column, $product_id ){ if( logged in user==Product Author){ Display product; } else{ Dont display product } } 回答1: The manage_product_posts_custom

Get the product category name and description in Woocommerce Single Product page

爱⌒轻易说出口 提交于 2021-01-28 04:39:54
问题 I've been using the WooCommerce Codex, but I can't seem to get the data to display. I simply want to display the product category and descriptions to display on single product pages for my own custom layout like so. <?php global $product; echo $product->get_attributes; ?> <?php global $product; echo $product->get_short_description; ?> 回答1: As you can have many product categories for a product, you will need to use a foreach loop. The $term variable is the WP_Term object… <?php foreach( wp_get

Automatic product insert via soap on WooCommerce product creation

牧云@^-^@ 提交于 2021-01-28 04:37:15
问题 I have a billing program and to connect that program to my online store in wordpress i used a plugin but now i've been requested to do the following update : Whenever we create a product on woocommerce it creates automatically on the billing program aswell i asked the billing program support for help to do this and they gave me the following example $result = $soap->authenticate( $API_KEY ); $APISession = $result[1]; $ref = "002"; $designation = "Produto de teste"; $shortName = "Ptest"; $tax

WooCommerce custom field in Orders edit page

主宰稳场 提交于 2021-01-28 04:22:24
问题 // Display custom field Orders edit page add_action('woocommerce_before_order_itemmeta', 'storage_location_of_order_items', 10, 3); function storage_location_of_order_items($item_id, $item, $product) { // Only on backend order edit pages if (!(is_admin() && $item->is_type('line_item'))) return; // Get your '_laoriiul' value (replace the slug by yours below) $custom_ladu = get_post_meta($product->get_id(), '_laoriiul', true); //Error message: "Uncaught Error: Call to a member function get_id()

Display a custom taxonomy in Woocommerce single product pages

我的未来我决定 提交于 2021-01-28 03:10:15
问题 I have added a new taxonomy called "Vendor" to Woocommerce with the following code: // hook into the init action and call taxonomy when it fires add_action( 'init', 'create_vendor_taxonomy', 0 ); // create and register vendor taxonomy (hierarchical) function create_vendor_taxonomy() { $labels = array( 'name' => _x( 'Vendors', 'taxonomy general name', 'textdomain' ), 'singular_name' => _x( 'Vendor', 'taxonomy singular name', 'textdomain' ), 'search_items' => __( 'Search Vendors', 'textdomain'

Product shortcode - Removing product title on blog posts and pages

情到浓时终转凉″ 提交于 2021-01-28 01:10:11
问题 How do I remove the title on WooCommerce products when they are posted as short codes? [product_page id="99"] I am getting a double title: on the shortcode product embed on the actual blog post I would like to disable to title on the shortcode only and keep the title on the blog post, but keeping the title on the shop page. 回答1: Those titles are hooked in content_single-product.php WooCommerce template file as you can see below: /** * woocommerce_single_product_summary hook. * * @hooked

Woocommerce product search not checking “product_tag”?

好久不见. 提交于 2021-01-27 20:40:19
问题 It appears as tho the search functionality for WooCommerce products does not check "product_tag" taxonomy terms, nor SKU field? I added the SKUs as product tags to their respective products, but it still returns nothing when I search for the SKU.... How do I make the search functionality check product_tag terms? I have tried many many many things from adding tax_query to pre_get_post filter, to a whole new WP_Query loop, it just fails to search product_tags for some reason....so what is the

Custom add to cart button, if the customer has bought previously the product

。_饼干妹妹 提交于 2021-01-27 20:32:59
问题 In WooCommerce, I need to know if there's any option to change the add to cart button, if the customer has bought previously the product. We're selling online courses via WooCommerce & Membership, so the idea is that if the customer hasn't bought the course, he has to see the "Shop now" button. But if he has bought the course, he should see a "View now" button, with a custom link for each product (course). How can I achieve this? Thanks. 回答1: Here is a fully functional and tested custom

Move product description after short description in Woocommerce

Deadly 提交于 2021-01-27 20:20:18
问题 I've used the first option of this hook (the other ones didn't work) -> Woocommerce Product Default Description for All Products And this is how it looks (the red marked text is the standard description) However, I want the text to appear after the product description. where the red arrow is, I want the standard text. So above 'in winkelmand' (which means 'add to bag') How can I achieve this? 回答1: This can be done with the following code (commented) : // 1. Remove the description product tab

Simple VBA function that returns product of range value

*爱你&永不变心* 提交于 2021-01-27 07:42:29
问题 I want the function to take a range of cells as an argument and return their product. Let's assume the following value for cells: A1=5 A2=2 A3=3 Let's call the function Multiply . =Multiply(A1:A3) will return 30 (=5×2×3). What is the code for this? I'm just trying to familiarize myself with the syntax and this will help out a lot. Edit: figured it out: Function multiply(rng As Range) multiplied = 1 For Each cell In rng multiplied = multiplied * cell.Value Next multiply = multiplied End