Add same product to cart twice instead of changing quantity in Cart Page.

How to add the same product twice to cart instead of changing quantity in WooCommerce   In normal case when we increase quantity of product in WooCommerce cart it simply increase quantity of same product that’s one product with incremented quantity. But In some of cases, We like to have product in WooCommerce added in the cart as separate items and not as the same item with the changed quantity. Basically we need to display separate cart items for product quantity > 1. We can do that with pasting the code To the functions.php of theme.   This Is Done Basically In Two Steps:   Step 1: Split product quantities into multiple cart items.   In This Hooks Basically, when we are adding a new product to cart ,we have added a unique key to each cart item meta. that’s why the same product become distinct product each time. For

Disable Automatic Login After Registration

When we enable customer registration on My Account page, We will know that when new user is register it’s automatically logged in .
it need to change when we need to manually approve each user.

Display “FREE” if Product Price is 0 or Empty On WooCommerce Cart Page Or Checkout Page.

Do you ever need to replace the default WooCommerce pricing label for a free product?   If we ask any user what will he/she like the text “FREE” or a price tag of “0.00”. Majority will say “Free” Attracts More.   Now Let’s talk about WooCommerce ,In WooCommerce when product price is zero or empty then on cart page or checkout page and product page will show zero price ($0.00). Instead of showing the default WooCommerce pricing label of $0.00, you want to show custom text,like “FREE” or “Download Now”. In Previous Image we so price tag , But I still believe “FREE” looks much better than “$0.00”. It’s much more enticing, isn’t it?   For Cart and Checkout Page:   function FreeCartItemPriceCustomLabel( $price, $cart_item, $cart_item_key ) { $FreeLabel = ‘<span class=”amount” style=” color: #f7ad06 !important; “>’ . __(‘Free’) . ‘</span>’; if( $cart_item[‘data’]->get_price() > 0 ){ return $price; }else{ return

Remove Welcome Panel from WordPress

In WordPress, the “Welcome” panel is a dashboard widget that appears for new users or users who haven’t dismissed it yet. It provides some basic information and links to help users get started with WordPress. If you want to remove the “Welcome” panel from the WordPress dashboard, you can do so using either a plugin or custom code. Option 1: Remove “Welcome” Panel Using a Plugin 1. Install and activate the “Disable Welcome Panel” plugin. You can find this plugin on the WordPress.org plugin repository. 2. Once activated, the “Welcome” panel will no longer be displayed on the WordPress dashboard. Option 2: Remove “Welcome” Panel Using Custom Code If you prefer to remove the “Welcome” panel using custom code, follow these steps: 1. Open your theme’s `functions.php` file or create a custom plugin file. 2. Add the following code to remove the “Welcome” panel:   function custom_remove_welcome_panel() { remove_action(‘welcome_panel’, ‘wp_welcome_panel’);

Add Custom Dashboard Widgets in WordPress.

To add custom dashboard widgets in WordPress, you can use the `wp_add_dashboard_widget` function. This function allows you to create and display custom widgets on the WordPress dashboard. The `wp_add_dashboard_widget` function is used to register and display a custom dashboard widget. It requires three parameters: 1. `$widget_id` (string) – The ID of the widget. This ID must be unique to avoid conflicts with other dashboard widgets. It’s used as a reference for the widget, so make sure to choose a unique and descriptive ID. 2. `$widget_name` (string) – The name or title of the widget. This is the text that will be displayed as the title of the dashboard widget. 3. `$callback` (callable) – The callback function that renders the content of the widget. This function will be responsible for generating the HTML and content to be displayed in the custom dashboard widget. It should accept no arguments as WordPress will

How to add ACF options pages and options sub page

To add Advanced Custom Fields (ACF) options pages and options sub-pages, you’ll need to have ACF Pro installed and activated on your WordPress site. ACF Pro allows you to create custom options pages where you can add settings, fields, and other configuration data.

Change the WooCommerce Breadcrumb Text.

To change the WooCommerce breadcrumb text, you can use the `woocommerce_breadcrumb_defaults` filter hook to modify the default breadcrumb settings. This filter allows you to customize the breadcrumb separator and labels as per your requirement. Here’s how you can change the WooCommerce breadcrumb text: 1. Open your theme’s `functions.php` file or a custom plugin file. 2. Add the following code to customize the breadcrumb text: function custom_change_woocommerce_breadcrumb($args) { // Customize breadcrumb separator (optional) $args[‘delimiter’] = ‘ > ‘; // Customize breadcrumb labels $args[‘home’] = ‘Custom Home’; $args[‘shop’] = ‘Custom Shop’; $args[‘singular_name’] = ‘Custom Item’; return $args; } add_filter(‘woocommerce_breadcrumb_defaults’, ‘custom_change_woocommerce_breadcrumb’); In this code, we use the `woocommerce_breadcrumb_defaults` filter to modify the breadcrumb settings. The `custom_change_woocommerce_breadcrumb` function receives the default breadcrumb settings as `$args`. You can customize the following breadcrumb settings: – `$args[‘delimiter’]`: This sets the separator between breadcrumb items. In the example, we use `’ > ‘` as the separator. You can

Categories