support unicode in magento product url key - magento

I would like to use my language (not english) for url key. I research and found there're some tutorial on : http://rakan.me/2012/07/19/support-unicode-in-magento-product-url-key/ but it show 404 not found already.
anyway someone give this link to download: https://github.com/Minglong/Magento-unicode-URL
but in this zip file it contains only module folder(Model and etc). so I think I need to write the rest myself. Please advice me how can I implement this module.
Or anyone ever try this module, is it working ?
Thks

All the code from GITHUB is fine. You just need to add the below code at app/etc/modules/Rakanalh_UnicodeUrls.xml
<?xml version="1.0" ?>
<config>
<modules>
<Rakanalh_UnicodeUrls>
<active>true</active>
<codePool>local</codePool>
</Rakanalh_UnicodeUrls>
</modules>
</config>
If you place the above code from github in local folder then the codePool tag has to be local or else if you place it in community folder then codePool tag has to be community.

Related

Arabic words in invoice pdf print Magento

I'm trying to fix this problem by using integration TCPDF in magento but i don't know how do that
this is my try in this file
\app\code\core\Mage\Sales\Model\Order\Pdf\Abstract.php
require_once('TCPDF/TCPDF.php');
$pdf = new TCPDF_TCPDF
(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true,'UTF-8', false);
I don't know waht i'm doing wrong. thank you.
1) Don't edit core files.
2) There are multiple invoice generators in magento: invoice from the backend, invoice on success page etc. So make sure that you are editing and testing the right one. The example below works for invoices in the backend.
3) There may be custom modules that are overwriting your xml, like Webshopapps_Invoicing, check that or it will not work (that's the issue that I had when trying something similar).
After you copied TCPDF to your magento lib folder so that you will have now root/TCPDF/TCPDF.php edit TCPDF.php by changing the class name from tcpdf to TCPDF_TCPDF
Go into code/local/Yourcompany and create the folder invoices. In this folder create etc/config.xml with this content:
<?xml version="1.0"?>
<config>
<modules>
<Yourcompany_Invoices>
<version>0.0.1</version>
</Yourcompany_Invoices>
</modules>
<global>
<models>
<sales>
<rewrite>
<order_pdf_invoice>Yourcompany_Invoices_Sales_Model_Order_Pdf_Invoice</order_pdf_invoice>
</rewrite>
</sales>
</models>
</global>
</config>
Create another folder structure in code/local/Yourcompany like this Sales/Model/Order/Pdf and add Invoice.php:
class Yourcompany_Invoices_Sales_Model_Order_Pdf_Invoice extends Mage_Sales_Model_Order_Pdf_Invoice {
// it can be another class if you have a custom module overwriting it, like Webshopapps_Invoicing_Sales_Model_Order_Pdf_Invoice
$pdf = new TCPDF_TCPDF();//your stuff here
}
Then submit a test order and go into admin and check a pdf invoice.

Magento rewrite extension controller

I am trying to do small change in community module MDN_Organizer in Magento 1.9 and it is turning out to be nightmare for me.
I need to change also one Grid so I created in code/local folders MDN / Organizer / Block / Task and new file Grip.php
For that, I have to rewrite one Action in controller TaskController which is in folder MDN / Organizer / Controllers / TaskController.php
Is it possible to rewrite that controller in local MDN / Organizer folder? Or Do I need to put controller to my own modules?
Can controller have the same name?
How etc/config should looks?
Controller is for admin.
You need to create new module you can keep in local or community it is not matter
But add code in you file
app\etc\modules\Mycompany_Modulename.xml
<?xml version="1.0"?>
<config>
<modules>
<Mycompany_Modulename>
<active>true</active>
<codePool>local</codePool>
<depends>
<MDN_Organizer/>
</depends>
</Mycompany_Modulename>
</modules>
</config>

how to change email format from html to text in magento for admin?

in magento on order confirmation email is sent to admin in HTML format,
but i want to change it to plain text format so how and from where i can change that format only for admin, customer should get email in HTMl format as it is.
Can anyone please give me solution for this?
Thanks.
For future readers, do not edit core files as others suggest. You can achieve this in config alone with a tiny custom module.
I have AheadWorks' blog module installed, you may not, or you may have other modules that need their email format overridden. So, adjust accordingly.
Create app/etc/modules/YourNameSpace_EmailFormat.xml and add to <depends>, so your config is loaded last:
<?xml version="1.0"?>
<config>
<modules>
<YourNameSpace_EmailFormat>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Contacts/>
<AW_Blog/>
</depends>
</YourNameSpace_EmailFormat>
</modules>
</config>
Create app/code/local/YourNameSpace/EmailFormat/etc/config.xml, adding elements for all the templates you wish to override:
<?xml version="1.0"?>
<config>
<modules>
<YourNameSpace_EmailFormat>
<version>1</version>
</YourNameSpace_EmailFormat>
</modules>
<global>
<template>
<email>
<customer_create_account_email_template>
<type>text</type>
</customer_create_account_email_template>
</email>
</template>
</global>
</config>
That's it. I needed the reverse, so I had <type> set to html. This goes very well with Yireo's Email Override module so you can easily customise your templates. If converting plain text emails to HTML, be sure to change template tags like {{var foo.bar}} to {{htmlescape var=$foo.bar}} to prevent malicious code injections.
First create custom email template from Transactions emails and text type set as plain. Note down that template Id. and use in below file.
At \app\code\local\Mage\Sales\Model\Order.php sendNewOrderEmail() load manually template is and sent variables to that and send email.
you have to override and extend the Mage_Core_Model_Email_Template model to achieve this and set the correct header from there and you can't separate those by user and you ahve to build your own logic for that

Magento - Clean custom Account/Registration Fields

I followed this tutorial to add fields in the registration form of a customer under Magento, I succeed to run the example, but I know that It is not clean, for upates later...
What' the best way to rewrite all the files used in the tutorial, in a clean way :
app/design/frontend/default/yourtheme/template/customer/form/register.phtml
app/design/frontend/default/yourtheme/template/customer/form/edit.phtml
app/code/core/Mage/Customer/Model/Entity/Setup.php
app/code/core/Mage/Customer/etc/config.xml
app/code/core/Mage/Customer/controllers/AccountController.php
Thanks a lot
You need to create your own module. Never edit files in app/code/core/ folder. If you want to add functionality to Magento, you need to rewrite the base classes.
Alan Storm has good tutorials to follow:
How to create a simple 'Hello World' module in Magento?
To rewrite a controller (AccountController in your case), and after you create you own module, you can follow this tutorial.
Configure the Layout
In your app/code/local/MyCompany/Module/etc/config.xml:
<?xml version="1.0"?>
<config>
<frontend>
<layout>
<updates>
<mydesign>
<file>myfile.xml</file>
</mydesign>
</updates>
</layout>
(...)
Then you could update your layout in app/design/frontend/default/mydesign/layout/myfile.xml.

Magento - Adding Files to Local/Mage has no Effect

I would like to make changes to some Magento core files. To make sure the changes are future proof I copy the file from code/core/Mage to code/local/Mage.
I keep the file structures and file names consistent. The problem is when I do this the changes have no effect (I've refreshed the cache)
Any ideas where I'm going wrong? If I edit the core files directly the changes take place.
You should create a new local module and define rewrites in the config.xml file:
Create app/code/local/MyCompany/MyModule directory. Add subfolders etc and model.
Now create etc/config.xml file containing:
<?xml version="1.0" encoding="utf-8?>
<config>
<modules>
<MyCompany_MyModule>
<version>0.1.0</version>
</MyCompany_MyModule>
</modules>
<global>
<models> <!-- type of class to rewrite -->
<catalog> <!-- base module to rewrite -->
<rewrite>
<product>MyCompany_MyModule_Model_Product</product>
</rewrite>
</catalog>
</models>
</global>
</config>
Implement model/Product.php with your changes. Easiest way is to inherit from the base class and rewrite the metho.
Also remember to activate your module in app/etc/modules.
The above poster is correct in that the preferred way to edit core functionality is to use rewrites. In some cases, though, this isn't possible, in which case you should be able to place core files into the /app/code/local/Mage directory to get them to work. Block and Model files should work immediately in this way, as should controllers if I remember correctly. Other files (such as config files) may not be automatic.
Could you post the details of a particular file that doesn't respond as you expect? It's easier to debug particulars than generalities. Also, make sure that you have shut off any opcode cache that you have installed on the server in addition to flushing the normal cache.
Thanks,
Joe
You can easily overwrite xml settings using local.xml. So, if you want to overwrite/add to app/code/core/Mage/Customer/etc/config.xml you just add it to app/etc/local.xml.

Resources