• Resolved angelsmoto

    (@angelsmoto)


    Hi,

    If by chance a customer does not inform the zip code in the shopping cart and complete the purchase directly, the Fluid plugin does not give the option to calculate the shipment. It does not have a field to inform the zip code or address and does not give delivery options. It only shows the delivery options if the customer has informed the zip code at the cart step, but this ends up being bad because if the customer does not know how to buy or perhaps is not interested in knowing the shipping cost and just wants to buy, the checkout does not give the opportunity to offer deliveries, it seems to me that it limits. Anyone know how to solve?

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @angelsmoto,

    We have another user report a similar problem. This happens because some of the address fields do not trigger a checkout update which is necessary to update the shipping methods section with the available options.

    You can use the code snippet below to fix this problem:

    /**
     * Change shipping field attributes to trigger checkout update.
     */
    function fluidcheckout_change_shipping_address_fields_args( $fields ) {
    	if ( array_key_exists( 'shipping_state', $fields ) ) { $fields[ 'shipping_state' ][ 'class' ][] = 'update_totals_on_change'; }
    	if ( array_key_exists( 'shipping_city', $fields ) ) { $fields[ 'shipping_city' ][ 'class' ][] = 'update_totals_on_change'; }
    	if ( array_key_exists( 'shipping_postcode', $fields ) ) { $fields[ 'shipping_postcode' ][ 'class' ][] = 'update_totals_on_change'; }
    	return $fields;
    }
    add_filter( 'woocommerce_shipping_fields', 'fluidcheckout_change_shipping_address_fields_args', 300 );

    If you are unsure about how to add the code snippet, check our article “How to safely add code snippets to your WooCommerce website” in the link below:
    https://support.fluidcheckout.com/portal/en/kb/articles/how-to-add-code-snippets

    I’m closing this topic for now. If you still experience this issue please reply to re-open it so we can investigate further.

    Best,
    Diego

    Thread Starter angelsmoto

    (@angelsmoto)

    Thank you very much for the soon return. This shows how dedicated you are to your projects.

    I added the code to my php but it still didn’t work. See the image, it does not enable any shipping calculation, only the option “Removal in store” is selected

    https://ibb.co/cw9LSHt

    Thread Starter angelsmoto

    (@angelsmoto)

    I don’t know if I expressed myself well, and if the code solves something else, but I’d like to try to explain it better. If the customer does not put the zip code in the cart and when going to checkout no field appears to calculate the delivery value, it only appears the fixed option of a modality that does not need to inform the zip code for delivery. And in fact, a field should appear to calculate the value and appear the options, or, the delivery method should appear below the delivery address, being calculated by the data informed in the “delivery” field. The field that opts for delivery should be after the delivery and billing address field.

    Thread Starter angelsmoto

    (@angelsmoto)

    In the previous image I added the code in php, now I tried to add the code with your plugin suggestion, but nothing happens. Did I enter the code correctly? Because I didn’t understand the part that says:Also, note that the return statement might be different depending on the action or filter hook you are using. If your code snippet uses a filter hook, you’ll need to return the value of the first parameter. What should I put in place of “return”?

    https://ibb.co/3v9qbHr
    https://ibb.co/hysZmP0

    • This reply was modified 3 years, 2 months ago by angelsmoto.
    Thread Starter angelsmoto

    (@angelsmoto)

    It worked, it was my mistake in the position of the second code informed in the text that speaks of the plugin. It was perfect, I’m very happy. The walkthrough was great. Thanks

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @angelsmoto,

    Great ?? I’m happy that this helped ??

    Best,
    Diego

    Thread Starter angelsmoto

    (@angelsmoto)

    Hello, how is everything? it stopped working. The code was working but I don’t know when updating your plugin it stopped working. Is there any connection with your last update?

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @angelsmoto,

    The code snippet provided still works on the latest two versions of the plugin 1.5.0 and 1.5.1.

    1. Could you specify exactly what is not working anymore?

    2. Could you provide a link to a staging/test site where the problem happens so we can check on the website?

    Best,
    Diego

    Thread Starter angelsmoto

    (@angelsmoto)

    When my customer chooses a product, adds the item to the cart, but not by chance he forgets or doesn’t want to calculate the shipping in the cart, he clicks on checkout and goes to checkout. When he is at checkout, the checkout does not have a field to calculate the delivery amount. When I used your code, first came the delivery address and then enabled the field to select the type of delivery. And that’s what stopped working. Now it appears again first to choose the delivery method and then to put the delivery address and consequently it does not calculate because the field to choose the type of shipment is before. That is, the field to put the address must be before the field to choose the shipping method.

    You can test by making a purchase with this product and using this link: https://www.angelsmoto.com.br/loja/manopla-spencer-universal-marte-cromada/

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @angelsmoto,

    I see. Thanks for the explanation.

    I think what is happening is that WooCommerce is selecting the first available shipping method by default, and, since the first and only option is a local pickup method, Fluid Checkout then hides the shipping address section.

    So we have two problems…

    1. Check if the following code snippet is active/running on your website. This will move the shipping methods below the shipping address, even when a local pickup method is available.

    /**
     * Move the shipping methods to after the shipping address.
     */
    function fluidcheckout_show_shipping_methods_after_address() {
    	// Bail if Fluid Checkout steps class is not available
    	if ( ! class_exists( 'FluidCheckout_Steps' ) ) { return; }
    	
    	remove_action( 'fc_output_step_shipping', array( FluidCheckout_Steps::instance(), 'output_substep_shipping_method' ), 10 );
    	remove_action( 'fc_output_step_shipping', array( FluidCheckout_Steps::instance(), 'output_substep_shipping_address' ), 20 );
    	add_action( 'fc_output_step_shipping', array( FluidCheckout_Steps::instance(), 'output_substep_shipping_address' ), 10 );
    	add_action( 'fc_output_step_shipping', array( FluidCheckout_Steps::instance(), 'output_substep_shipping_method' ), 20 );
    }
    add_filter( 'wp', 'fluidcheckout_show_shipping_methods_after_address', 200 );

    2. The shipping address section is not available to be changed.

    I could not reproduce this problem in my development environment.

    What is the plugin that you are using to hide the other shipping methods that depend on the shipping address?

    You may try to prevent WooCommerce from selecting the first shipping method available from the list (in that case the only one) with the following code snippet, it might allow the shipping address to be displayed and the user to enter the address at checkout.

    /**
     * Disable autoselect shipping method.
     */
    add_filter( 'woocommerce_shipping_chosen_method', '__return_false', 10, 3 );

    If you are unsure about how to add the code snippet, check our article:
    How to safely add code snippets to your WooCommerce website

    Best,
    Diego

    Thread Starter angelsmoto

    (@angelsmoto)

    I followed all the steps and still nothing happens.

    When I used your first code, it worked. The billing and shipping address field comes before the shipping method. But when I updated your theme, it didn’t work anymore.

    I tested the two codes informed in your last contact. No fields moved ??

    Plugin Author Diego Versiani

    (@diegoversiani)

    Hi @angelsmoto,

    That is odd. This is not something we recognize would stop working because of the changes in the plugin from version 1.5.0, and I have tested these code snippets before sending them to you.

    Is it possible for you to revert the plugin to the previous version 1.4.3 and see if it works again?

    You can download the previous version from the link below:
    https://downloads.www.ads-software.com/plugin/fluid-checkout.1.4.3.zip

    Best,
    Diego

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Delivery Options’ is closed to new replies.