Fake bot orders Woocommerce - php

I've installed Wordpress with Azera Shop theme. For development time, whole page is protected with .htpasswd, but - after about a week there was few orders from bots.
It could be easy thing if we have buying functionality (captcha), BUT - all prices are Null, so in that theme - all elements like "Add to cart" etc. are
just disabled.
Orders are without any products set, with random price, date and status.
What could be the problem? First thing that make me curious is overpassing through .htpasswd, next - how the orders are set? I guess that there wasn't a SQL injection used, but, maybe some of you have ever seen similar problem.
From that moment, I've installed anti-spam plugin from webvitaly and set all products status to "unavailable" and it's propably working.
Thanks

There could be Nth number of reason.
Could you please make true the Debug and Error, so that you could troubleshoot the issue from the Code view and see the Deprecated Code and Runtime Error as well. Also make sure you have Firewall is active.
This could be the basic things that bot bypass.

Related

How to resolve duplicate stock movement and order notifications in Woocommerce

I have been troubleshooting this issue for the last few weeks and have not been able to resolve.
We are experiencing the following (intermittently) when an order is placed by a customer.
Stock movement is duplicated
Order notes are duplicated
Email notifications are duplicated (to all parties)
Backorders are created (if the stock on hand is not sufficient to handle the duplicate qty). Example: initial inventory = 1 unit. 1 unit is purchased but the stock movement is duplicated which takes inventory to -1 causing a backorder, despite back orders being set to "do not allow".
Stack
Osmosis theme (+ child theme) - v4.3.6 (just updated to latest version)
Woocommerce v6.4.1
WordPress v5.9.3
PHP v7.4.28
Flywheel/5.1.0, nginx
The issue appears to have started a couple of weeks prior to a migration to a new host. A review of orders prior to the migration showed that order notes were already duplicating. After the move to the new host, it seems the stock movement started to duplicate (as well as order notification emails).
I reached out to Flywheel, they took a look but could not see anything suspicious-looking in the logs other than some fatal errors in the theme. I updated the theme. This resolved the fatal errors but not the order issue. Flywheel also adjusted the PHP memory, but no dice on the order issues. They have not provided much more help.
I updated a bunch of plugins at the same time as I migrated the site to Flywheel, so a possible conflict with a plugin may exist.
I tested in a staging environment with themes and plugins disabled but can not replicate.
It's hard to tell which plugin/theme might be causing a conflict on the staging site, as the issue is intermittent, so it's hard to narrow down which plugin, or if it is even a conflict. We also don't have the volume of orders going through the staging site, so hard to figure out. We would need to process several test orders over the course of a day. Which I guess we can do.
I did some googling and saw a bunch of posts on a similar issue relating to the payment gateway, and a possible conflict between using the hosted payment page or merchant payment page. I reached out to the developer (Windcave / Payment Express). They were not aware of any conflicts but sent me an older version of the plugin so I could roll it back. No dice. I also had the client reach out to Windcave directly to check their account was configured correctly and all appears to be as it should.
I've checked all Woocommerce settings, run all updates on plugins, reviewed the woocommerce status report, and checked logs.
I'm left with placing a bunch of test orders in the staging site over a few days until I can narrow down a possible plugin conflict, but wanted to fire this query through here first to see if anyone had come across something simiar and can help me resolve.
Would greatly appreciate some help.
Thanks
Josh
I think it can relate some of the WordPress hooks that are used for checkout page. You can check in this link "https://www.businessbloomer.com/woocommerce-visual-hook-guide-checkout-page/" for the hooks that can possible used on checkout page (or) before order create hooks. Try to compare these hooks names and if you used these hooks in child theme > functions.php or plugins. Some of hooks can trigger 2 or 3 times so it can possible be the problem.

Strange WooCommerce database related issue

I have a strange WooCommerce issue on one of my sites. It's a popular webshop with thousands of products. Most likely the issue is there for a long time but we just noticed it.
The problem: A lot of products are not showing up on the frontend. All of those are visible in the backend, all of them are live, all of those are in stock. So they should show up. Some of the store products are visible, some of them are not. There's no logic in this. BUT... if I just edit a missing product and just simply re-save it in the backend it shows up in the frontend right away.
Most likely the issue is related to the 2.x to 3.x database upgrade: "3.0.0 instroduces a new product visibility taxonomy; catalog, search, hidden, featured, outofstock are terms. These are set on upgrade and help filter products in the catalog during frontend queries."
My theory is that this database upgrade didn't finish at that time for some reason.
So the solution would be to run it again or to find an automatic way to emulate the "save" feature that I do manually if I edit and save a missing product in the backend. But the manual way is simply not an option when I have thousands of products.
I just want all available products to appear in the frontend too. Do you have any idea how can I solve this?
P.s: I have already tried switching back to a default theme and disabling every other plugin except WooCommerce. It's clearly a database related WooCommerce issue. And yes, I have the latest WP and the latest 3.x Woo. The PHP version is 7.2.
Thank you in advance!

Select product variations on order creation from backend - Woocommerce

I found a issue with woocommerce and variable products.
The products works good on the frontend but If I try to do the same from the backend, I can't selected the variations that I want.
I just can add a meta (It's an input text field) and this is very limited.
Can I fix this with a hook/function or plugin?
Really need help.
Thanks,
Your question is somewhat difficult to understand. Are you asking if you can change the combination of variations for a product on the backend after an order has been made?
I have only ever been able to do such a thing, in certain situations from within fulfillment software (ShipStation in my case), and even then it's no simple task. The reason likely being due to the fact that WooCommerce essentially locks the order after payment, as a failsafe to the customer probably.

Limit product price to not pass beneath zero when using product options with negative values

I'm trying to use Opencart as a system to buy from clients, not sell, which I know can be done. I'm not sure as to how much coding needs to be changed or added, but I don't think it's too much that has to be done. I have done a lot of research and have tried doing my own work to get this working as I described, but have had no luck. Not even on Opencart community forums.
I'm going to try to be as elaborate as I can into describing what I have done and what my problems are because I wish to get this resolved and working as planned.
Problem #1 - Negative Integers to Zero on Products (but not removing them from options)
Since I buy from Clients, I have added product options with negative integers which reflect the base price of a product (whether it's damaged, missing components, etc.) that we will pay for. There are options where it will put the Price to a negative value, which I do not want to happen. I want the price to not pass beneath $0.00 and to also make sure this value carries over to the shopping cart. I have done a lot of research on PHP coding to do this, and I'm not sure what to edit to make this happen or even if it will work as I desire or even if it's the correct way of doing it.
Problem #2 - Instead of a traditional Shopping Cart check out with payment options, provide only an invoice that is also e-mailed to both the client and myself.
Since we do not sell products but buy them, we don't pay for anything until we receive the clients products to verify it's condition.
I will provide any code necessary from core files of Opencart.

How do I add custom shipping and payment options to checkout in Magento?

Running Magento 1.5.1. My webstore contains a lot of products that get shipped direct from the manufacturer. The cost of shipping is extremely variable, and due to the number of products we carry, it is unfeasible to determine shipping costs for many items.
I would like to add a "request quote" option during checkout. The basic idea I have is this:
-Items without a weight or dimensions will be required to go through an RFQ (request for quote) process. During checkout, if the user has an item in their cart that requires an RFQ (because it doesn't have weight or dimensions defined), it will present a single option for shipping: "Request quote for shipping".
-The next step is the payment screen. Instead of actual payment options, a "pay invoice later" or "pay when quote is received" option will be present. The user will be forced to select this (or perhaps we could skip the payment screen altogether?).
This seems like it should be relatively easy to hack together, but I'm wondering if I'm going about this the wrong way? Is there an easier way to do this? My thought is to modify the checkout code to check for weight or dimensions, if not, only show that one shipping option (I'd probably re-purpose "free shipping" to be that option). Then, in the payment screen, check if free shipping is selected in the order, and then present the custom payment option (probably re-purpose cheque or money order option). From there we'd send them an official quote via Paypal or something similar.
Any thoughts? Thanks!!
I'll offer my normal advice: There are a ton of extensions to let this happen. My philosophy is to start looking at extensions before trying to code anything in magento. Is especially helpful when an upgrade breaks something; they'll usually fix upgrade problems that clearly affect their own extensions for free.
In your case there is a free custom shipping option extension I use for "Will Call" which you can use for "RFQ" purposes. I strongly advise against messing with payment modules. I have written 6 or more "payment" things in PHP for live sites and admin back-end use. Until you really understand Magento, you are wasting your time and money writing code. If your question is to get a website working so you can make money, go buy extensions that get the job done...
To go on about writing code, I hand rolled some code in the contact form to add google re-capcha as well as to have customers select from existing product attributes (vehicle year, make, model). I was eventually able to figure out how to have these reflect in the emails we get from the contact form, however, there is no database persistence, which is the proper solution. Further, mucking about in the code quickly and easily breaks Magento in unexpected and surprising ways, hence why my normal Magento reply on here is to strongly urge people to buy extensions. If you're asking the kind of questions like I would ask, you don't know enough to make a professional extension... buy a few proper extensions, analyze them, spend lots of time trying to figure it out.
Any more there are plenty of extensions competing to do the same tasks, so there should be something already working to do what you want.

Categories