How to remove required field in checkout - validation

How to change the required field to an optional field on the checkout page that can be enabled and disabled from the backend like a middle name?

Add this code in the checkout_index_index.xml to remove the required entry at the respective item name. For example, I have removed the required for first name.
<item name="firstname" xsi:type="array">
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">false</item>
</item>
</item>

Related

How to change Xamarin DatePicker popup header and Background to White and also Font Color to Gray

I am trying to give custom look and feel to the datePicker popup. But I could not find any direct fields to change the header Background and Font Color of text shown in popup
enter image description here
You can try using below code inside styles.xml in Android Project.
<resources>
<style name="MainTheme" parent="MainTheme.Base">
<item name="android:datePickerDialogTheme">#style/AppCompatDialogStyle</item>
</style>
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<!--header background-->
<item name="colorAccent">#fff</item>
<!--header textcolor-->
<item name="android:textColorPrimaryInverse">#808080</item>
<!--body background-->
<item name="android:windowBackground">#fff</item>
<!--selected day-->
<item name="android:colorControlActivated">#4B6043</item>
<!--days of the month-->
<item name="android:textColorPrimary">#808080</item>
<!--days of the week-->
<item name="android:textColorSecondary">#808080</item>
<!--cancel&ok-->
<item name="android:textColor">#808080</item>
</style>

How to set a default values in multi select dynamically using magento 2 UI Component

I tried to set a default value in staticly.
below code is working fine.
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="default" xsi:type="string">1,5,6</item>
</item>
</argument>
I need to set a default value dynamically in UI component.
Have any idea about that?
I need to set a default value dynamically in UI component.

How to set admin system configuration page to full width in Magento 2

Is there a way to set group tabs use full width in system configuration pages like attribute section?
magento 2 system admin cofiguration:
After a while I found this as a solution:
<item name="additionalClasses" xsi:type="array">
<item name="admin__field-wide" xsi:type="boolean">true</item>
</item>

Magento 2 Component Showing on checkout but in wrong place

Background: Magento 2.1.7. Custom theme overriding default Luma theme.
I've got a custom component working and displaying on the checkout page but I'm struggling to get it to show where I want it.
I've called it 'my-component' and replaced the actual vendor with 'Vendor' below but I've written the associated js and html and the component works exactly as expected. The only issue is I'm trying to get it to render directly underneath the shipping form, so I think this is a layout issue?
My module currently just outputs the text 'Test' in a div and I'm trying to add my component to the children of 'item name="address-list-additional-addresses"'. I don't know if this is the right place but I'm just trying to get it after the form.
Currently it outputs directly above the shipping address form in an li with an id of "custom-field" which is not part of my .html template and I'm not knowingly adding. I can't find any way to add it after this shipping address form which is what I want.
I know my changes to checkout_index_index.xml are working as I can move my component to 'item name="before-shipping-method-form"' and it ends up above the shipping method form as you'd expect.
my-component.html (gets pulled in above shipping form inside li id="custom-field")
<div class="cart-tc-notice">
Test
</div>
checkout_index_index.xml (my theme's version and works - I can target other things in the default checkout_index_index.xml and it takes effect and moves my component around)
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="steps" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shipping-step" xsi:type="array">
<item name="children" xsi:type="array">
<item name="shippingAddress" xsi:type="array">
<item name="children" xsi:type="array">
<item name="address-list-additional-addresses" xsi:type="array">
<item name="children" xsi:type="array">
<item name="my-component" xsi:type="array">
<item name="component" xsi:type="string">Vendor/js/view/checkout/my-component</item>
</item>
I guess if I was dealing with containers or blocks, I'd just do a cheeky after="-"... Any suggestions?

Maven-pdf-plugin: How to include nested items in pdf?

I'm generating a pdf document from my maven site documentation using the maven-pdf-plugin. The documentation is written in Markdown.
Unfortunately the generated document does not include nested <item> tags.
For example, I have the the following content in my site.xml:
<menu name="Documentation">
<item name="Sweets" href="sweets/sweets.html" collapse="true">
<item name="Chocolate" href="sweets/chocolate.html"/>
<item name="Bublegum" href="sweets/bublegum.html"/>
<item name="Marzipan" href="sweets/marzipan.html"/>
</item>
</menu>
In the resulting pdf I have the contents of sweets.html, but not the content of all the sub items.
I also tried using a pdf.xml file with the following content included:
<toc name="Table of Contents" depth="4">
<item name="Sweets" ref="sweets/sweets.md">
<item name="Chocolate" ref="sweets/chocolate.md"/>
<item name="Bublegum" ref="sweets/bublegum.md"/>
<item name="Marzipan" ref="sweets/marzipan.md"/>
</item>
</toc>
Which gave me the same result.
Looking at the document model reference, it should be possible to nest <item> tags.
What am I doing wrong?
Here is some additional information:
Maven: 3.3.1
maven-pdf-plugin: 1.2
doxia-module-markdown: 1.6
Using maven-pdf-plugin Version 1.3 fixed the problem.

Resources