Remove sku number from order email - magento - magento-1.7

I am completely new to magento & using version 1.7. I want to remove sku number from the order email when customer place an order. After lot of R&D I noticed that, the template used is from app/design/frontend/base/default/template/email/order/items.phtml and product name, sku number, quantity and price comes from echo $this->getItemHtml($_item) this line. I am not exactly figure out, how should I remove sku number column from this single line?
Or is there any other way to do so?
Any help appreciated.
Thanks.

Let me explain you all process.
you can find order email template at app/locale/en_US/template/email/sales/order_new.html.
In this file you can find this line {{layout handle="sales_email_order_items" order=$order}} at Line no. 97
In this you can see handle is "sales_email_order_items" you can find this block in app\design\frontend\base\default\layout\sales.xml line no. 268.
<sales_email_order_items>
<block type="sales/order_email_items" name="items" template="email/order/items.phtml">
<action method="addItemRender"><type>default</type><block>sales/order_email_items_order_default</block><template>email/order/items/order/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/order/default.phtml</template></action>
<block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
<action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action>
<action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>
<block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml">
<action method="setIsPlaneMode"><value>1</value></action>
</block>
</block>
</block>
<block type="core/text_list" name="additional.product.info" />
In this block you can see the file path "email/order/items.phtml (app\design\frontend\base\default\template\email\order\items.phtml)"
In this file just comment this code
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th> at line no. 33
And now on above block you can see another file path 'email\order\items\order\default.phtml(app\design\frontend\base\default\template\email\order\items\order\default.phtml)'
In this file just comment this code <td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;"><?php echo $this->htmlEscape($this->getSku($_item)) ?></td> at line no. 48.
Done.

In Magento 2.3 the "sales_email_order_renderers.xml" render the phtml.file which define the content for the items in the order email.
To remove the SKU, you can do the following steps:
create module (e.g. COMPANY/SAMPLE)
copy the "sales_email_order_renders.xml" from /vendor/magento/module-sales/view/frontend/layout/ to /app/code/COMPANY/SAMPLE/view/frontend/layout/
copy the "default.phtml" from /vendor/magento/module-sales/view/frontend/templates/email/items/order/ to /app/code/COMPANY/SAMPLE/view/frontend/templates/email/items/order/
update the "sales_email_order_renders.xml" in your module to render the "default.phtml" in your module (see following example)
<?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" label="Email Creditmemo Items List" design_abstraction="custom">
<body>
<referenceBlock name="sales.email.order.renderers">
<block class="Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder" name="sales.email.order.renderers.default" as="default"
template="COMPANY_SAMPLE::email/items/order/default.phtml"/>
</referenceBlock>
</body>
Remove the SKU from the default.phtml
clear cache (php bin/magento cache:flush)

Related

multi-column template for Cleverreach

I'm trying to write a multi-column template for Cleverreach. We need a one-column for the main-content and below this a two- or three-column area for products (dynamic content from MyContent-API).
All my tries dosn't work, it's seems only possible to define one-column areas (loop-areas) for placing content-elements in Cleverreachs WYSIWYG-editor.
If I define more than one loop-areas, only the last area is displayed in WYSIWYG-editor, alls others are gone.
Has someone resolved such a problem? Somthing like:
<table><tr><td><!-- #loop# --> <!-- #/loop# --></td>
<td><!-- #loop# --> <!-- #/loop# --></td></tr></table>
(this example will result in, that only the second column is displayed in WYSIWYG-editor.
Kind regard
Johannes
It#s important, that each loop has a unique numerous ID
<table>
<tr>
<td>
<!-- #loop# --> <!-- loop1 -->
some code
<!--#/loop# -->
</td>
<td>
<!-- #loop# --> <!-- loop2 -->
some other code
<!-- #/loop# -->
</td>
</tr>
</table>

Magento 2.x: add column to sales order history page (FO)

How we can add column to Sales order history content into customer account.
What are methods for add a column to sales_order_history page without editing view/frontend/templates/order/history.phtml?
You don't need to touch view/frontend/templates/order/history.phtml template file to add aditional column into customer sales order history page.
copy layout view/frontend/layout/sales_order_history.xml to your theme and add addtional column header to sales.order.history.extra.column.header block and render column data using sales.order.history.extra.container block.
You have all set now.
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!-- This will add additional column header to order list -->
<referenceBlock name="sales.order.history.extra.column.header">
<block class="Magento\Framework\View\Element\Template" name="your.additional.column.header" template="Namespace_Module::columnheader.phtml"/>
</referenceBlock>
<!-- You can access current order using $this->getOrder() inside the template ">
<referenceBlock name="sales.order.history.extra.container">
<block class="Magento\Framework\View\Element\Template" name="your.additional.column.data" template="Namespace_Module::columndata.phtml"/>
</referenceBlock>
</body>
</page>
I have an easier and shorter solution(date column in the example):
1- Create in your theme/extension into layout folder-> sales_order_history.xml and copy:
<?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="sales.order.history.extra.container" template="Magento_Sales::order/date/data.phtml"/>
</body>
</page>
2- Create the template for the data in templates/date/data.phtml and copy:
<?php
/* #var $block \Magento\Sales\Block\Order\History\Container */
?>
<td data-th="<?= $block->escapeHtml(__('Date')) ?>" class="col date">
<?= $block->escapeHtml($block->getOrder()->getCreatedAt()) ?></td>

Issue finding elements using Selenium::Remote::Driver in Perl

As part of a test scrip I have to redirect to a 3rd party hosted payment page. However, when I try and find the input box elements it errors slightly differently depending on which call I try:
$driver->find_element_by_id("card.billingAddress.houseNumberOrName")->clear
returns "Element is not currently visible and so may not be interacted with"
$driver->find_element_by_xpath('//input[#id="card.billingAddress.houseNumberOrName"')->clear
returns "SyntaxError: The expression is not a legal expression."
The source of the section I am searching is:
<tr>
<td colspan="2"><div class="fieldSubHeader">Billing Address</div>
</td>
</tr>
<tr>
<td><div id="idAddress1_card" style="display:inline">Address 1</div>
<div id="idHouseNumberOrName_card" style="display:none">House Number/Name
</div</td>
<td><div class="fieldDiv" id="idDivAddress1_card">
<input type="text" class="inputField" id="card.billingAddress.houseNumberOrName" name="card.billingAddress.houseNumberOrName" value="" size="15" maxlength="40" />
</div></td>
</tr>
Is it the . in the ID that is causing the issue?
(I have checked the computed CSS and it is not hidden!)
Many thanks
You are missing the closing ]. Replace:
'//input[#id="card.billingAddress.houseNumberOrName"'
with:
'//input[#id="card.billingAddress.houseNumberOrName"]'
HERE ^
Note that you might simplify it by switching directly to the find_element_by_id() method.

Options popup do not appear for the extension

i am building a thunderbird extension and enabled the options popup by adding following to the install.rdf
<em:optionsURL>chrome://content/options.xul</em:optionsURL>
this enables the button but on clicking it nothing happens. the options.xul looks like as below
<?xml version="1.0"?>
<prefwindow id="EmailToOSN-prefs"
title="StockWatcher 2 Options"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="sw2-stock-pane" label="Stock Settings">
<preferences>
<preference id="pref_symbol" name="extensions.stockwatcher2.symbol" type="string"/>
</preferences>
<hbox align="center">
<label control="symbol" value="Stock to watch: "/>
<textbox preference="pref_symbol" id="symbol" maxlength="4"/>
</hbox>
</prefpane>
</prefwindow>
Assuming that you have a folder content where you have placed your code files
(including options.xul)
First you have to declare this "content" folder in your
chrome.manifest file by adding this line:
content extension_name content/
Second in your install.rdf file you must write this:
<em:optionsURL>chrome://extension_name/content/options.xul</em:optionsURL>
Third add this line in your options.xul file inside the prefwindow tab:
<script type="application/x-javascript" src="chrome://extension_name/content/options.js" />
where options.js will be your javascript code you will use for
this options window
Hope I helped...

Magento how to display block outside of body tag

My code :
<reference name="before_body_end">
<block type="test/test" template="test/test.phtml" name="test-test" />
</reference>
when i change to
<reference name="after_body_end">
<block type="test/test" template="test/test.phtml" name="test-test" />
</reference>
then it is not working. please help
It doesn't work because you are referencing ...well...nothing. The block with name after_body_end does not exist.
I will explain how to add it but first I want to make it clear that I don't approve of adding html outside the body tag. This may cause issues on some browsers.
First you need to create the block with name after_body_end.
For this edit the file app/design/frontend/{interface}/{theme}/layout/page.xml and look for this :
<block type="core/text_list" name="before_body_end" as="before_body_end" translate="label">
<label>Page Bottom</label>
</block>
Right under that add the following.
<block type="core/text_list" name="after_body_end" as="after_body_end" translate="label">
<label>Page Unde the body tag</label>
</block>
Now your block exists. You just have to add it to your page. For this edit the following files all located in app/design/frontend/{interface}/{theme}/template/page/:
1column.phtml
2columns-left.phtml
2columns-right.phtml
3columns.phtml
empty.phtml
popup.phtml
print.phtml
For all these files add under the </body> line this:
<?php echo $this->getChildHtml('after_body_end') ?>
Clear the cache and enjoy.