cart

Save and display product selected custom data everywhere in WooCommerce

跟風遠走 提交于 2020-01-11 10:02:31
问题 I have a code that shows the checkbox on the product edit page. When I click on this checkbox, a select box is displayed on the single product page. Here is my code: // Display Checkbox Field add_action('woocommerce_product_options_general_product_data', 'roast_custom_field_add'); function roast_custom_field_add(){ global $post; // Checkbox woocommerce_wp_checkbox( array( 'id' => '_roast_checkbox', 'label' => __('Roast Level', 'woocommerce' ), 'description' => __( 'Enable roast level!',

Save and display product selected custom data everywhere in WooCommerce

瘦欲@ 提交于 2020-01-11 10:01:18
问题 I have a code that shows the checkbox on the product edit page. When I click on this checkbox, a select box is displayed on the single product page. Here is my code: // Display Checkbox Field add_action('woocommerce_product_options_general_product_data', 'roast_custom_field_add'); function roast_custom_field_add(){ global $post; // Checkbox woocommerce_wp_checkbox( array( 'id' => '_roast_checkbox', 'label' => __('Roast Level', 'woocommerce' ), 'description' => __( 'Enable roast level!',

Remove a specific cart item when adding to cart a specific product in Woocommerce

北战南征 提交于 2020-01-11 07:01:05
问题 With WooCommerce, I am looking to see if it's possible to remove a specific item (from cart), if another specific item is in the cart. My web shop has a free version of a product which gives to customer a basic access to site content. The paid version will open up more access to content. This way if the free version is already in the cart, and the paid version gets added to cart, then the free version will be removed from cart. I tried looking at possible options and plugins but most of them

Apply a discount on the cart content total excluding taxes in WooCommerce

六眼飞鱼酱① 提交于 2020-01-10 03:18:20
问题 I need to apply a discount to the cart subtotal before tax is calculated if a user is ordering for the first time. However, tax is calculated per-item in WooCommerce and added to the subtotal afterwards. So I need to apply the discount to the items in the cart before WooCommerce calculates the tax on them. This way the tax is based off of the discounted prices rather than the original prices. Here is what I have: function first_order_add_five_percent_discount($cart_object) { if ( is_user

How to remove Shipping from Woocommerce cart? [closed]

梦想与她 提交于 2020-01-09 10:54:42
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I have one question. I need remove shipping and shipping calculate from cart. Its possible delete with hooks? I am newbie in this. Template is: http://flatsome.uxthemes.com/cart/ I'll be glad for any advice. Thanks. Cart Woocommmerce 回答1: Add the following snippet on your

How to remove Shipping from Woocommerce cart? [closed]

给你一囗甜甜゛ 提交于 2020-01-09 10:53:12
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I have one question. I need remove shipping and shipping calculate from cart. Its possible delete with hooks? I am newbie in this. Template is: http://flatsome.uxthemes.com/cart/ I'll be glad for any advice. Thanks. Cart Woocommmerce 回答1: Add the following snippet on your

How to remove Shipping from Woocommerce cart? [closed]

余生颓废 提交于 2020-01-09 10:53:00
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I have one question. I need remove shipping and shipping calculate from cart. Its possible delete with hooks? I am newbie in this. Template is: http://flatsome.uxthemes.com/cart/ I'll be glad for any advice. Thanks. Cart Woocommmerce 回答1: Add the following snippet on your

How to hide specific product categories price from cart icon dropdown

那年仲夏 提交于 2020-01-06 08:43:37
问题 I have some product categories which I don't to show the price to the user. Successfully hide the price from the product pages and also from the cart page but the price still showing in the cart icon when the user hovers over the icon and a dropdown list appear of the products that are in the cart. Anyone know how to fix this? Any help will be appreciated.This is the code that I am using to hide the price for the specific category. add_filter('woocommerce_cart_item_price', 'hide_woocommerce

Python shopping cart add to cart, get total get num items

百般思念 提交于 2020-01-06 07:56:19
问题 I am studying for my final and this was a quiz question I missed. I need most of the help on the getTotal method. I need to loop through the list, find the price of each item, add the price to the total and return the total. I struggle with loops and I am not sure how to pull the second item out of a list.. [1] ?? I have tried many ways and am getting frustrated. If there is anyone up that is willing to help me that would be great. I am still learning and am new at this so go easy on me, but

Set minimum Order amount for specific Products and Categories in Woocommerce

删除回忆录丶 提交于 2020-01-06 04:06:12
问题 I've searched extensively to see if other folks had this situation and received an answer with no luck. Essentially, I have two items customers can add to their cart. I want to make it so they cannot checkout with either of those items if their subtotal is not $15 or more. Having the ability to just drop their IDs into the code would be fine. Or, I can assign them to the same category and set this minimum by category. So far all I have is the basic PHP that sets a universal minimum. I just