wordpress

Display a payment link for custom order statuses in Woocommerce email notifications

旧街凉风 提交于 2021-02-19 07:30:26
问题 I've been struggling for a while to get this to work. I need to show this payment link in my woocommerce emails, but only on certain (custom) order statuses. How is it done? Thanks :) printf( wp_kses( /* translators: %1s item is the name of the site, %2s is a html link */ __( '%2$s', 'woocommerce' ), array( 'a' => array( 'href' => array(), ), ) ), esc_html( get_bloginfo( 'name', 'display' ) ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Click here to pay

Woocommerce Change shipping method title on checkout based on shipping class selected

懵懂的女人 提交于 2021-02-19 06:52:04
问题 I want to change the shipping method title displayed in the checkout of my store based on the shipping class the product has. e.g. Shipping method title is currently Flat Rate and I have 2 products: If product A is being purchased I need it to have "Fragile shipping" If product B is being purchased I need it to have "Standard shipping" Sadly I have to do my shipping using classes so alternative methods won't work. Any help would be appreciated. 回答1: The following code will rename your

Change Related Products Heading adding the product name in WooCommerce

自闭症网瘾萝莉.ら 提交于 2021-02-19 06:48:04
问题 I have this code which is an attempt in translating "Related products" into "These will go well with PRODUCT NAME". Here's my code: add_filter( 'gettext', 'change_related_products_title', 10, 3 ); function change_related_products_title( $translated, $text, $domain ) { $ptitle = get_page_by_title( 'Product Title', OBJECT, 'product' ); if( $text === 'Related products' && $domain === 'woocommerce' ){ $translated = esc_html__( 'These go well with '.$ptitle.' ', $domain); } return $translated; }

wordpress rest api response sending html content type issue with forward slash in URL

[亡魂溺海] 提交于 2021-02-19 06:17:21
问题 From my custom Wordpress rest api, i need to return below text as content type html. OK ImageSendURL=www.yourdomain.xxx/Plugin/DownloadOrders Here is my code to return the same return new WP_REST_Response( "OK \n URL={$options['url']}", 200, array('content-type' => 'text/html; charset=utf-8')); But this returns "OK \n URL=http:\/\/yourdomain.xxx\/Plugin\/DownloadOrders" I don't want the leading and trailing double quotes " and also the URL is kind screwed up. how can i fix this? with the

Can't remove WooCommerce's image zoom

泄露秘密 提交于 2021-02-19 06:12:45
问题 I am trying to remove the image zoom from my custom themed website which uses WooCommerce. Here is what I've tried adding in my functions.php file: add_action( 'after_setup_theme', 'remove_pgz_theme_support', 100 ); function remove_pgz_theme_support() { remove_theme_support( 'wc-product-gallery-zoom' ); } and this add_action( 'wp', 'remove_pgz_theme_support', 20 ); function remove_pgz_theme_support() { remove_theme_support( 'wc-product-gallery-zoom' ); } I've spend some time googling but the

Can't remove WooCommerce's image zoom

你。 提交于 2021-02-19 06:11:24
问题 I am trying to remove the image zoom from my custom themed website which uses WooCommerce. Here is what I've tried adding in my functions.php file: add_action( 'after_setup_theme', 'remove_pgz_theme_support', 100 ); function remove_pgz_theme_support() { remove_theme_support( 'wc-product-gallery-zoom' ); } and this add_action( 'wp', 'remove_pgz_theme_support', 20 ); function remove_pgz_theme_support() { remove_theme_support( 'wc-product-gallery-zoom' ); } I've spend some time googling but the

Set all shipping methods cost to zero for a Free shipping coupon in Woocommerce

故事扮演 提交于 2021-02-19 05:31:19
问题 I have 3 shipping methods in my cart that should become zero prices as soon as your customer enters Free Shipping coupon. I know how to add a filter in functions.php to detect the coupon but is someone know a snippet to set shipping methods visibles in cart (radio button) to ZERO for this order? My deliveries methods are companies like UPS, FedEx... I activated the free shipping option in order it can be managed with coupon. The list of choice of deliveries methods for the customers is

Set all shipping methods cost to zero for a Free shipping coupon in Woocommerce

孤人 提交于 2021-02-19 05:31:17
问题 I have 3 shipping methods in my cart that should become zero prices as soon as your customer enters Free Shipping coupon. I know how to add a filter in functions.php to detect the coupon but is someone know a snippet to set shipping methods visibles in cart (radio button) to ZERO for this order? My deliveries methods are companies like UPS, FedEx... I activated the free shipping option in order it can be managed with coupon. The list of choice of deliveries methods for the customers is

Enabling Payment method based on the customers location

社会主义新天地 提交于 2021-02-19 05:25:23
问题 I don't know if it's possible, but, we would need to add some different payment methods for Barcelona. So, our idea is that if the customer lives in Barcelona area (Catalunya), he will see a credit card payment method and a bank transfer account different than the rest of Spain. Is that possible with WooCommerce? Thanks. 回答1: If you want to enable this kind of feature in WooCommerce , Customers need to be registered and logged on first, as it's the only way to get they town location before

Dynamic discount using AJAX and Fee API in Woocommerce checkout page

随声附和 提交于 2021-02-19 04:39:07
问题 I have put a select box in the checkout page like this. function rx_wc_reward_points_check() { $reward_points = '<select class="rx-rewad-points" id="rx-redemption-points"> <option value="1250">$25.00 Off (1250 Points) </option> <option value="2500">$50.00 Off (2500 Points) </option> <option value="5000">$100.00 Off (5000 Points) </option> <option value="7000">$150.00 Off (7000 Points) </option> </select>'; $reward_points .= '<a class="button alt" name="rx_reward_points_btn" id="rx_reward