Comments for Tyche Softwares https://www.tychesoftwares.com Wed, 07 Jun 2023 18:28:38 +0000 hourly 1 Comment on How to add charges or discounts for different payment methods in WooCommerce by Anubha Bhat https://www.tychesoftwares.com/how-to-add-charges-or-discounts-for-different-payment-methods-in-woocommerce/#comment-214467 Wed, 07 Jun 2023 18:28:38 +0000 https://www.tychesoftwares.com/?p=361801#comment-214467 In reply to Subham.

You can add an ‘if’ condition after this line.
// Calculating percentage
          $discount = number_format(($cart_total / 100) * $percent, 2);

Something like:

$max_discount_limit = 200;
if ($discount<=$max_discount_limit) {
$cart_object->add_fee( $label_text, -$discount, false );
}
else {
$discount=200;
$cart_object->add_fee( $label_text, -$discount, false );
}

]]>
Comment on How to add charges or discounts for different payment methods in WooCommerce by Anubha Bhat https://www.tychesoftwares.com/how-to-add-charges-or-discounts-for-different-payment-methods-in-woocommerce/#comment-214466 Wed, 07 Jun 2023 18:03:26 +0000 https://www.tychesoftwares.com/?p=361801#comment-214466 In reply to Chirag Joshi.

Yes, you can do this directly through the WordPress dashboard.
Navigate to Woocommerce –> Settings –> Payments. Click on the Payment method that you want to add text to, and edit the Title field.

]]>
Comment on How to remove the Last name field from the My Account page in WooCommerce by Anubha Bhat https://www.tychesoftwares.com/how-to-remove-last-name-field-from-my-account-page-in-woocommerce/#comment-214252 Sun, 04 Jun 2023 18:15:30 +0000 https://www.tychesoftwares.com/?p=360738#comment-214252 In reply to Alvina.

Hi, you can refer to this post to make the fields optional, and later use css to hide the fields:

https://www.tychesoftwares.com/how-to-make-fields-mandatory-or-optional-on-the-woocommerce-checkout-page/

]]>
Comment on How to remove the Last name field from the My Account page in WooCommerce by Anubha Bhat https://www.tychesoftwares.com/how-to-remove-last-name-field-from-my-account-page-in-woocommerce/#comment-214251 Sun, 04 Jun 2023 18:07:19 +0000 https://www.tychesoftwares.com/?p=360738#comment-214251 In reply to cyberlounge.

You can try the code snippet below.

For example, this is for hiding the Company field from the Addresses section under My Account:

function ts_hide_company_name_in_addresses($address, $customer_id, $address_type) {
  // Check if the address type is ‘billing’ or ‘shipping’
  if ($address_type === ‘billing’ || $address_type === ‘shipping’) {
    // Remove the Company name from the address
    unset($address[‘company’]);
  }
  return $address;
}
add_filter(‘woocommerce_my_account_my_address_formatted_address’, ‘ts_hide_company_name_in_addresses’, 10, 3);

]]>
Comment on How to remove the Last name field from the My Account page in WooCommerce by Anubha Bhat https://www.tychesoftwares.com/how-to-remove-last-name-field-from-my-account-page-in-woocommerce/#comment-214250 Sun, 04 Jun 2023 17:59:21 +0000 https://www.tychesoftwares.com/?p=360738#comment-214250 In reply to Mohammad.

This is happening because the new password functionality requires you to enter the current password. You may need to use the “woocommerce_save_account_details_args” filter for this. Please try this code:

function ts_disable_current_password_requirement($args, $user) {

  if (isset($args[‘user_pass’])) {

    $args[‘user_pass’] = wp_hash_password($args[‘user_pass’]);

  }

  return $args;

}

add_filter(‘woocommerce_save_account_details_args’, ‘ts_disable_current_password_requirement’, 10, 2);

]]>
Comment on How to add text below the short description of the Product in WooCommerce by Anubha Bhat https://www.tychesoftwares.com/how-to-add-text-below-the-short-description-of-the-product-in-woocommerce/#comment-213967 Mon, 29 May 2023 18:08:27 +0000 https://www.tychesoftwares.com/?p=357072#comment-213967 In reply to Aimash.

Yes, please refer to the last code snippet in this article.

]]>
Comment on How to add text below the short description of the Product in WooCommerce by Aimash https://www.tychesoftwares.com/how-to-add-text-below-the-short-description-of-the-product-in-woocommerce/#comment-213906 Sun, 28 May 2023 11:40:13 +0000 https://www.tychesoftwares.com/?p=357072#comment-213906 Can I html instead plain text in this snippet? Thanks

]]>
Comment on How to rename the Add to Cart button if the product is already added to cart in WooCommerce by Anubha Bhat https://www.tychesoftwares.com/how-to-rename-add-to-cart-button-if-the-product-is-already-added-to-cart-in-woocommerce/#comment-213772 Thu, 25 May 2023 11:27:40 +0000 https://www.tychesoftwares.com/?p=359065#comment-213772 In reply to ixley.

Welcome! 🙂

]]>
Comment on How to add text below the short description of the Product in WooCommerce by Anubha Bhat https://www.tychesoftwares.com/how-to-add-text-below-the-short-description-of-the-product-in-woocommerce/#comment-213744 Wed, 24 May 2023 18:29:01 +0000 https://www.tychesoftwares.com/?p=357072#comment-213744 In reply to Robert.

May I know what issue you are facing?

]]>
Comment on How to add text below the short description of the Product in WooCommerce by Anubha Bhat https://www.tychesoftwares.com/how-to-add-text-below-the-short-description-of-the-product-in-woocommerce/#comment-213743 Wed, 24 May 2023 18:28:30 +0000 https://www.tychesoftwares.com/?p=357072#comment-213743 In reply to Vivek Nath R.

For this, you can edit the short description for every product from the dashboard itself.

]]>