product

change custom product tab position in admin grid Magento

和自甴很熟 提交于 2020-01-02 07:05:54
问题 Hi i have added a new product tab in admin grid by following the below link http://inchoo.net/magento/how-to-add-custom-product-relations-in-magento/ Everything is working fine. BUt this has added the new tab at the last position in product edit section. Can you please suggest me how can i change the position of that tab. thanks 回答1: You can use the action addTabAfter instead of addTab , then you have to specify the <after> parameter (categories, websites, upsell...). I edited the code of

Hide product prices and add-to-cart buttons but not variations for unregistered users in WooCommerce

女生的网名这么多〃 提交于 2020-01-02 06:58:39
问题 In my WooCommerce shop I want to hide the prices until the customer has logged in. I've got the following code working that does exactly that: add_action('init','hide_price'); function hide_price(){ if(!is_user_logged_in()){ remove_action('woocommerce_after_shop_loop_item','woocommerce_template_loop_add_to_cart',10); remove_action('woocommerce_single_product_summary','woocommerce_template_single_add_to_cart',30); remove_action('woocommerce_single_product_summary','woocommerce_template_single

Hide product prices and add-to-cart buttons but not variations for unregistered users in WooCommerce

瘦欲@ 提交于 2020-01-02 06:58:00
问题 In my WooCommerce shop I want to hide the prices until the customer has logged in. I've got the following code working that does exactly that: add_action('init','hide_price'); function hide_price(){ if(!is_user_logged_in()){ remove_action('woocommerce_after_shop_loop_item','woocommerce_template_loop_add_to_cart',10); remove_action('woocommerce_single_product_summary','woocommerce_template_single_add_to_cart',30); remove_action('woocommerce_single_product_summary','woocommerce_template_single

Completely hide products from unauthorized users in WooCommerce

心已入冬 提交于 2020-01-01 19:18:16
问题 I'm trying to remove a product/products completely from Users that are not logged in and if user is not specific role (e.g Verified Buyer). I have been able to create a new role called Verified Buyer using the code below; add_role( 'verified_buyer', __( 'Verified Buyer', 'text-domain' ), array( 'read' => true, 'edit_posts' => false, ) ); //This Role is same role capability as the WooCommerce Customer role and i have as well added a checkbox to the WooCommerce Add New Product page using the

Add checkbox to product type option in Woocommerce backend product edit pages

匆匆过客 提交于 2020-01-01 12:04:18
问题 I have added a custom option checkbox in Woocommerce admin product data settings. If I enable that checkbox and save the changes, the value is correctly saved in product meta data, but the checkbox never stay checked . What I am doing wrong? How to get this working as other option checkboxes? My code: function add_e_visa_product_option( $product_type_options ) { $product_type_options[''] = array( 'id' => '_evisa', 'wrapper_class' => 'show_if_simple show_if_variable', 'label' => __( 'eVisa',

How to Add a row vector to a column vector like matrix multiplication

故事扮演 提交于 2019-12-31 05:22:56
问题 I have a nx1 vector and a 1xn vector. I want to add them in a special manner like matrix multiplication in an efficient manner (vectorized): Example: A=[1 2 3]' B=[4 5 6] A \odd_add B = [1+4 1+5 1+6 2+4 2+5 2+6 3+4 3+5 3+6 ] Regards 回答1: You can use bsxfun: A=[1 2 3]' B=[4 5 6] bsxfun(@plus, A, B) The result is ans = 5 6 7 6 7 8 7 8 9 回答2: You can use the repmat function (replicate matrices): repmat(A,1,3)+repmat(B,3,1) 来源: https://stackoverflow.com/questions/11690743/how-to-add-a-row-vector

Woocommerce variation product price to show default

╄→尐↘猪︶ㄣ 提交于 2019-12-31 05:05:38
问题 I have my store set up with product variations and at the moment on the product thumbnail pages i.e. category and filtering pages it shows a (from £xx to £xx) and when down to the single product page and the variation shave been selected to variation price shows. I have certain attributes set as defaults and this is the price I would prefer to show on the category pages... the standard size and cost. BUT i have no idea if its possible or what code to change it to. Is this possible? Any ideas?

Woocommerce custom availability text shown multiple times when selecting variations

天大地大妈咪最大 提交于 2019-12-31 04:50:32
问题 I'm experiencing the following bug on a clients WooCommerce website. We use this free Variations Swatch for Woocommerce plugin. I have a variable product with 4 different colors . If all colors are sold out, when selecting a variation the "out of stock" custom message is shown. But when selecting a different variation the message is shown again, so there are now 2 blocks with "out of stock" custom message: I have a different product in this store with color and engine variations and there's

Rename Add to Cart buttons for Out Of Stock Products in WooCommerce 3

纵然是瞬间 提交于 2019-12-31 03:45:07
问题 I would like to rename 'Add to Cart' to 'Sold Out' when product is sold out in WooCommerce. This is my code: add_filter( 'add_to_cart_text', 'woo_custom_single_add_to_cart_text' ); add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_single_add_to_cart_text' ); // 2.1 + function woo_custom_single_add_to_cart_text() { if( $product->get_stock_quantity() == 0 ) return __( 'Sold Out', 'woocommerce' ); } else { return __( 'Add to cart ', 'woocommerce' ); } But it's not working.

Change markup in WooCommerce shortcode output

瘦欲@ 提交于 2019-12-31 03:09:47
问题 Is it possible to use a WooCommerce shortcode e.g. [product_category category="appliances"] amending the markup to include a <div> tag around some elements? I know I can do this by duplicating what the shortcode does but that seems overkill just to add a wrapping <div> . I could do it with jQuery but don't want any delay in them loading. 回答1: @Updated Yes this is absolutely possible. You can achieve this with something like that: if( !function_exists('prod_cat') ) { function prod_cat( $atts )