Hardik Chosla
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] How to remove the author section from productsWelcome! If you face any problems, let me know.
Forum: Plugins
In reply to: [WooCommerce] Images product with sticky headerIn WordPress, you can implement the sticky column for your product images using CSS, similar to what I outlined earlier. Here’s how you can do it directly within WordPress: Steps to Add Sticky Column in WordPress:
- Identify the Classes/IDs of Your Left and Right Columns:
- You’ll need to find the class or ID that WordPress or your theme assigns to the left column (with images) and the right column (with text). You can do this using the browser’s Inspect Tool (right-click on the page and select “Inspect”).
- Add Custom CSS to Your WordPress Site: You can add custom CSS in a few different places in WordPress:
- Option 1: Through the Customizer:
- Go to your WordPress Dashboard.
- Navigate to Appearance > Customize.
- In the Customizer, go to Additional CSS.
- Paste the following CSS (adjust the selectors to fit your columns):
.left-column { position: sticky; top: 0; /* Make it stick to the top */ z-index: 10; /* Ensure it stays above the text */ }
- Click Publish to apply the changes.
- Option 2: Through the Theme’s
style.css
(if you’re using a child theme or editing your theme files directly):- Go to Appearance > Theme Editor.
- Open the
style.css
file. - Add the same CSS code mentioned above.
- Click Update File.
- Option 1: Through the Customizer:
- Check Your Layout:
- After adding the CSS, check the page where you want the sticky left column to make sure the images are sticking as the user scrolls down. If the sticky effect doesn’t work, verify the class names or IDs of the left column and adjust the CSS selectors accordingly.
Example HTML Structure:
If you’re working with a custom layout, the HTML might look something like this:
<div class="left-column"> <!-- Product images go here --> </div> <div class="right-column"> <!-- Product text goes here --> </div>
Additional Tips:
- If your theme uses custom classes or has a grid system like Bootstrap, ensure you’re targeting the correct column class for the left and right sections.
- Test the layout in different screen sizes, as sticky elements can sometimes have issues on mobile devices.
Let me know if you run into any issues!
Forum: Plugins
In reply to: [WooCommerce] How to rename Woo “Additional Information” tab.To rename the “Additional Information” tab in WooCommerce when using the Elementor Product Data Tabs widget, you can use a custom filter in your theme’s
functions.php
file or a custom plugin. Here’s how to do it: Steps:- Open your WordPress theme’s
functions.php
file (or create a custom plugin). - Add the following code to change the tab title:
function rename_additional_information_tab( $tabs ) { if ( isset( $tabs['additional_information'] ) ) { $tabs['additional_information']['title'] = 'Product Specifications'; // Change this to your preferred title } return $tabs; } add_filter( 'woocommerce_product_tabs', 'rename_additional_information_tab' );
Explanation:
- This filter targets the
woocommerce_product_tabs
hook, which is responsible for the product data tabs. - It checks if the “Additional Information” tab exists (
additional_information
) and then modifies its title. - You can replace
'Product Specifications'
with whatever title you’d prefer.
After adding this code:
- The “Additional Information” tab will now show as “Product Specifications” on your product pages.
Let me know if you need further assistance!
Forum: Plugins
In reply to: [WooCommerce] How to remove the author section from productsAdd this CSS to hide the “by” text:
.entry-meta{display: none;}
Above Code Not Working Try this one
.entry-meta {
display: none !important;
}Forum: Plugins
In reply to: [WooCommerce] Add custom field in WooCommerce Checkout formHere’s the complete code you can add to your theme’s
functions.php
file or a custom plugin. This code will add the PAN Number field to the checkout page, save it with the order, display it in the admin panel, and include basic validation:<?php // Add PAN Number field to the WooCommerce checkout page function add_pan_number_checkout_field( $fields ) { $fields['billing']['billing_pan_number'] = array( 'type' => 'text', 'label' => __('PAN Number', 'woocommerce'), 'placeholder' => __('Enter your PAN number', 'woocommerce'), 'required' => true, 'class' => array('form-row-wide'), 'clear' => true, ); return $fields; } add_filter( 'woocommerce_checkout_fields', 'add_pan_number_checkout_field' ); // Save PAN Number to order meta function save_pan_number_field( $order_id ) { if ( isset( $_POST['billing_pan_number'] ) ) { update_post_meta( $order_id, '_billing_pan_number', sanitize_text_field( $_POST['billing_pan_number'] ) ); } } add_action( 'woocommerce_checkout_update_order_meta', 'save_pan_number_field' ); // Display PAN Number in the order admin page function display_pan_number_in_admin_order( $order ) { $pan_number = get_post_meta( $order->get_id(), '_billing_pan_number', true ); if ( $pan_number ) { echo '<p><strong>' . __('PAN Number:', 'woocommerce') . '</strong> ' . $pan_number . '</p>'; } } add_action( 'woocommerce_admin_order_data_after_billing_address', 'display_pan_number_in_admin_order', 10, 1 ); // Validate PAN Number format on checkout function validate_pan_number_field( $fields, $errors ) { if ( ! empty( $_POST['billing_pan_number'] ) && ! preg_match( '/^[A-Z]{5}[0-9]{4}[A-Z]{1}$/', $_POST['billing_pan_number'] ) ) { $errors->add( 'validation', __('Please enter a valid PAN Number.', 'woocommerce') ); } } add_action( 'woocommerce_checkout_process', 'validate_pan_number_field', 10, 2 );
Steps:
- Copy the code above.
- Go to Appearance > Theme Editor (or use an FTP client if you’re working with files directly).
- Open your theme’s
functions.php
file or create a custom plugin. - Paste the code at the end of the
functions.php
file or within your plugin file. - Save the changes.
This code does the following:
- Adds the PAN Number field to the checkout page.
- Saves the entered PAN Number with the order.
- Displays the PAN Number in the WooCommerce admin panel.
- Validates the PAN Number to ensure it follows the correct format.
Let me know if you need further help!
hi @viveke
In this, we have created a custom tab for ingredients using custom code. By mistake, the description tab got used instead. Now, the content of the ingredient tab needs to be changed, and the field for that tab should appear below the default description field, as shown in the screenshot you provided. Can you help me with this?
- This reply was modified 1 month, 1 week ago by Hardik Chosla.
Forum: Plugins
In reply to: [WooCommerce] product page layoutMost welcome ??
Forum: Plugins
In reply to: [WooCommerce] product page layoutYou do not necessarily need the paid version to customize the shop layout. The free version of WooCommerce is highly flexible and offers several options for basic customizations. However, the extent of customization depends on your specific needs and the tools you use:Free Options for Customizing the Shop Layout1. Customize with WordPress Customizer:Go to Appearance > Customize > WooCommerce.Adjust basic settings like product catalog layout, number of columns, and product display options.2. Page Builders:Use a free page builder like Elementor (free version) to customize WooCommerce pages.You can design individual pages, including the shop page, using WooCommerce widgets.3. Add Custom CSS:Add custom CSS to change the appearance.Go to Appearance > Customize > Additional CSS to apply your styles.4. Install Free Plugins:Plugins like WooCommerce Blocks or Product Add-Ons for WooCommerce offer enhanced customization features for free.—Paid Options for Advanced CustomizationsIf you want more advanced control over your shop layout, you might consider:1. Pro Page Builders:Elementor Pro or Divi Builder offers pre-designed WooCommerce templates and advanced customization options.2. Premium Themes:Many premium themes, like Astra Pro or Flatsome, provide detailed WooCommerce customization features.3. WooCommerce Add-ons:Extensions like WooCommerce StoreCustomizer or WooCommerce Product Table provide additional layout options.4. Custom Development:Hire a developer to customize your shop page according to your specific requirements.—If you’re just starting out, try experimenting with free tools to get familiar with the platform.
Forum: Plugins
In reply to: [WooCommerce] product page layoutHi @mindiapolis First using shop lentor free version after you need so going to paid version free version with using chat gpt may your solution all most resolved thanks
Forum: Plugins
In reply to: [WooCommerce] Products are missing on the shop pageYour issue with products disappearing on the shop page and reappearing after specific actions (changing the shop page, clearing the cache, and saving permalinks) could be caused by several underlying issues. Here’s how to investigate and resolve them:
1. Caching Issues
- Possible Cause: Caching plugins (or server-side caching by LiteSpeed) might be serving outdated content.
- Solution:
- Clear all caches from any caching plugins (e.g., LiteSpeed Cache, W3 Total Cache) and your server.
- Exclude WooCommerce pages (like the shop, cart, and checkout) from being cached.
- If you’re using LiteSpeed Cache, ensure the “Esi” (Edge Side Includes) settings are correctly configured.
2. Permalink Settings
- Possible Cause: A misconfiguration in permalink settings might be causing conflicts.
- Solution:
- Go to Settings > Permalinks in WordPress.
- Re-save the permalink structure (even if it appears correct).
- Test the site afterward.
3. Database Integrity
- Possible Cause: The WooCommerce database may have inconsistencies.
- Solution:
- Go to WooCommerce > Status > Tools.
- Use the following options:
- Update Database: To ensure the WooCommerce database matches the current plugin version.
- Clear Transients: To remove any cached queries that might cause issues.
- Regenerate Product Lookup Tables: To rebuild product visibility tables.
4. Plugin Conflicts
- Possible Cause: A conflicting plugin might interfere with WooCommerce or product visibility.
- Solution:
- Temporarily deactivate all plugins except WooCommerce.
- Check if the problem persists. If resolved, reactivate plugins one by one to identify the culprit.
5. Theme Conflicts
- Possible Cause: Customizations in your theme may interfere with WooCommerce templates.
- Solution:
- Switch to a default WordPress theme (e.g., Twenty Twenty-Three).
- Check if the issue persists. If resolved, review your theme’s WooCommerce templates.
6. Outdated PHP Version
- Possible Cause: You’re using PHP 7.4, which is outdated and no longer actively supported.
- Solution:
- Upgrade to PHP 8.0 or 8.1 (ensure compatibility by testing in a staging environment first).
7. Database Overhead
- Possible Cause: Large or corrupted database tables may impact WooCommerce functionality.
- Solution:
- Optimize your database using plugins like WP-Optimize.
- Backup your database before making changes.
8. WooCommerce Settings
- Possible Cause: Incorrect visibility settings for products.
- Solution:
- Check product visibility under Products > All Products.
- Ensure all products are set to “Published” and their visibility is set to “Shop and search results.”
9. Logs and Debugging
- Action:
- Enable debugging: Add the following lines to your
wp-config.php
file:define('WP_DEBUG', true); define('WP_DEBUG_LOG', true);
- Check the debug log file (
/wp-content/debug.log
) for errors when products disappear.
- Enable debugging: Add the following lines to your
10. External Object Cache
- Possible Cause: Your environment does not use external object caching.
- Solution:
- Implement an object caching solution like Redis or Memcached.
11. WooCommerce Compatibility
- Action:
- Ensure that all plugins, themes, and WooCommerce are updated to the latest versions.
- Check the WooCommerce > Status > Logs for any errors or warnings.
Let me know if you need assistance with any specific steps or further troubleshooting!
Forum: Developing with WordPress
In reply to: Current location sharing with the help of Google mapPlease Just Ask Chat GPT and get a Sample Code of any plugin you want
- This reply was modified 1 month, 2 weeks ago by Hardik Chosla.
- This reply was modified 1 month, 2 weeks ago by Hardik Chosla.
Forum: Developing with WordPress
In reply to: Current location sharing with the help of Google mapPlease take a backup and then proceed to try it.
To implement this functionality on a WordPress website where the user clicks a “Share Location” button to fetch their location, redirect to a form with the location pre-filled, and submit a booking, follow these steps:1. Understand the Key Requirements
- Geolocation API: To fetch the user’s location.
- Form Plugin: Use a WordPress form plugin like Contact Form 7, WPForms, or Gravity Forms to create the form.
- Redirection with Data: Pass the fetched location to the form via URL parameters or a custom solution.
2. Steps to ImplementStep 1: Enable Geolocation
Use the HTML5 Geolocation API to fetch the user’s location.
Add this script to the page where the “Share Location” button is located:
<script> function getLocationAndRedirect() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition( function (position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; const locationUrl =
/booking-form-page/?lat=${latitude}&lng=${longitude}
; window.location.href = locationUrl; }, function (error) { alert("Unable to fetch location. Please allow location access."); } ); } else { alert("Geolocation is not supported by your browser."); } } </script>Create a button that triggers this script:
<button onclick="getLocationAndRedirect()">Share Location</button>
Step 2: Pass Location to the Form
Modify the form on the booking page to accept the latitude and longitude from the URL and pre-fill fields.
For example, if you are using WPForms:
- Create a hidden field for
latitude
andlongitude
. - Add the following shortcode in the hidden fields’ default value:
<?php echo $_GET['lat']; ?> <?php echo $_GET['lng']; ?>
Alternatively, use JavaScript to dynamically populate the fields:
<script> const urlParams = new URLSearchParams(window.location.search); document.getElementById("latitude").value = urlParams.get("lat"); document.getElementById("longitude").value = urlParams.get("lng"); </script>
Step 3: Handle Form Submission
- When the form is submitted, ensure the location data is included.
- If you need to send the data via email, configure the form plugin’s settings to include the latitude and longitude fields in the email template.
3. Test the Functionality
- Visit the page with the “Share Location” button.
- Click the button and check if the user is redirected to the form with the location pre-filled.
- Submit the form and verify if the location data is correctly captured.
4. Plugins for Simplification
To make implementation easier, you can use:
- Geo My WP: A plugin for geolocation features in WordPress.
- WPForms + Geolocation Addon: Supports fetching and displaying user locations in forms.
5. Example for Reference
The described functionality is implemented on https://driveroadside.com/. You can inspect the website’s implementation for insights or inspiration.
Would you like me to provide sample code for specific plugins like WPForms or Gravity Forms?
Forum: WordPress Mobile App
In reply to: My header logo does not changeHi @soheepb
Contact your hosting provider company; this is a normal problem.
Forum: WordPress Mobile App
In reply to: My header logo does not changeHi, @soheepb
Please Check below URL its Normal cache issue Fixed If you’re still getting errors, let me know.
https://cludaze.com/shop/?nocache=1
https://cludaze.com/about-cludaze/?nocache=1
Best Regards
Hardik Chosla
- This reply was modified 1 month, 2 weeks ago by Hardik Chosla.
Forum: WordPress Mobile App
In reply to: year (2025) is still 2024 on mobilPlease check the below URL. Your issue is fixed It cache issues some time; take time. If you find still an error, let me know.
- Identify the Classes/IDs of Your Left and Right Columns: