Home Forums WoodMart support forum Estimated delivery not showing up

Estimated delivery not showing up

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #615655

    gnl-commerce.nl
    Participant

    Hi there,

    I enabled Estimated delivery in theme settings, i also configured the zones already and i setup the estimated delivery so it should show the estimated delivery on the zones on specific product categories. (I added screenshots)

    I also added the estimated delivery widget on single product page.

    Unfortunately i don’t see the estimated delivery on product archive on the category pages, the single product page, minicart, and the other pages.

    Can you help me fix this?

    Attachments:
    You must be logged in to view attached files.
    #615714

    Artem Temos
    Keymaster
    Xtemos team

    Hello,

    Firstly, you need to select a right shipping method and zone on the cart page. But this method is not selected and is even hidden with some of the installed plugins https://monosnap.com/file/RbHS7o8mXvWiAzPPZYdW144pZ0BOAY

    Kind Regards

    #615723

    gnl-commerce.nl
    Participant

    I already checked, but its not hidden. The shipping options are just setup like this:

    Free shipping if you pickup the goods yourself, and otherwise standard shipping cost?

    I checked all plugins but its not being hidden.

    #615724

    gnl-commerce.nl
    Participant

    And also this also doesn’t explain why estimated delivery time is not showing in product archive and minicart?

    #615729

    Artem Temos
    Keymaster
    Xtemos team

    Could you please temporarily disable all plugins that are not related to our theme?

    #615735

    gnl-commerce.nl
    Participant

    I just did, i enabled everything again. Still not showing up

    #615737

    gnl-commerce.nl
    Participant

    i have to backup now site crashed randomly because of disabling plugins

    #615747

    gnl-commerce.nl
    Participant

    Site is online again, so disabling plugins didnt help at all fix the problem

    #615873

    Artem Temos
    Keymaster
    Xtemos team

    In this case, you need to create a staging development copy of your website. There, you will be able to do such kind of experiments without any harm to your production website.

    Kind Regards

    #615994

    gnl-commerce.nl
    Participant

    I just made a staging, login is the same.

    #616157

    Artem Temos
    Keymaster
    Xtemos team

    As we can see, the shipping zone you created the Estimate date rule for is hidden in the child theme. Once we switch to the parent theme, it is possible to select this shipping zone and the Estimated delivery date is shown correctly. Check the following screenshots.

    https://monosnap.com/file/ypHanGu1lTC9WCqPA4ffECsUv1u7gJ
    https://monosnap.com/file/uR4H86ycyrjPMyytu3nZQkh5Aa2lsC

    #616193

    gnl-commerce.nl
    Participant

    Ok i think i see the issue, i have made a code in functions.php. I removed the piece of code underneath here but i really need this code.

    function custom_shipping_methods($rates, $package) {
    // Verzendklasse IDs
    $small_package_class_id = 74; // Verzendklasse ID voor kleine pakketten
    $delivery_and_install_class_id = 71; // Verzendklasse ID voor levering plus montage

    // Controleer of er producten in de bestelling zitten met de verzendklasse
    $has_small_package = false;
    $has_delivery_and_install = false;
    $small_package_total = 0;
    $delivery_and_install_total = 0;
    $cart_total = 0;

    foreach (WC()->cart->get_cart() as $cart_item) {
    if ($cart_item[‘data’]->get_shipping_class_id() == $small_package_class_id) {
    $has_small_package = true;
    $small_package_total += $cart_item[‘line_total’];
    }
    if ($cart_item[‘data’]->get_shipping_class_id() == $delivery_and_install_class_id) {
    $has_delivery_and_install = true;
    $delivery_and_install_total += $cart_item[‘line_total’];
    }
    $cart_total += $cart_item[‘line_total’];
    }

    // Aangepaste logica voor kleine pakketten
    if ($has_small_package) {
    if ($cart_total >= 500) {
    foreach ($rates as $rate_key => $rate) {
    if (in_array($rate->get_method_id(), [‘flat_rate’, ‘standard_rate’, ‘standard_rate_delivery’])) {
    unset($rates[$rate_key]);
    }
    }
    $rates[‘free_shipping’] = new WC_Shipping_Rate(
    ‘free_shipping’,
    __(‘Gratis verzending’),
    0,
    [],
    ‘free_shipping’
    );
    } else {
    foreach ($rates as $rate_key => $rate) {
    if (in_array($rate->get_method_id(), [‘flat_rate’, ‘free_shipping’, ‘standard_rate_delivery’])) {
    unset($rates[$rate_key]);
    }
    }
    $rates[‘standard_rate’] = new WC_Shipping_Rate(
    ‘standard_rate’,
    __(‘Standaard tarief’),
    6.75,
    [],
    ‘standard_rate’
    );
    }
    }

    // Aangepaste logica voor levering plus montage
    if ($has_delivery_and_install) {
    if ($delivery_and_install_total < 500 && !$has_small_package) {
    $rates[‘standard_rate_delivery’] = new WC_Shipping_Rate(
    ‘standard_rate_delivery’,
    __(‘Standaard tarief’),
    6.75,
    [],
    ‘standard_rate_delivery’
    );
    }

    $rates[‘delivery_install’] = new WC_Shipping_Rate(
    ‘delivery_install’,
    __(‘Levering plus montage’),
    75,
    [],
    ‘delivery_install’
    );

    if ($cart_total >= 500) {
    foreach ($rates as $rate_key => $rate) {
    if ($rate->get_method_id() == ‘standard_rate’) {
    unset($rates[$rate_key]);
    }
    }
    }
    }

    return $rates;
    }
    add_filter(‘woocommerce_package_rates’, ‘custom_shipping_methods’, 10, 2);

    #616196

    gnl-commerce.nl
    Participant

    The problem seems to be that the code added in function.php via the woocommerce_package_rates filter can disable other WooCommerce features, which can limit the translation. This may happen because it overrides the shipping methods or because the theme (WoodMart) may rely on certain shipping methods to display shipping costs.

    #616197

    gnl-commerce.nl
    Participant

    Can you tell me how i can fix this?

    #616260

    Artem Temos
    Keymaster
    Xtemos team

    Hello,

    Sorry, but we don’t know how this code is supposed to work and how to fix it. Fixing additional code customizations like that is out of our theme support scope.

    Kind Regards

    #616497

    gnl-commerce.nl
    Participant

    Ok thank you!

Viewing 16 posts - 1 through 16 (of 16 total)

The topic ‘Estimated delivery not showing up’ is closed to new replies.