Override view.phtml of layered navigation not working - magento-1.8

I am trying to override magentoe\app\design\frontend\rwd\mytheme\template\instockonly\catalog\layer\view.phtml file in my custom module say instockonly -
module config.xml file -
<?xml version="1.0"?>
<config>
<modules>
<Namespace_InStockOnly>
<version>1.0</version>
</Namespace_InStockOnly>
</modules>
<frontend>
<routers>
<instockonly>
<use>standard</use>
<args>
<module>Namespace_InStockOnly</module>
<frontName>instockonly</frontName>
</args>
</instockonly>
</routers>
<layout>
<updates>
<instockonly>
<file>instockonly.xml</file>
</instockonly>
</updates>
</layout>
</frontend>
</config>
Here is module xml file
//path magentoe\app\design\frontend\rwd\enterprise\layout\instockonly.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<catalog_category_layered translate="label">
<reference name="catalog.leftnav">
<action method="setTemplate">
<template>instockonly/catalog/layer/view.phtml</template>
</action>
</block>
</reference>
</catalog_category_layered>
</layout>
and path of phtml file is -
magentoe\app\design\frontend\rwd\enterprise\template\instockonly\catalog\layer\view.phtml
where i am doing wrong,because i have tried a lot but still i am unable to overirde phtml file.
Please suggest ASAP.

Related

set up path in a webjob azure

I try to do to following:
setx /M PATH "%PATH%;D:\home\python364x86\Lib\site-packages"
But I am getting the following:
ERROR: Access to the registry path is denied.
How can I solve this?
Modifying the PATH is not straightforward, but possible.
You could use the code as below:
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<runtime xdt:Transform="InsertIfMissing">
<environmentVariables xdt:Transform="InsertIfMissing">
<add name="FOO" value="BAR" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
<add name="PATH" value="%PATH%;%HOME%\FolderOnPath" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
</environmentVariables>
</runtime>
</system.webServer>
</configuration>
For more details, you could refer to this article.

I dont want nlog to create log file for every millisec

Im using the following config . This creates log file for every milli sec.
I want only one log file per execution and it should be time stamped
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
</configSections>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="logfile" xsi:type="File" fileName="C:\log\log- ${date:format=dd/MM/yyyy HH\:mm\:ss}.txt"></target>
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="logfile" />
</rules>
The only way to do this is to set the fileName programmatically.
E.g.
var logfileTarget = NLog.LogManager.Configuration.FindTargetByName<FileTarget>("logfile");
logfileTarget.FileName = "filename_with_date_and_ext"; //you can use layout renderers here.
See API docs
Have submitted a PR for the processinfo-layout-renderer, so it can output process-start-time in the wanted format. But it only supports local-time
fileName="C:\log\log-${processinfo:property=StartTime:format=yyyy-MM-dd_HHmmss}.log"

Magento - How to override persistent billing.phtml using custom module

Stuck on this for a long now :( I am trying to override a core template file
app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml
using custom module which I have successfully activated and the config file for my new module is located at
app/code/local/CustomCheckout/Checkout/etc/config.xml.
Below are the content
<config>
<modules>
<CustomCheckout_Checkout>
<version>1.0.0</version>
</CustomCheckout_Checkout>
</modules>
<frontend>
<routers>
<checkout>
<args>
<modules>
<CustomCheckout_Checkout before="Mage_Checkout">CustomCheckout_Checkout</CustomCheckout_Checkout>
</modules>
</args>
</checkout>
</routers>
<layout>
<updates>
<checkout>
<file>persistent.xml</file>
</checkout>
</updates>
</layout>
</frontend>
</config>
I am trying to override the persistent.xml layout which in turn calls the said billing.phtml file. I placed the new layout file at following location
app/design/frontend/default/CustomCheckout/layout/persistent.xml.
Below are the content
<layout version="0.1.0">
<checkout_onepage_index>
<reference name="checkout.onepage.billing">
<action method="setTemplate">
<template>checkout/onepage/billing.phtml</template>
</action>
</reference>
</checkout_onepage_index>
</layout>
I have placed my modified billing.phtml file under
app/design/frontend/default/CustomCheckout/template/checkout/onepage/billing.phtml
but it is not being picked up. I am scratching my head...any help is appreciated.
Hopefully you've found an answer by now, but for posterity...
The issue here is that the "Persistent" module is already overriding that template. If you look in the persistent.xml layout file you see the following:
<reference name="checkout.onepage.billing">
<action method="setTemplate"><template>persistent/checkout/onepage/billing.phtml</template></action>
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
<block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
</reference>
Magento's default loading order is alphabetical. So, since the Persistent module is "Mage_Persistent" and your module is "CustomCheckout_Checkout", the Persistent module is loaded last, and it's override is the one that sticks.
There are several solutions. One is to rename your module so that it's after Mage_Persistent in the alphabet.
A better solution is to use Magento's dependency functionality. In your module declaration file (app/etc/modules/CustomCheckout_Checkout.xml), you probably have something like this:
<?xml version="1.0"?>
<config>
<modules>
<CustomCheckout_Checkout>
<active>true</active>
<codePool>local</codePool>
</CustomCheckout_Checkout>
</modules>
</config>
Modify this as shown here:
<?xml version="1.0"?>
<config>
<modules>
<CustomCheckout_Checkout>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Persistent />
</depends>
</CustomCheckout_Checkout>
</modules>
</config>
This indicates to Magento that your module "depends" on Mage_Persistent and should therefore be loaded after it.
If that does not work for you, another technique would be to use a "remove" node in your layout xml to get rid of the original billing block:
<remove name="checkout.onepage.billing" />
Then re-add it with a different name, as it is in checkout.xml. Make sure to add all necessary blocks and actions underneath it from various layout files and use the same alias (as="billing").
Finally, if this module is not intended for re-use (the change is just for your current install) you could simply copy the phtml file into the same path in your custom package/theme folder.
I am magento developer. I did implement your problem at localhost & find solution. I just create kinex/links (namespace/module). In this module layout file contain the following code:
<checkout_onepage_index>
<reference name="checkout.onepage.billing">
<action method="setTemplate">
<template>kinex/links/billing.phtml</template>
</action>
</reference>
</checkout_onepage_index>
This is very Simple, You can simply write the xml as:
<checkout_onepage_index>
<reference name="checkout.onepage.billing">
<action method="setTemplate">
<template>your-module/checkout/onepage/billing.phtml</template>
</action>
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
<block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
</reference>
</checkout_onepage_index>
If there is some error in checkout page, then it means billing or shipping.phtml file is missing.

log4net: write to event log on server

My application uses:
.NET 4
MVC 3
Windows Server 2008 R2
I use log4net to write to a logs on event log.
My configuration file looks like this:
<configuration>
<log4net>
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
<param name="LogName" value="SomeLogName"/>
<param name="ApplicationName" value="MyAppName"/>
<some settings for log4net...>
</appender>
<log4net>
</configuration>
It works well when I run it on my computer (localhost).
But I can not write to event log on server.
You should check if the apppool user has full control over the logging directory. He has to have create and update rights.
Enable internal debugging:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
</configuration>
Or:
<configuration>
...
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add
name="textWriterTraceListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="C:\tmp\log4net.txt" />
</listeners>
</trace>
</system.diagnostics>
...
</configuration>
The C:\tmp\ dir has to excits and you should give the apppool user full control on the directory.

NLog Not Writing

I have added NLog to my project and in the development environment, it works fine.
I created a Setup file to deploy my application. The NLog.config file did not show up as a dependency in the Setup project. So, I added it as a file and it is present in the same directory as the exe file and App.config when deployed.
It does not do any logging. I don't know why. Here is the config file:
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<variable name="day" value="${date:format=dd}" />
<variable name="month" value="${date:format=MM}" />
<variable name="year" value="${date:format=yyyy}" />
<variable name="verbose" value="${longdate} | ${level} | ${message} | ${exception:format=tostring,message,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method}}" />
<targets>
<target name="logfile" xsi:type="File" fileName="${basedir}/Logs/${year}${month}${day}.log" layout="${verbose}" />
</targets>
<rules>
<logger name="*" minlevel="Error" writeTo="logfile" />
</rules>
</nlog>
Any help would be great. Cheers!
Does NLog.config have the property "Copy to Output Directory" set as "Copy always"? https://stackoverflow.com/a/8881521/438760
Put your NLog configuration within the yourapp.exe.config file. Like so:
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
</configSections>
<nlog>
<variable name="day" value="${date:format=dd}" />
...
<targets>
<target name="logfile" xsi:type="File" .../>
</targets>
<rules>
<logger name="*" minlevel="Error" writeTo="logfile" />
</rules>
</nlog>
</configuration>
I'm guessing the double xml version statements (line 1 and 2) was a copy / paste issue....
Probably a dumb question, but you have the minLevel set to Error. Are you actually encountering errors that would be logged, or have you tried lowering this to info or debug?
For me, the reason my NLog stopped logging was different to the above suggestions.
During updating the packages, something must have automatically added an nlog section to the bottom of my Web.config. It may have been ApplicationInsights. Obviously this took preference and, this caused it to stop checking my Nlog.config file.
Once I removed the section from my web.config it started magically reading from my nlog.config file again. I took care to take the extentions, targets and rules from web.config and ensure they were placed neatly in my nlog.config file instead.

Resources