I need to remove all special prices in my magento stores and I can't understand a thing about magento's database structure when I look into phpMyAdmin.
Can someone guide me?
Thx.
There's an easy way around to remove all the special prices from all products. You don't actually need to run any script. Just go to the administration -> catalog -> manage products and click on select all at the top left of the grid view. Then, in actions dropdown on the top-right, select Update Attributes and press Submit.
See the screenshot below:
Now, in the Update Attribute Screen, scroll down to Special Price field, and check the Change checkbox. DO NOT put anything in the text box. Click on save.
See the screenshot below.
It might take a while if you have many products, but it will work without disturbing your database. Once done, go to Index Management and Re-index everything.
You have 2 ways of resolving this:
1) Look more at the Magento database, It uses several tables to map prices etc. As well as a single flat table if you have that enabled. To update all prices you need to look for the special price value in the varchar table, Take that ID and update its parent.
2) Create a PHP script that will load all products and loop through and update the values you want. Basic code would be:
// inside a loop
$product->setSpecialPrice(0);
$product->save();
An easy way to debug what SQL you need is to enable MySQL logging, Save a product and see what tables are being wrote to. Or even in the product catalog save event add an echo to the Entity after save to print out the generated SQL.
If you want to remove special price then create csv file for import and add blank valspecial price field using SKU and import that csv. Its remove all special prices.
Direct from database.
Before execute bellow query export and keep backup "catalog_product_entity_decimal" table.
execute bellow query.
DELETE from catalog_product_entity_decimal where attribute_id in (
select attribute_id from eav_attribute where attribute_code =
'special_price');
You can just select fields blank and save changes then all special prices will be remove.
image attached here
The Question is why you need to remove them? You could also hide them using CSS, quick and easy but once again... you should evaluate this need and solution! Hope it helps!
Related
HI i need to assign multiple products a same categories. I have check that under update product attributes in admin but unfortunately there is no option for this. There.
Can any body suggest me how can i add that functionality in admin.
please check this screen-shot
http://awesomescreenshot.com/0a92v48t1b
http://awesomescreenshot.com/09a2v4id8c
"i need to assign multiple products a same categories."
If you want to do this. you have to go to category edit.
Catalog -> Manage Categories
Select a category
Click on Category Products tab (on top)
On very first column select any (there you see Yes, No and Any option)
Click on Search. You will see list of products.
Select products to assign to that category.
I recently wanted to bulk change / replace the category of products (with or without an existing category) to a new category "Expired". I created a CSV with the following fields:
sku,_store,_category
194337,,Expired
106025,,Expired
I then used System > Import and for Import Behaviour selected "Replace existing complex data". Select your csv file and away you go. Remember a re-index is required.
If you wish to wanted to bulk add a first or further category to products, create the same file as above but for Import Behaviour select "Append complex data". I.e. if a product had been in Category: "TVs" and you use "Append complex data" with the above file, it would now be in both Categories: "TVs" and "Expired".
I hase set some special price, with a start date, and no end date.
Now I want to remove all the special price.
so no discount.
I went to the catalog view, I select ALL products, and clicked on "change attributes".
I've check the "updated" checkbox beside start date, and special price.
then I click apply.
I can see the special price disappeared, but... on the front end, I can still see the promotion!
How is it possible?
Now note that If I select a product on the backoffice, and If I click on "save" (without editing anything) then it works on the front end!!
Of course I re-indexed everything and cleared the cache.
I have 20k products so I cannot select all products one by one to click on "save"
thaks for your help
Rod
I use magmi for this. Most bulk operations are possible here. You'll definitely need this if you say you have 20k+ products.
Outside of this solution, you'll probably have to do stuff manually, write a script to manage the mass update, or write a direct SQL statement to update this. I'd post a query here but it can be too varied because of Magento's EAV system.
I'm developing a new module for Magento and I need to use the Store View (like in CMS/pages or CMS/blocks).
Thanks to answer of Gergely Varga (magento multiselect insert database) I can now save the new item and automatically Magento saves the stores in the other table (I have 2, one for the item and one with the id of my item and the id of the store).
Now I have 3 problems or more:
1 - Grid.php doesn't show the stores that Magento saved in the stores table.
2 - If I try to modify an item, it doesn't load-show the stores that Magento saved when I created the item.
3 - I can't use the search with the Store view (I don't really care about this one).
Then, what is the problem? I followed the answer of Gergely Varga and I can't see anything different in the code of the CMS/page or CMS/block.
EDIT:
Do you want me to rewrite it or something? I really need help with this, is so frustrating...
The thing is that I am creating a module to add and manage banners. When I create a banner I need to asociate it to some parts of the web using the Store View multiselect. Now, thanks to that post (magento multiselect insert database), it's working, but when I am in the banners manage page, the store view column is not working (it doesn't shows anything). When I want to modify a banner, the same thing, it doesn't show the asociated Store Views.
Thanks, regards.
Now it's all working (the search is not working if you want to use the Store Views field, but I don't care about that).
I don't really know how have I fix all that, but it's working. I think that I had some problems in the models.
i want to remove some fields like description,short description from catalog->Manage Products->continue->general tab in admin panel...here i can add new field but can't delete existing fields..i tried so much but finally i am not getting the right page where i have insert or delete the code for making/removing fields.Can Anybody help me...with best regards....
Name, description, short description, etc are the system attributes. You cannot delete them from admin panel. However, you can delete them from database. Follow the article link below which explains on how to delete system attributes in Magento.
Magento: How to delete System Attribute?
Thanks.
These are system fields and are generally relied upon in other parts of the system, so they are not meant to be removed. Can you give more detail about why you are trying to do this?
I have a custom script that takes data form an XML and loads in the products.
The main problem, is that these products do display on the frontend.
The only way they do, is if i go into the admin and open the product and then save it.
I noticed that once i did this, an entry was added into the table 'catalog_product_flat_1'.
Is there a way to either display these imported products or add them to the 'catalog_product_flat_1' table without having to save each product?
I am using Magento v1.4.2
Thanks
Try to go to Index Management and do the Product Flat Data reindexing. Also, do you have one-store or multi-store system? If its the later see what is set under the Websites for each product.
i had also same problem. it was not showing product after re indexing. but after adding this two field in CSV
1)_root_category = Default Category
and
2)_product_websites = base
i import CSV. it solve problem and start displays product in store.