wordpress

Hide payment method based on product type in WooCommerce

↘锁芯ラ 提交于 2021-02-16 03:56:00
问题 In WoCommerce, I would like to disable particular payment methods and show particular payment methods for a subscription products in WooCommerce (and vice versa). This is the closest thing we've found but doesn't do what I am expecting. Yes, there are plugins that will do this but we want to achieve this without using another plugin and without making our stylesheet any more nightmarish than it already is. Any help on this please? 回答1: Here is an example with a custom hooked function in

Hide payment method based on product type in WooCommerce

帅比萌擦擦* 提交于 2021-02-16 03:54:00
问题 In WoCommerce, I would like to disable particular payment methods and show particular payment methods for a subscription products in WooCommerce (and vice versa). This is the closest thing we've found but doesn't do what I am expecting. Yes, there are plugins that will do this but we want to achieve this without using another plugin and without making our stylesheet any more nightmarish than it already is. Any help on this please? 回答1: Here is an example with a custom hooked function in

Programmatically created WooCommerce order have no tax for new users

可紊 提交于 2021-02-15 06:51:08
问题 Im using Gravity forms to create an WooCommerce order programmatically. If an email added to the form already exists, it takes the shipping and billing from the users account. This works and it adds the VAT correctly. For a user that is not logged in, they add name, email, phone and country to the form, and the user is created automatically. The order is created, and the user is added. But in this case, the AT is not added and I have to manually recalculate the order for the VAT to be added.

Programmatically created WooCommerce order have no tax for new users

♀尐吖头ヾ 提交于 2021-02-15 06:50:13
问题 Im using Gravity forms to create an WooCommerce order programmatically. If an email added to the form already exists, it takes the shipping and billing from the users account. This works and it adds the VAT correctly. For a user that is not logged in, they add name, email, phone and country to the form, and the user is created automatically. The order is created, and the user is added. But in this case, the AT is not added and I have to manually recalculate the order for the VAT to be added.

How to show the login and register form on two different pages with WooCommerce using templates

匆匆过客 提交于 2021-02-13 17:35:46
问题 I have a my-account page which is displaying the login and register form. Below is the screenshot. There is no css as of now. My issue is, I have to separate both the pages. I mean I have to create a login and register both pages separately. This is the whole code form-login.php <?PHP /** * Login Form * * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-login.php. * * HOWEVER, on occasion WooCommerce will need to update template files, and you * (the theme

How to show the login and register form on two different pages with WooCommerce using templates

我的梦境 提交于 2021-02-13 17:35:32
问题 I have a my-account page which is displaying the login and register form. Below is the screenshot. There is no css as of now. My issue is, I have to separate both the pages. I mean I have to create a login and register both pages separately. This is the whole code form-login.php <?PHP /** * Login Form * * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-login.php. * * HOWEVER, on occasion WooCommerce will need to update template files, and you * (the theme

Docker + WordPress搭建个人博客

末鹿安然 提交于 2021-02-13 17:13:04
WordPress是目前非常受欢迎的开源博客系统,今天使用 Docker + WordPress 搭建个人博客,整个过程非常丝滑。 搭博客先要准备域名和服务器,昨天在阿里云买了个.top的域名花了5块钱(美滋滋~~),本来再准备在阿里云再选个 轻量应用服务器 看了下最便宜都也要600+一年,去了隔壁腾讯花了88买了个一个 1核 + 2g 的服务器还算不错。 安装Docker 安装Dokcer比较简单几行命令下来,安排的明明白白: 更新apt仓库索引 sudo apt-get update 安装软件,允许apt使用https软件源 sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common 添加Docker官方GPG key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 添加Docker官方源 sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" 更新apt仓库索引

Woocomerce Remove a specific cart items when adding to cart another specific items

余生颓废 提交于 2021-02-13 05:47:26
问题 Provided solution here Remove a specific cart item when adding to cart a specific product in Woocommerce works perfect for one product id. Is any way to do this for multiple id's? 回答1: Update 2 : The following code will work for multiple product IDs: add_action( 'woocommerce_add_to_cart', 'check_product_added_to_cart', 10, 6 ); function check_product_added_to_cart($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) { // Set HERE your targeted product ID $target

Woocomerce Remove a specific cart items when adding to cart another specific items

て烟熏妆下的殇ゞ 提交于 2021-02-13 05:44:00
问题 Provided solution here Remove a specific cart item when adding to cart a specific product in Woocommerce works perfect for one product id. Is any way to do this for multiple id's? 回答1: Update 2 : The following code will work for multiple product IDs: add_action( 'woocommerce_add_to_cart', 'check_product_added_to_cart', 10, 6 ); function check_product_added_to_cart($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) { // Set HERE your targeted product ID $target

Woocomerce Remove a specific cart items when adding to cart another specific items

穿精又带淫゛_ 提交于 2021-02-13 05:43:29
问题 Provided solution here Remove a specific cart item when adding to cart a specific product in Woocommerce works perfect for one product id. Is any way to do this for multiple id's? 回答1: Update 2 : The following code will work for multiple product IDs: add_action( 'woocommerce_add_to_cart', 'check_product_added_to_cart', 10, 6 ); function check_product_added_to_cart($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) { // Set HERE your targeted product ID $target