How to show custom checkout filed in admin panel - magento

how to display custom filed in the admin panel.
table sales_order,quote cullom name gst
I want to display a field in the sale order.
code details click here
enter image description here

You can override the adminhtml template file "order/view/info.phtml" and add the code to display your GST below billing address section. Refer below code sample.
app/code/Company/Module/view/adminhtml/layout/sales_order_view.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">
<body>
<referenceBlock name="order_info">
<action method="setTemplate">
<argument name="template" xsi:type="string">Company_Module::order/view/info.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
Add below code to your info.phtml to the section below billing address (DON'T REPLACE THE ENTIRE CONTENT).
app/code/Company/Module/view/adminhtml/templates/order/view/info.phtml
<?php echo $block->getOrder()->getGst();?>

Related

Magento 2 override default.phtml and items.phtml in new order email

I made a module that overrides default.phtml and i put and product image in there, and it works fine!
I made this sales_email_orders_renderers.xml to overide the default.phtml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="sales.email.order.renderers">
<block class="Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder" as="default" template="EmizenTech_SalesEmail::email/items/order/default.phtml"/>
</referenceBlock>
</body>
</page>
The original is in vendor/magento/module-sales/view/frontend/templates/email/items/order/
But how to also override the items.phtml in an other folder?
/vendor/magento/module-sales/view/frontend/templates/email/
Do i need to make an other xml or can i put some tags in the existing one?
Please go to your theme and create folder
Magento_Sales/templates/email/items/order
then
download default.phtml file
from
/vendor/magento/module-sales/view/frontend/templates/email/items/order
then paste here
Magento_Sales/templates/email/items/order your theme.

Magento onepage checkout and account create not the same form

Is it possible to get the fields from the onepage checkout (company name, vat id, address, ...) on the account creation page? (/customer/account/create)?
The templates are by standard in the following places:
app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml
app/design/frontend/base/default/template/persistent/customer/form/register.phtml
Now if the attribute has been set-up correctly then you simply add the attributes to the correct template, but the fields you have mentioned are actually part of the billing address and not the customer itself.
Now what you can do simply is set the address to show on registration via some layout.xml
<?xml version="1.0"?>
<layout>
<customer_account_create>
<reference name="customer_form_register">
<action method="setShowAddressFields"><value>1</value></action>
</reference>
</customer_account_create>
</layout>

Magento design update to replace list.phtml on search results page only

How would I issue a design update to Magento to replace the list.phtml template only for the search results page? Is there more than one way to do it? It would be ideal if there was a way to do it through the admin panel like I can for individual categories, but if not then editing an xml file is okay too.
You should create the file: app/design/frontend/YOURPACKAGE/YOURTHEME/layout/local.xml having the content:
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<catalogsearch_result_index>
<reference name="search_result_list">
<action method="setTemplate"><template>custom/list.phtml</template></action>
</reference>
</catalogsearch_result_index>
</layout>
and to create your custom template like app/design/frontend/YOURPACKAGE/YOURTHEME/template/custom/list.phtml

Magento Google Analytics Content Experiments

What is the simplest way to implement Google Analytics Content Experiment into Magento CE?
I want to test home page content.
Adding the Testing Code to CMS pages does not work. Testing Tag is after Analytics Tag.
Does Magento support adding the Testing Tag via admin Interface?
Or is there a simple way to add the tag via XML Layout Update?
Would it be possible to use Google Tag Manager to add the codes we need?
Tags could be installed after body like:
Add to local.xml in your layout folder following code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Last loaded layout file
-->
<layout>
<default>
<reference name="after_body_start">
<block type="cms/block" name="tags-first-in-body" before="-">
<action method="setBlockId"><block_id>tags-first-in-body</block_id></action>
</block>
</reference>
</default>
</layout>
and add a static block called tags-first-in-body.
Insert code to this block.

Magento: add a modified header.phtml to a copy of empty.phtml file for a custom module

I have created a custom module for a landing page after default customer login, I'm using the blank template page : empty.phtml;
I want now to add to "empty.phtml" an edited version of footer and header.phtml, without editing the original versions of this files.
How can I do that ??
Thanks a lot.
Try put it to landing page's section into your layout file:
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<your_landing_page>
<reference name="header">
<action method="setTemplate"><template>your_module/header_file.phtml</template></action>
</reference>
...

Resources