preetindersodhi
Forum Replies Created
-
The system works fine, if cash on delivery method is available, it shows a notice & order does not get placed if a shipping method is not available.
“No shipping method has been selected. Please double check your address, or contact us if you need any help.”
But when I select PayPal, and click the Paypal Button, it takes me to Paypal login page.
I have the option “Validate Checkout Fields” turned on, but apparently it doesn’t mind if there is no shipping method available.
https://snipboard.io/Lgxu5h.jpg
The functions.php code you provided solves this issue, but it would be better to include this code in the plugin itself and give an option for it.
If the first name field is empty, it gives an error but doesn’t care for shipping methods.
A notice is displayed in the PayPal popup “XXX doesn’t ship to this location. Please use a different address.” but the Pay button is still there.
- This reply was modified 1 year, 2 months ago by preetindersodhi.
- This reply was modified 1 year, 2 months ago by preetindersodhi.
An option to enable/disable this would be good.
Show PayPal button even if no shipping method is available: Yes/No.
- This reply was modified 1 year, 2 months ago by preetindersodhi.
functions.php solution is quicker & better.
Shouldn’t PayPal checkout be disabled by default if no shipping method is available? One shouldn’t have to add this extra code.
Thanks a lot, it works.
Another solution: copy templates/checkout/payment.php in the theme folder & modify the code as per following. Thanks to chatgpt.
function has_available_shipping_methods_for_address() { if (!function_exists('WC') || !WC()->cart) { return false; } // Update the customer's shipping address from the checkout form to the current session. WC()->customer->set_props(array( 'shipping_country' => WC()->checkout->get_value('shipping_country'), 'shipping_state' => WC()->checkout->get_value('shipping_state'), 'shipping_postcode' => WC()->checkout->get_value('shipping_postcode'), 'shipping_city' => WC()->checkout->get_value('shipping_city'), 'shipping_address_1' => WC()->checkout->get_value('shipping_address_1'), 'shipping_address_2' => WC()->checkout->get_value('shipping_address_2') )); WC()->customer->save(); // Recalculate the shipping after updating the address. WC()->cart->calculate_shipping(); $packages = WC()->shipping->get_packages(); foreach ($packages as $i => $package) { if (!isset($package['rates']) || empty($package['rates'])) { return false; // No shipping methods available for the address } } return true; // Shipping methods are available for the address } <style>#payment.no-shipping {display:none;}</style> <div id="payment" class="woocommerce-checkout-payment<?php if (has_available_shipping_methods_for_address()) {echo ' shipping-available ';} else {echo ' no-shipping ';} ?>">
Forum: Plugins
In reply to: [WP Super Cache] Home page cached wronglyI’ve also faced similar issue on two of my websites. Wrong content cached for homepage. I was getting random author archives on homepage. On that site I was using Redirection plugin, and there were just too many regex based redirections. I disabled the plugin, haven’t faced the issue since.
On the other site, I see search results being cached for homepage, don’t know how it could happen. The homepage had this heading: “Search results > captcha”. When I clear cache and do a search for “captcha” I don’t face any such issue.
@donncha
Maybe cache the homepage only when URL value is exactly same as home URL and there is no GET/Post any extra headers or anything. The issue is probably caused by bad bots, making strange requests all the time.Forum: Fixing WordPress
In reply to: contact form 7Your issue is related to Mod Security rules of your host. Your IP must be blacklisted. Check here: https://whatismyipaddress.com/blacklist-check
My IP is often listed and I have no clue why. Could be related to my ISP, but people all over the world have this issue.
I’m using CF7 on more than 300 websites and have been facing this issue for more than a year.
More info: https://www.geminigeeks.com/bluehost-blocking-contact-form-7-submissions-409-conflict-error/
I request the plugin author to please fix the issue by simply renaming file/folder/any API paths, and make sure “contact” is replaced with “kontact” or something else. Bluehost refuses to do anything about the issue.
Forum: Plugins
In reply to: [Contact Form 7] 409 ConflictYour issue is related to Mod Security rules of your Host. Your IP must be blacklisted. Check here: https://whatismyipaddress.com/blacklist-check
My IP is often listed and I have no clue why. Could be related to my ISP, but people all over the world have this issue.
I’m using CF7 on more than 300 websites and have been facing this issue for more than a year.
More info about the issue:
https://www.geminigeeks.com/bluehost-blocking-contact-form-7-submissions-409-conflict-error/I request the plugin author to please fix the issue by simply renaming file/folder/any API paths, and make sure “contact” is replaced with “kontact” or something else. Bluehost refuses to do anything about the issue.
Forum: Plugins
In reply to: [Contact Form 7] 409 Conflict Error – humans_21909=1Talking to Bluehost, they are not being helpful, asking me to contact my ISP. I’m trying to get them to review their security rules.
This is what they said:
I have reviewed your issue, upon my review I found that the issue occurs when its been accessed by dynamic IP address, I would suggest you to contact ISP and ask them to assign static IP to your network, If your IP is frequently switching to different IPs and it happens to load 409 error, please check if the issue persists with static IP address. Our shared servers are having more security restrictions compared to our VPS servers and it may not occur on VPS account, since the remote access is typically less secure on dynamic IP address.
I understand you would like to explain your issue with the remote view, Unfortunately we are not authorized to use TeamViewer from our systems. However we can get back to you via call if you still wish to investigate further on this issue, please let us know the good phone number and time(with time zone) to get back to you.
Forum: Plugins
In reply to: [Contact Form 7] 409 Conflict Error – humans_21909=1The block the URLs with the word contact. They blocked a CSS file and an image file on my site, the image had nothing to with the plugin. It was a contact icon.
Most likely the reason is Bluehost. They close comments after some days on all of the wordpress sites they host. They probably do it to reduce load on their servers. Since there are a lot of spam comments. Bluehost, JustHost, Hostgator…all owned by same parent company.
This issue does not happen on sites hosted at Bluehost VPS.
Forum: Plugins
In reply to: [Contact Form 7] 409 Conflict Error – humans_21909=1Update:
I checked log of some of my websites and found out that the 409 error is not limited to Contact Form 7. I’m quite sure it is hosting related issue.See my post for details: https://www.geminigeeks.com/bluehost-blocking-contact-form-7-submissions-409-conflict-error/
Forum: Plugins
In reply to: [Contact Form 7] 409 Conflict Error – humans_21909=1@cag8f No. I still face this problem sometimes. It happens on some IP addresses. I talked to Bluehost last time, they said my IP was blocked due to spam related activities. My internet connection has dynamic IP, someone else might have been spamming.
Bluehost and Hostgator, both owned by one company. I face this problem only on Bluehost. No issues on Bluehost VPS or iWeb.
- This reply was modified 5 years, 6 months ago by preetindersodhi.
Forum: Plugins
In reply to: [Contact Form 7] 409 Conflict Error – humans_21909=1Bluehost. They seem to be blocking any URL with the keyword “contact”. On one of the website, a simple “contact.png” icon fails to load, but it loads when I open the image URL directly.
They must have a system to stop contact form related spam, and are accidentally blocking genuine requests.
See screenshot: https://oi63.tinypic.com/e6of45.jpg
Forum: Plugins
In reply to: [Contact Form 7] Conflict CSS and JS error in console(409)Are you able to submit the form when logged in?
Did you try submitting using different internet connection?
On my website the form works if I’m logged in or if I use a different internet connection.
Forum: Plugins
In reply to: [Contact Form 7] 409 Conflict Error – humans_21909=1Could the problem be related to hosting? The form works fine on my other website hosted on another host. What hosting setting should I look for?
I can submit form without any error when I’m logged in.