Strange WooCommerce database related issue - php

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!

Related

Woocommerce product type conflict between BO and PHP

I updated WP to 6.0 and Woocommerce to 6.6.1 this morning, i initially noticed a lot of problems, after debugging for hours, i noticed that the main issue was that all products are retrieved as Simple product when i var_dump() in Front, but when i check the same product in BO, it shows as Variable Product, anyone have an idea why? if not, am trying to at least check in the Database to make sure it is a Variable product and not simple, but i don't know how Woocommerce stores this information.
Thanks

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.

Magento Search Not Finding Newly Created Products

Our server was recently moved and rebuilt (and that's when the issue began).
The search does find products, but only those that have been created (or been enabled) before the transfer. When I search in a category in the catalog, I can find the newly created/uploaded product. It just cannot seem to be accessed by Search.
We are using Magento 1.8.1 and the SPHINX extension (supported by mirasvit).
It seems like your product's Visibility is disabled. Check your Visibility of your product. Admin-> catalog -> Select that Product -> General -> Visibility
set value to Catalog, search.
If visibility is set to catalog/search, please check the product is enabled or disabled. Wile importing or exporting the products, it seems to change the status of the products.
I also think you can try by checking product visibility to see whether it has value Catalog, Search or not.
After backing up our server from a previous date, I was able to locate and eliminate the issue. It was regarding the cache that was created from the product, and it was being misplaced. Took hours of searching, but everything is working beautifully now. =)
Thank you all for trying to help.

Magento Customization Issues

I am building a custom tool where the user can play around with the product (customize parts and add colors) and then go ahead and buy. I have so far built this in PHP but would like to integrate it with my Magento store. Is there a way I can connect this to Magento so that the product can be passed through Add to Cart etc?
Thanks.
Magento already has a support for this.
Check the configurable products, or the Custom options tab in the product admin edit page. You can also use bundle products.
If none of these fit your needs then you may want to rephrase your question and explain what exactly do you need.

How to hide products without stock from layered navigation

I have set all options in the Magento catalog configuration to hide out of stock products. This works fine, except for the layered navigation. I got a product attribute for the size of a product. So for example, I got 15 products with size 38 and 7 of them are out of stock. Still, in the layered navigation it says there are 15 products with size 38. Also when clicking the filter, all 15 products appear.
I found a lot of similar questions, only all are meant for Magento versions 1.3 and older (since it seems older Magento versions didn't had the option to hide out of stock products at all).
Could it be I missed a setting in the backend, on the attribute or stock configuration which causes this conflict?
Since I thought it was kind of a Magento bug, I also searched trough the core code of the layered navigation, but couldn't find a quick solution.
Anyone who can help me out?
Edit: Forgot to mention the products are configurable products. It looks like it only looks at the main product.
I know it's little bit of topic, but have you considered using SCP module?
http://www.magentocommerce.com/magento-connect/simple-configurable-products.html

Categories