I am using Magento 1.7.0.2 and have encountered a problem when deleting products. I create 20 products in a clean install of magento using the product import routine. The products where assigned to categories, and had images associated with them. The products displayed perfectly.
I then went in to the back end and deleted the products by selecting them from the product grid and choosing delete. This worked fine on the face of it and the products disappeared from the products grid.
I then attempted to re-import the products using the same format import file with some slightly different descriptions ect (SKU's were the same as previously) and I get an error saying that the SKU must be unique.
I have attempted creating a simple product in the back end with several of the now deleted SKU's and I get the same error - sku must be unique.
I have noticed that if I go into the category within the back end the deleted products are still listed against the category - I cant un-associate them as the products are not visible in the product list.
The products are not visible within the store,and I have tried the following:
refreshing the indexes and deleting the cash multiple times
Using the mage api to try deleting the phantom items - this just errors as stock item not found
Tried using the Mage and Soap API's to re-create the item, but get the same SKU must be unique error
Does any body have any ideas? I assume it should be possible to delete an item from the product list and re-create it?
If I cant fully delete the item is there a way for me to un-delete it? so I can then just update the profile?
I don't know why SKU still exists in your system after delete products. But you can solve your problem by execute SQL statement bellow:
DELETE * FROM catalog_product_entity WHERE sku='XXXX';
Related
When importing products with CSV searching for one of the products created by the import by name works, but searching for the SKU returns nothing. This is true both in admin and the storefront (using a search plugin that can search by SKU).
The created products are also visible at the top of the product list, and it lists the SKU correctly.
If a product is updated (going into edit or quick edit and just clicking update) it is then searchable by SKU both in admin and the store.
If a product is created manually and then updated with import this is not an issue.
I had the same problem, and symptoms after WooCommerce's built-in CSV import (wouldn't be found in search until I manually published or updated). It also affected Point of Sale for WooCommerce (could not search SKU to generate barcodes).
I found the solution was to rebuild the WooCommerce index, I went to WooCommerce Settings -> Search -> Index -> Rebuild, then Run the indexer. I believe the indexer is refreshed on each publish, and for some reason isn't refreshed on CSV import.
My admin searches and Point of Sale searches worked after that. This was on WooCommerce 4.0.1.
I also found searches had to have at least three SKU characters in the search field to return results.
I had this same problem and I imported products with ImportWP. Admin products search would not find anything by sku, ImportWP stopped working, WooCommerce import would complain about "No matching product exists to update.". This would get fixed by switching SKU from "123" to "1234" and back to "1234" somehow refreshing indexes. I looked in the database and in the table wc_product_meta_lookup the sku field was empty for my newly imported products. I ran the following query and now updates work again.
Update
wc_product_meta_lookup as C
inner join (
SELECT post_id, meta_value as sku FROM `postmeta` where meta_key = "_sku"
) as A on C.product_id = A.post_id
set C.sku = A.sku
This is on Wordpress 5.8.3 and WC 6.0.0 so looks like this bug can still occur.
I have a question about getting the of an attribute from a configurable-product. Cause we cleaned up our catalog a bit and delete some products including a few configurable products with their associated products, we can't send any emails with orders which have those deleted products associated. In general we show the attribute texts from the configurable product in the email. In my example I have a configurable product with the attribute size_attribute. The product in the order has for example the value 20x20cm.
Normally I get the attribute value like this:
../template/email/order/items/order/default.phtml
$_simple = Mage::getModel('catalog/product')->loadbyAttribute('sku',$_item->getSku());
$attr = $_simple->getResource()->getAttribute('size_attribute');
$attribute_code = Mage::getModel('eav/entity_attribute')->load($attr->getAttributeId())->getAttributeCode();
$attribute_text = $_simple->getAttributeText($attribute_code)
Now I have the problem that this line will fail cause the product does not exist anymore in our database:
Mage::getModel('catalog/product')->loadbyAttribute('sku',$_item->getSku())
I know that Magento copy all the information of each orderitem in a separate table which is not getting touched when deleting products from catalog.
Unfortunately the most solutions which I read across the internet start with the above line.
So is there a way to get the attribute text in another way?
There is no way to load a product which has been deleted, obviously.
Problem here was caused by wrong implementation in the first place, when dealing with orders, data should not be fetched from products, since the attribute values can change. Instead, new sales/quote_item attribute should be created where value from product will be copied during add-to-cart process (probably on sales_quote_item_set_product event).
Hope you can help me today. I imported about 85.000 Products from an SQL Source via Magmi. These Products are showing in the backend, they are "active", I updated the index (all of them), deleted the cache, made sure, that the products are in any category, made sure all mandatory fields are filled out, and they have a price. The products are not in Stock, but when I manually add a product thats not in stock, it is shown in the shop. And if i modify an imported product and increase the amount I have in stock, they are still not shown.
The products are all visible in catalog and in search, but I just cant find then clicking on the category in the menu. But if I search for a specific product I can find it.
Got anybody an idea?
Cheers
EDIT: Here I got a picture from Magmi import Process
And i only have one store, and one store view, that has default values
Following things you can check -
Check Visibility of the product.
Check if the product is assigned to a category.
Check if the product is assigned to a store view.
Check if the product is In Stock.
Check if the product has a qty assigned.
Click here for screenshot
As you can see in the SS above, only one of the products in my category is being shown on the view. BUT notice that it says there are 3 items in the category. Any thoughts on how to fix this would be greatly appreciated. And before you say it, I have already tried all the following standard fixes that can be found on google such as:
The products must be Visible in Catalog.
The products must be Enabled.
Product must have a stock Quantity.
The product must be set to In Stock. If the product is set not to
track stock, it still has to have a stock Quantity and be set to In
Stock.
The product must be assigned to the target Category.
If using multi-website mode (or if you imported the products through
Data Flow), the products must be assigned to the target Website.
You must refresh your Cache / Indices, just to make sure.
Make all category anchor(is_anchor=1) is yes ,from design of tab category
and set store id to all Products
And Re indexing all index from Admin>system>Index management
Products will also not show up if you upload new products and missed the 'URL Key' field. Filling in this field will add the product to the category page.
I am working with joomla 2.5 and virtuemart 2.0. When I tried to add related products it searched and showed many products but clicking on it doesn't saved any products as related. I checked table
#__virtuemart_product_relations
but it doesn't have any record, however I added some rows to it with product ids but still it didn't worked!
I solved it myself exploring all joomla virtuemart tables. I'm posting answer here may be it can help others. Actually the table to store related products is
#__virtuemart_product_customfields.
If you are not able to add related products from joomla administrator then insert rows to this table. You need to add only 3 fields i.e
1.virtuemart_product_id (enter here id of the product related for)
2.virtuemart_custom_id (enter here 1)
3.custom_value (product id of the related product).