cassiocesio
Forum Replies Created
-
Diana, I think I failed in communication and you didn’t understand the problem that is happening.
I put the alert just for you see that the filter is only called when the checkout page is updated, when we change the postcode and press the next button to the next step the filter never called again. So the shipping price is not updated.
The alert will show that it doesn’t enter the filter when you change the step. My question is not about using filters, forget the return, just make the test to realize that it doesn’t run the filter when changing step.
Hi Diana, sorry but I know how to use a filter, that’s not the problem (this function is complete on my site and it works). To be able to perform the test and check the problem you can put an alert inside the function.
You will notice from the alert that the filter only runs when the page refreshes. Therefore, if the user updates the zip code in the first step, the filter will no longer be called. You can do the test this way:
add_filter( 'woocommerce_cart_shipping_packages', array($this, 'filter_woocommerce_cart_shipping_packages'), 10); function filter_woocommerce_cart_shipping_packages() { // Modify here the $shipping_packages variable in some way and then return it. // Don't remove the return statement. Very important $message = "test"; echo "<script type='text/javascript'>alert('$message');</script>"; return ""; }
In order to work, the filter would need to be called again when the user modified the cep or when he clicked next. I believe that would solve the problem.
Yes, I turned everything off. I know that the plugin does not modify the fields and that it only displays the data, but when you use the same filter by calling an empty function the checkout hangs and no longer updates the data.
You can test anywhere in your code:
add_filter( ‘woocommerce_cart_shipping_packages’,’filter_woocommerce_cart_shipping_packages’);
public function filter_woocommerce_cart_shipping_packages(){}
Somehow updating the data is compromised.
Forum: Plugins
In reply to: [Claudio Sanches - Checkout Cielo for WooCommerce] N?o redireciona para cieloEu passei por um problema parecido com o plugin de cache “WP Fastest Cache”.
O cliente finalizava a compra e era redirecionado para a pagina do Checkout (ou seja, n?o saia da pagina de checkout). Só descobri esse problema porque uma cliente relatou que o site havia cobrado duas vezes.
Na verdade quando redirecionou para a pagina de checkout ela colocou os dados do cart?o novamente, porque n?o entendeu que havia finalizado.
Forum: Plugins
In reply to: [YITH WooCommerce Ajax Search] Plugin error with special charactersRenan, i’m with the same problem. Did you resolve the problem?