I want to display my custom field in sales rule form only if field simple_data (label Apply) is set to value by_percent. I added this xml in my module:
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="actions" sortOrder="30">
<field name="simple_action" formElement="select">
<settings>
<switcherConfig>
<rules>
<rule name="0">
<value>by_percent</value>
<actions>
<action name="0">
<target>sales_rule_form.sales_rule_form.actions.is_base_price_discount</target>
<callback>show</callback>
</action>
</actions>
</rule>
</rules>
</switcherConfig>
</settings>
</field>
<field name="is_base_price_discount" formElement="checkbox">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">sales_rule</item>
<item name="default" xsi:type="number">0</item>
<item name="sortOrder" xsi:type="number">20</item>
</item>
</argument>
<settings>
<dataType>boolean</dataType>
<label translate="true">Discount from base price</label>
<visible>true</visible>
<dataScope>is_base_price_discount</dataScope>
</settings>
<formElements>
<checkbox>
<settings>
<valueMap>
<map name="false" xsi:type="number">0</map>
<map name="true" xsi:type="number">1</map>
</valueMap>
<prefer>toggle</prefer>
</settings>
</checkbox>
</formElements>
</field>
</fieldset>
</form>
But it still appears with any option selected. How to set it correctly?
enter image description here
How can I change the shape of the generic Datepicker in xamarin forms to a carousel shape?
Changing Resources/values/styles.xml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
</style>
<!-- Base theme applied no matter what API -->
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#2196F3</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#1976D2</item>
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<item name="colorAccent">#FF4081</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight and colorSwitchThumbNormal. -->
<item name="windowActionModeOverlay">true</item>
<item name="android:datePickerDialogTheme">#style/Theme.picker</item>
</style>
<style name="Theme.picker" parent="android:Theme.Material.Dialog">
<item name="android:datePickerStyle">#style/MyDatePicker</item>
</style>
<style name="MyDatePicker" parent="android:Widget.Material.DatePicker">
<item name="android:datePickerMode">spinner</item>
</style>
</resources>
We have a custom written Magento 2 module that adds an action to the order overview dropdown.
Now have we ran into an issue where it would work on 2.0.x but not 2.1.x and up.
After a bit of research it is caused by Magento changing an xml node from container to listingToolbar.
Now my question is, how do we make our module compatible with both 2.0.x and 2.1.x?
Adding both; container and listingToolbar will break the massaction dropdown.
magento 2.0.x version:
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<container name="listing_top">
<massaction name="listing_massaction">
<action name="new_action">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">action_name</item>
<item name="label" xsi:type="string" translate="true">Action Name Text Here</item>
<item name="url" xsi:type="url" path="vendor_module/action"/>
</item>
</argument>
</action>
</massaction>
</container>
magento 2.1.x version:
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<listingToolbar name="listing_top">
<massaction name="listing_massaction">
<action name="new_action">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">action_name</item>
<item name="label" xsi:type="string" translate="true">Action Name Text Here</item>
<item name="url" xsi:type="url" path="vendor_module/action"/>
</item>
</argument>
</action>
</massaction>
</listingToolbar>
I have Interwoven Teamsite 7.3.x. We have some simple DCTs that current create DCRs in the standard XML format. Would it be possible to configure so that the DCRs are created to the XML schema required by ASP.Net Resx files?
The following datacapture.cfg worked for me!
<?xml version="1.0" standalone="no"?>
Form used to capture data for the MCA resx files
<root-container name="root" location="root">
<container location="resheader" name="resheader1">
<item name="resmimetypeattrib" pathid="#name">
<text>
<default>
resmimetype
</default>
</text>
</item>
<item name="resimetypevalue" pathid="value">
<text>
<default>
text/microsoft-resx
</default>
</text>
</item>
</container>
<container location="resheader" name="resheader2">
<item name="versionattrib" pathid="#name">
<text>
<default>
version
</default>
</text>
</item>
<item name="versionvalue" pathid="value">
<text>
<default>
2.0
</default>
</text>
</item>
</container>
<container location="resheader" name="resheader3">
<item name="readerattrib" pathid="#name">
<text>
<default>
reader
</default>
</text>
</item>
<item name="readervalue" pathid="value">
<text>
<default>
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</default>
</text>
</item>
</container>
<container location="resheader" name="resheader4">
<item name="writerattrib" pathid="#name">
<text>
<default>
writer
</default>
</text>
</item>
<item name="writervalue" pathid="value">
<text>
<default>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</default>
</text>
</item>
</container>
<container location="data" name="data">
<label>Titles</label>
<item name='lclMypointsResource1' pathid='#name'>
<text>
<default>
lclMypointsResource1.Text
</default>
</text>
</item>
<item name='xml:p' pathid='#xml:space'>
<text>
<default>preserve</default>
</text>
</item>
<item name="value" pathid="value">
<label>My points</label>
<description>Text that should appear in the points control</description>
<text />
</item>
</container>
</root-container>
<script>
<!-- get the item and set readonly in FormAP -->
var item=IWDatacapture.getItem("root/resheader1");
item.setVisible(false);
var item=IWDatacapture.getItem("root/resheader2");
item.setVisible(false);
var item=IWDatacapture.getItem("root/resheader3");
item.setVisible(false);
var item=IWDatacapture.getItem("root/resheader4");
item.setVisible(false);
var item=IWDatacapture.getItem("root/data/lclMypointsResource1");
item.setVisible(false);
var item=IWDatacapture.getItem("root/data/xml:p");
item.setVisible(false);
</script>
</ruleset>
In the admin interface of Magento I need to modify the tables in the Sales / Order / View order so that it shows, besides the products name, their manufacturer as well.
I'm trying to look for the file to modify to make that happen. I thought I would find a section with all the columns that are displayed in app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php but by inspecting it there seem to be no reference to the columns/product attributes.
I also tried to modify
app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml
by changing
<?php echo $this->getColumnHtml($_item, 'name') ?>
into
<?php echo $this->getColumnHtml($_item, 'manufacturer') ?>
but it changed nothing, so I suppose that file is not involved...
Can anybody please point me to the right file to modify?
Thank you!
After quite a lot of browsing through the code and with some help from a collegue, we found out the two file to change for adding a column to such view:
app/design/adminhtml/default/default/template/sales/order/view/items.phtml
for adding the table header
app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml for filling the column with data.
I'm not really experienced with Magento but I guess that, in order to do a "clean job", one should not directly modify those files but override them instead.
EDIT
app/design/adminhtml/default/default/template/downloadable/sales/order/view/items/renderer/downloadable.phtml for filling the column with data for downloadable products.
For adding the table header and it's value add layout sales_order_view.xml in your theme or module with new argument.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="order_items">
<arguments>
<argument name="columns" xsi:type="array">
<item name="product" xsi:type="string" translate="true">Product</item>
<item name="status" xsi:type="string" translate="true">Item Status</item>
<item name="price-original" xsi:type="string" translate="true">Original Price</item>
<item name="price" xsi:type="string" translate="true">Price</item>
<item name="ordered-qty" xsi:type="string" translate="true">Qty</item>
<item name="subtotal" xsi:type="string" translate="true">Subtotal</item>
<item name="tax-amount" xsi:type="string" translate="true">Tax Amount</item>
<item name="tax-percent" xsi:type="string" translate="true">Tax Percent</item>
<item name="discont" xsi:type="string" translate="true">Discount Amount</item>
<item name="total" xsi:type="string" translate="true">Row Total</item>
<item name="repair" xsi:type="string" translate="true">Repair</item>
</argument>
</arguments>
<block class="Namespace\Module\Block\Adminhtml\DefaultRenderer" as="default" template="Magento_Sales::order/view/items/renderer/default.phtml">
<arguments>
<argument name="columns" xsi:type="array">
<item name="product" xsi:type="string" translate="false">col-product</item>
<item name="status" xsi:type="string" translate="false">col-status</item>
<item name="price-original" xsi:type="string" translate="false">col-price-original</item>
<item name="price" xsi:type="string" translate="false">col-price</item>
<item name="qty" xsi:type="string" translate="false">col-ordered-qty</item>
<item name="subtotal" xsi:type="string" translate="false">col-subtotal</item>
<item name="tax-amount" xsi:type="string" translate="false">col-tax-amount</item>
<item name="tax-percent" xsi:type="string" translate="false">col-tax-percent</item>
<item name="discont" xsi:type="string" translate="false">col-discont</item>
<item name="total" xsi:type="string" translate="false">col-total</item>
<item name="repair" xsi:type="string" translate="false">col-repair</item>
</argument>
</arguments>
</block>
</referenceBlock>
</body>
`
I have added new column with name repair.
now you have to add value for that column. so you have to override '\Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer' file in your block and in getColumnHtml() method you have to add your value for that column.
http://magentocoder.jigneshpatel.co.in/create-custom-reports-in-magento-admin/
Should get you most of the way.
For adding the table header:
app/design/adminhtml/default/default/template/sales/order/view/items.phtml
app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml
These files are useful.
Admin grids are ofter controlled by their block.
For sales it's the Mage_Adminhtml_Block_Sales_Order_Grid class
modifying/overriding method _prepareColumns() should do the trick
I've no magento installation available, but I have some ideas.
Maybe the column is not defined inside a template file (phtml), but inside a xml layout file.
Just search in the layout/sales.xml file.
And maybe you have not disabled the magento cache, that's why you don't see any changes.