Magento: Can't make the search bar appear - magento

I'm trying to make a search bar appear and I can't.
Not only in the header but also in any page if I try to paste the basic search bar code, nothing will appear, can someone tell me where should I check to see if I'm missing any code?
in that case, what code and where should I add to finally be able to integrate a search bar in my header / home page or wherever?
{{block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"}}
Note: this code didn't work in any page whatsoever
Also, for some reason I seem to be missing a lot of options from plugins and magento itself (Look at hot the banner slider only has one option and when I try to edit a Slider I also get alot less options than what the plugin has to offer)
http://screencast.com/t/hsH9scDo4

Check your store view in System>Configuration>Design>Themes and see what it says there as the templates and layout name. (not to be confused with system>design). Make sure it says default/modern or just modern.

You should try adding the search element via xml in a custom layout file. For that create a local.xml file in your theme layout folder and paste following code for adding the search bar to the header:
<reference name="head">
<block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
</reference>
Put that code under the layout/default xml tags, and don't forget to add addChildHtml('topSearch') to your .phtml head file.

Related

Adding TypeKit code (or any code) into the Head of a Magento 2 site

All I want to do is to add a custom font from TypeKit into my Magento 2 website.
Previously I just used to find /app/design/frontend/XXX/XXX/page/head.phtml and edit that. Simple.
With Magento 2 it seems to be hugely complicated. I keep finding articles like this. Do I really need to create an entire Module just to add 2 lines of basic HTML to the head of a document?
Surely there must be an easier way?
I found this similar question, but I dont get the answer. Where do I create a layout file in my theme? Or is it suggesting I create a whole seperate Module again?
I also found this question, and it looks insane. Am I right in thinking that they are editing 3 seperate files, jsut to add a JS file into head?
Surely this cant be right? Isn't there a head.phtml file I can just edit?
Can someone break this down for me, assume I am an idiot, and explain how I can easily just add 2 lines of TypeKit code to the Head. Many thanks.
In your magento admin area: Navigate to "Stores" menu item, under the heading "Settings", click "Configuration", once in "Configuration", click "Design".
Under the "HTML Head" section you will see a box saying "Miscellaneous Scripts" anything you add here will be added to the head section of the website.
I don't know about adding it into the phtml file just yet, however here is how I have added in custom fonts to my theme.
In:
app/design/frontend/<vendor_name>/<theme_name>/Magento_Theme/layout/default_head_blocks.xml
Using (example):
<block type="core/text" name="example_font">
<action method="setText">
<text>
<![CDATA[<script src="https://blahblahblah.js"></script><script>try{Typekit.load();}catch(e){}</script>]]>
</text>
</action>
</block>
Then set it as base font / whatever you want in:
app/design/frontend/<vendor_name>/<theme_name>/web/css/source/_variables.less
Hope that helps even if just a bit!
FYI, it looks like the "HTML Head" referred to here has been moved in the Magento 2 admin. It's now at:
Admin > Content > Configuration > [Click "Edit" on your Theme Name] > Other Settings > HTML Head
Although I like the idea of using layout xml as per knarfeolhcs answer, the layout xml suggested isn't correct as type="core/text" doesn't exist in Magento 2. Here is the layout xml I used to add typekit app/design/frontend/<vendor_name>/<theme_name>/Magento_Theme/layout/default_head_blocks.xml
<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="https://use.typekit.net/xxxxxxx.js" src_type="url" />
</head>
<body>
<referenceBlock name="head.additional">
<block class="Magento\Framework\View\Element\Text" name="typekit">
<arguments>
<argument name="text" xsi:type="string"><![CDATA[<script>try{Typekit.load({ async: true });}catch(e){}</script>]]></argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>

how to remove layerd navigation on checkout page in magento

I have tried to remove layered navigation on www.example.com/checkout/onepage/ by using checkout.xml using following code
category_filter
But it still remains there,I want to remove it only from checkout page only are keep it on other pages.What I have to do here ???
Please check following thing:
in your current theme's checkout.xml search for handler <checkout_onepage_index translate="label"> and add following line <remove name="left"/>. if in current theme no checkout.xml then copy paste checkout.xml file from base theme and add it to your current theme and then do changes. Do not forget to clear cache!!
If option-1 is not works then right click on left side panel and check in main div what class is assigned and try to find that block name and then add
In worst case you can change your checkout onepage layout from 2column-left.phtml to 1column.phtml. To do create local.xml file in your layout directory and add following code and clear cache.
Thanks

How to remove tab from child theme added in custom default theme?

I know, confusing title..
So basically I have an custom theme. The files I'm gonna talk about it located like below :
frontend/custom/default/layout/local.xml
frontend/custom/blue/layout/generallayout.xml
In local.xml, I have added a tab like this
<action method="addTab" translate="title" module="tag"><alias>product.tags</alias><title>Product Tags</title><block>tag/product_list</block><template>tag/list.phtml</template></action>
Now I wanna remove this tab in blue/generallayout.xml. So I added :
<catalog_product_view>
<reference name="product.info.tabs">
<action method="unsetChild"><name>product.tags</name></action>
</reference>
</catalog_product_view>
The problem is, this is not working cause I think layout.xml renders after generallayout.xml. So there isnt anything to remove while in generallayout.xml. How I achieve removing the tab ?
I'm sure there isnt anything wrong with what I wrote cause I copied the second snipped to local.xml and I successfully added then removed the tab.
For reference, I couldn't resolve this with this method.
I looked at the magento's core php files and saw that 'local.xml' always renders last. No way to change it without overwriting the core files.

Magento: Order detail page is not showing

Order details page isn't showing any data, left bar , header , footer are present on the page. I enabled error log but there isn't error.
If I change theme to other theme, I can see details but when I change it to hellowired theme, nothing is there.
I don't understand whats wrong going on, what I'm supposing is some other person played with code or changed something which is causing this issue, and now I'm totally unable to understand where to proceed from.
Its simply complicated. Without any error how can I reach at that point in Magento where there are so many files in it with vast and complicated structure.
Any help would act as pain relief :P. Is there anyone who can suggest anything.
If it's working with default theme, that means your custom theme "helloweird" may have something wrong in the layout files.
If you are referring to the checkout page you should look in the file
app/design/frontend/helloweird/helloweird/layout/checkout.xml .
If you are referring to account order history details then you should look in the customer.xml
The path to the layout folder of your theme may differ.
You will not receive errors if the layout xml files have something wrong.
first of all you have to check checkout.xml FROM app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout
if it's contain checkout_onepage_success block if not then you have to copy these block from base
<checkout_onepage_success translate="label">
<label>One Page Checkout Success</label>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
<reference name="content">
<block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml"/>
</reference>
</checkout_onepage_success>
let me know if you have still problem

Magento - updating catalog.xml

I'm trying to update a magento theme (the theme name is blank_seo), and i'm trying to change the product page default template to 3 columns. I've tried updating the app/design/frontend/default/blank_seo/layout/catalog.xml file. but so far nothing is working.
The only solution that i've found is manually changing the 'Page Layout' dropbox to 3 columns. If anyone has a simpler/quicker way of doing this (or a reason why my editing of catalog.xml doesn't work), I'd be extremely thankful!
Just looking at the code I have, I have been able to do this without any issue, which part of the catalog.xml file are you changing? It should be the <catalog_product_view> element like so:
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate"><template>page/1column-productview.phtml</template></action>
</reference>
....
</catalog_product_view>
I have a custom template set up in my system for the product page, as you can see.
Also, make sure you refresh your cache and check your logs to ensure you are not missing any errors.

Resources