product

Remove product dimensions from single product pages in Woocommerce

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-03 03:18:11
问题 Anyone knows how to hide the product dimensions from the additional tabs on Single Product page but still show the Weight value? I search and see this filter but it hides both weight and dimensions. add_filter( 'woocommerce_product_get_dimensions', '__return_false' ); 回答1: To hide only dimensions (but not weight) , there is 2 ways to make it work. 1) using hooks (here composite filter hooks ): Looking at the template that displays dimension in single products, you can see this line: <?php if

Opencart: How to relate product options (like size and color)?

别等时光非礼了梦想. 提交于 2020-01-03 01:52:32
问题 I'm using opencart version 1.5.5.1 for our website. I need to add more than one option for products. For example: I need to show shirts of sizes- Large/Medium/Small and colors White/Black/Blue/Red/Green etc. By default opencart allows us to add separate quantities for each color and size. How can I mention that we've 5 Large Shirts of Blue Color, 3 Medium Shirts of White Color etc. ? Please help. Thanks in Advance! 回答1: I guess this would only be possible if You create an options for size x

Opencart: How to relate product options (like size and color)?

馋奶兔 提交于 2020-01-03 01:52:27
问题 I'm using opencart version 1.5.5.1 for our website. I need to add more than one option for products. For example: I need to show shirts of sizes- Large/Medium/Small and colors White/Black/Blue/Red/Green etc. By default opencart allows us to add separate quantities for each color and size. How can I mention that we've 5 Large Shirts of Blue Color, 3 Medium Shirts of White Color etc. ? Please help. Thanks in Advance! 回答1: I guess this would only be possible if You create an options for size x

Custom Redirection based on Geolocation for specific products in WooCommerce

筅森魡賤 提交于 2020-01-03 01:47:25
问题 I need to re-direct customers from Germany to a custom page if they try to access a product page and I've started to put something together, but I don't know how to finish it. Here's what I got: add_action( 'do not know which hook to use', 'geo_origin_redirect' ); function geo_origin_redirect() { $location = WC_Geolocation::geolocate_ip(); $country = $location['country']; $product_ids = array( 10, 20, 30 ); $product_categories = array( 'makeup' ); $redirection = false; // what to do here to

Auto add a Product to Cart in Woocommerce 3

主宰稳场 提交于 2020-01-02 21:59:08
问题 I would like that anybody who visits my Woocommerce shop finds a free product in his cart. I found this code and it works but it shows many php errors in logs. Do you have an idea why is not "clean"? Any help on this please. /* * AUTOMATICALLY ADD A PRODUCT TO CART ON VISIT */ function aaptc_add_product_to_cart() { if ( ! is_admin() ) { $product_id = 99999; // Product Id of the free product which will get added to cart $found = false; //check if product already in cart if ( sizeof( WC()->cart

Magento: After ordering configurable product, its canceled because its out of stock

混江龙づ霸主 提交于 2020-01-02 17:11:58
问题 my problem is: i have a product with simple products as childs. (maybe tshirts whith size S-XL and some colors) Now if i order one of this, it is canceled with the order-confirmation email. I think its a problem with the stock but i dont know. There are 99 items in stock of every kind and all are activated and ready to deliver. Anybody who has had the same problem? 回答1: Here the Solution: The problem was crossing ids in the order tables so magento mixed up all items. Solved this with

Hide Related Products from specific products single pages in Woocommerce

馋奶兔 提交于 2020-01-02 15:51:48
问题 Okay so I am trying to hide the 'Related Products' section on the product page, BUT only for a specific product not all products. I have found the following documentation to hide the section for all product pages: https://docs.woocommerce.com/document/remove-related-posts-output/ But as I mentioned this is how to hide the 'Related Products' section on all product pages. But I am looking for a way to hide this section ONLY on a specific product page. Does anyone have any idea on how this can

Different recipients based on products sold in WooCommerce email notification

怎甘沉沦 提交于 2020-01-02 13:34:14
问题 I’m looking to sell a number of virtual items on WooCommerce for different businesses. So when the customer has checked out, I'd like the email to be sent to the relevant business (not to admin). So when Product A is sold, an email will go to a@email.com. When Product B is sold, the email will be sent to b@email.com. When Product C is sold, the email will be sent to c@email.com...and so forth. Is there some code I can add to functions.php to achieve this? 回答1: Based on "Different recipients

Get is_purchasable hook working for Woocommerce product variations too

会有一股神秘感。 提交于 2020-01-02 07:29:12
问题 I have made 2 custom product fields - availability - since when/until when. So if the current date is between these set availability dates then product is purchasable, else - it's not. Everything works perfectly however only until I post a product with a variations. Then it's like product variations ignore these custom availability fields/values and still let to add variations to cart even if current date is not between set availability dates. function hide_product_if_unavailable( $is

WooCommerce Custom product type - Multiple add to cart sections issue

二次信任 提交于 2020-01-02 07:15:35
问题 I've created a custom product type in woocommerce called Booking. Here is the code that I have: class WC_Product_Booking extends WC_Product{ /** * __construct function. * * @access public * @param mixed $product */ public function __construct( $product ) { $this->product_type = 'booking'; $this->supports[] = 'ajax_add_to_cart'; parent::__construct( $product ); add_action('woocommerce_booking_add_to_cart', array($this, 'add_to_cart'),30); } private function show_pricing_fields(){ ?><script