Magento urlkey field - how can I increase field length? - magento

I am trying to fix a bug in magento with duplicate url keys. The product names are unique but because the urlkey field is cutting off 30 characters before product name duplicates are occuring and the url rewrite table just grows with each reindex.
this link appeared to offer an elegant solution
http://www.atwix.com/magento/duplicated-product-url-keys-in-community-edition/
BUT I don't think it will work as there will be no space to add the sku to the urlkey.
So my question is, is it possible to increase the length of the urlkey field please?
thanks

magento system has cached the database's table filed length,
so clear magento cache.
click Flush Magento Cache button
http://www.magentocommerce.com/knowledge-base/entry/cache-storage-management

Related

Magento 2 different prices on page product and search results

For some reason I have for some,different prices on page product and search results.
The correct one is on the product page.
For example product page is 1.60 and search result page 1.20.
What I have done:
I have Magento 2.4.4
Change the product price in admin,I check the catalog_product_entity_decimal table to see the changes and it is update, then I see that I have to reindex the catalog_product_price index.
Once that is done the price is updated in the catalog_product_index_price table, but when I check the _replica one (catalog_product_index_price_replica) it is not updated.
This only happends to some products.Not sure what is happening
Because this is a search result page, I am using Amasty Elastic Search
I figured it out,it seems that in my case , when I updated a specific third party module, there was some sort of update on the table catalog_product_index_price_tmp.
I deleted the table and created it manually, bad mistake, this table is used for updating the catalog product index (not sure if others), it stores the information on that table and then copies its values to the _replica one, this table is always emptied when reindexing the price.
Solution was to delele the table
DROP TABLE `catalog_product_index_price_tmp`;
And then run the setup:upgrade , this table is created by magentos db_schema.xml in this file vendor/magento/module-catalog/etc/db_schema.xml
Hope this helps others

Magento with Magmi - Remove unwanted numbers on product update

After updating our 6k+ products in Magento 1.7 using CSV import with Magmi the url_keys for all product get 4-digit numbers as suffix.
e.g. before it was www.domain.com/productname.html
after update it's www.dmain.com/productname-5363.html
This happens although the url_key in CSV is set as "productname"
Only way to fix it is to clear all urls from database and reindex - but after next import it's happening again.
Has anyone an idea how to prevent this on import?
The number suffix will be added when one or more url's get the same url. Since that is not possible Magento adds the suffix. Do you know if this occurs?
You try to make product names unique before processing. For example adding a color or a model or something else from your datasource
Or you could automate the step of emptying and reindexing the core_resource table (also take a look at the Magmi plugin On the fly indexer)

why magento using other product's url key for url rewrite

I am using magento 1.7. i am faceing strange problem. magento making duplicate product url with random number with wrong url key please my attached screenshot
I also empty table rewrite_urls and reindex urls but still i am getting wrong urls. please help me to solve this problem. if you are unable to view images in question then please click on links duplicate product urls and Product in admin panel
,
Let me make understand u with example
Like i have one product named "example" and url key is "example" Url will be
www.example.com/example
and now i have created new product "xyz and url key is "xyz" and url should be
www.example.com/xyz
but magento generating url
www.example.com/example-123
This seems to be a bug in 1.7.
If you have multiple simple products with the same url key as the configurable product (e.g. all names are the same), than magento always creates a new url rewrite on every index process.
Example:
First index:
myproducturl (config product)
myproducturl-id (simple product with its id appended, so far so good)
Second index:
myproducturl (config product)
myproducturl-randomnumber (simple product with random number, BAD)
myproducturl-id --> myproducturl-randomnumber (rewrite to the new url)
And on every new index process the last step will be repeated, so always a new random url key is generated.
If magento would check, that a url key with the id for that product already exists, this should be no problem.
After a few months, you will have a really big url_rewrite table, because nothing will be deleted and on every run, at least 1 record for every product with the same url key will be created.
I was able to eliminate the extra numbers at the end of the URLs by truncating the table "core_url_rewrites" (I made sure to make copy first) then reindexed it.

magento, error when reindexing Catalog URL Rewrites

All this afte rupgrading from 1.4.1
I get a quite specific error message:
Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'product/19-1-2' for key 'UNQ_CORE_URL_REWRITE_ID_PATH_IS_SYSTEM_STORE_ID'' in /home/in-due/domains/sb2.in-due.de/public_html/hochzeitsshop/lib/Zend/Db/Statement/Pdo.php:234
problem is, that I don't know how to find the entry, that is making trouble. neither in the backend (catalog|URL Rewrite Management) nor in the db itself (table core_url_rewrite) is an entry
product/19-1-2
any help is appreciated,
PAT ERLER
#perler, here is a MySQL query to detect duplicate SKUs. Remember, if you prefixed your tables, change catalog_product_entity accordingly!
SELECT
DISTINCT(`sku`) as `sku`,
COUNT(`sku`) as `skuCount`,
entity_id
FROM
catalog_product_entity
GROUP BY
`sku`
HAVING
`skuCount` > 1;
The duplicate entry is for a key made up from 3 fields, id_path, is_system and store_id, in theory you should be able to use URL Rewrite Management, search for an id_path of product/19 and this is your 'troublesome' field. Deleting that value may solve the issue (but I'd recommend making a backup first, and trying it in a dev environment first).
If you are still in development and haven't used any custom rewrites you could just empty the core_url_rewrite table and re-index to regenerate all the fields. If it is a live site this would be a little more troublesome, it would mean losing a bit of SEO juice if you have renamed products, since you would lose the rewrite.
Ok, the problem was a duplicate SKU. You shouldn't be able to enter one, but what happened (in magento 1.4.0.1) was, that the client entered a very long SKU which got shortened when saving the product. the shortened part was then identically to another SKU.
so, if yourself have this problem, check you database for duplicate SKUs (can someone post an SQL Query to do this?)

category<->product relations

I have this problem with magento 1.4.1.1, when I delete a product it won't decrease the amount of products in the category tree view. I found out that magento is not deleting the entry from the "catalog_category_product" table.
Can anyone think of a reason why this is happening? I'm trying to search the core where this function is being called (removing that row from the db) but I can't find it.
Help would be highly appreciated.
Refresh the Index (System > Index Management) and all should be set

Resources