Magento all products set to noindex - magento

this is not so much a development question, rather something (hopefully) to set in the backend. I want to set all my products (all configurable ones) within magento 1.7.0.2 to the meta-tag "noindex,nofollow".
But doing that for 450 products one after another is quite heavy. Isn't there an easier way to set the default value differently or to use phpmyadmin therefore?
Thanks

So, for my thing this process worked out well:
1: Go to System > General > Design > Robots
And set all pages globally to noindex,nofollow
2. Then - in my scenario - if you want to have categories though listed, then do that to the panel "Own design" exactly like #pankijs mentioned:
<reference name="head">
<action method="setRobots"><value>INDEX,FOLLOW</value></action>
</reference>
For setting individual products now to a different robots-tag, you can go to Product > Meta Information and edit stuff within the dropdown-box there.

you can edit your templates local.xml file to
<catalog_product_view>
<reference name="head">
<action method="setRobots"><value>NOINDEX,FOLLOW</value></action>
</reference>
</catalog_product_view>
for only configurable product use:
<PRODUCT_TYPE_configurable>
</PRODUCT_TYPE_configurable>
this will add meta tag you need for all products.

Maybe something like this would give you more flexibility:
http://inchoo.net/magento/per-product-meta-robots-tag-control-in-magento/
Then you could just write a simple script/query to set all (or a subset) products to NOINDEX,NOFOLLOW.

Related

Magento - Change Product Page Layout for only one Product in the define Layout Section

This is for sure a quicky, but nothing i found so far is working.
I would like to set a different product view for a choosen Product only. Not for a category. I tried to add this to the custom layout tab without any luck so far.
I tried any variantions of this:
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/newview.phtml</template></action>
</reference>
But Magento will not read it!
Is there any easy solution to this ? Or maybe how i can get the template added to the layout dropdown in the Design Tab of the Product ? I mean the Tab where you can choose between 1-2 or 3 Columns Layout.
Thank you very much for your help. I am using Magento 1.9.1.
In your local.xml file put the following,
<layout>
...
<PRODUCT_86>
<reference name="root">
<action method="setTemplate"><template>catalog/product/newview.phtml</template></action>
</reference>
</PRODUCT_86>
...
</layout>
Here 86 is a product_id. Flush the cache and then check.
The Solution is quite easy: Make the new File readable by the Webserver.
For what its worth, maybe it helps someone.

How to turn off cache for upsell and related product section?

In Magento I have turned on the cache and on the products view page there are two sections: upsell and related products. When I refresh the page, the products in these two sections differ with configure products as from admin. Can any one help me how to turn off cache for this two blocks, upsell and related?
You can turn off particular block for cache. Here is very good document to turn off cache for block just find your upsell and related block in Magento with path hint
Please refer http://www.magikcommerce.com/blog/how-to-turn-off-cache-for-an-individual-block-in-magento/.
In the particular XML file. Say catalog.xml
In that for particular reference block In that block set the action of cache limit to null
Example of catalog.xml
<reference name="right">
<block type="catalog/navigation" name="catalog.product.cat.related" as="related_cat" template="catalog/navigation/list_cat.phtml" after="-" >
<action method="unsetData"><key>cache_lifetime</key></action>
<action method="unsetData"><key>cache_tags</key></action>
</block>
</reference>

Change template page layout on cart page in Magento

Please help me on this. I want to change template page layout of cart page in magento.
The following is the URL : http://www.wildgoosetrading.com/index.php/checkout/cart/
I want this to look like other pages of category.
Thanks in advance.
You'd set the template for the cart in your checkout.xml layout file.
In the checkout_cart_index section (straight after <default>) look for the following block and change the template the cart page is using;
<!-- Mage_Checkout -->
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
EDIT
I know this is the accepted answer but soipo's answer is the better way. Apply the change to local.xml, don't modify the core layout files, override them using local.xml in your theme's layout. See http://www.classyllama.com/development/magento-development/the-better-way-to-modify-magento-layout
In your local.xml file you can just add the following:
<checkout_cart_index translate="label">
<reference name="root">
<action method="setTemplate"><template>page/3columns.phtml</template ></action >
</reference>
Just change the template to the one you need.
By using Magento's common setTemplate method, the inherent granularity introduced by Magento's own app/design/frontend/base/default/layout/checkout.xml is lost.
Magento deliberately created two methods for doing this: setCartTemplate and setEmptyTemplate. They handle two separate conditions.
One condition is when the cart has items, the other is when the cart is empty. By calling setTemplate, that granularity is lost. That means a cart with items and a cart with zero items will both display the same template, which might be not desired.
More on this can be found here: https://stackoverflow.com/a/33875491/2973534

Custom Magento View.phtml file called via xml

What is the code to pull in a custom view.phtml file via custom layout update (in admin > catalog > manage products > specific product) with magento? I would really like to do this in local.xml for specific products.
I found this:
<PRODUCT_ATTRIBUTE_SET_shirts>
<reference name="product.info">
<action method="setTemplate"><template>my/custom/product/view.phtml</template></action>
</reference>
But this code is for attributes.
Well, I don't think you can do that in local.xml. But Custom Layout Updates were made for situation like that. Just write there your XML:
<reference name="product.info">
<action method="setTemplate"><template>my/custom/product/view.phtml</template></action>
</reference>
Or if you need to apply the same view.phtml for several products, you can create a new theme containing just one catalog/prodcut/view.phtml and make it extend your current theme. Then apply this theme only for products you need.
I am not entirely sure what you are asking for, but I am guessing you want to use your own view.phtml file and don't know how to have the xml layout file point to that new file.
first look for the file:
app/design/frontend/YOUR_THEME/default/layout/catalog.xml
This file essentially controls what blocks will be called within the catalog of products. If you look for the line:
<reference name="content">
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
You can change the template= portion to point to your custom view.phtml file. Just remember that the file structure starts at the template file:
app/design/frontend/YOUR_THEME/default/template
So you will need to store your view file within that template file if you use this method.
I hope this helps!

Changing layout/css of product detail page dynamically

I am in a situation where I need to have a different layout for a specific Product Type.
It'll be okay if I could load a different CSS for this Product Type.
Is anything like this possible through code/xml?
I am able to identify the product type in catalog/product/view.phtml, will it be helpful?
I also noticed a node in catalog.xml named <PRODUCT_TYPE_grouped> or <PRODUCT_TYPE_configurable> etc.
will something like this help!?
Your idea is a valid one, something like this should be possible:
<PRODUCT_TYPE_grouped>
<reference name="head">
<action method="addCss"><stylesheet>css/your_file.css</stylesheet></action>
</reference>
</PRODUCT_TYPE_grouped>
Take a look at page.xml to see what other sorts of tricks the same block can perform.
You want to look at catalog.xml not page.xml for product type.
This is if you are using magento 1.7 and up.

Resources