From 113df8a3508d2e284f8365d39b79d1f53ce2629c Mon Sep 17 00:00:00 2001
From: Lewis Voncken <lewis@experius.nl>
Date: Tue, 4 Jul 2017 09:51:53 +0000
Subject: [PATCH] [TASK] Added Required Label based on attribute is
 required-entry class

---
 .../templates/experius/customer/form/register.phtml    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/view/frontend/templates/experius/customer/form/register.phtml b/view/frontend/templates/experius/customer/form/register.phtml
index 7e41620..a5a04fd 100644
--- a/view/frontend/templates/experius/customer/form/register.phtml
+++ b/view/frontend/templates/experius/customer/form/register.phtml
@@ -52,18 +52,20 @@
             <legend class="legend"><span><?php /* @escapeNotVerified */ echo __('Address Information') ?></span></legend><br>
             <input type="hidden" name="create_address" value="1" />
             <?php if ($this->helper('Experius\AddressLines\Helper\Data')->isUsedInForm('company')): ?>
-                <div class="field company">
+                <?php $attributeValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company'); ?>
+                <div class="field company<?php echo (strpos($attributeValidationClass, 'required-entry')) ? ' required' : '' ?>">
                     <label for="company" class="label"><span><?php /* @escapeNotVerified */ echo __('Company') ?></span></label>
                     <div class="control">
-                        <input type="text" name="company" id="company" value="<?php echo $block->escapeHtml($block->getFormData()->getCompany()) ?>" title="<?php /* @escapeNotVerified */ echo __('Company') ?>" class="input-text <?php /* @escapeNotVerified */ echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('company') ?>">
+                        <input type="text" name="company" id="company" value="<?php echo $block->escapeHtml($block->getFormData()->getCompany()) ?>" title="<?php /* @escapeNotVerified */ echo __('Company') ?>" class="input-text <?php /* @escapeNotVerified */ echo $attributeValidationClass ?>">
                     </div>
                 </div>
             <?php endif; ?>
             <?php if ($this->helper('Experius\AddressLines\Helper\Data')->isUsedInForm('telephone')): ?>
-                <div class="field telephone">
+                <?php $attributeValidationClass = $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone'); ?>
+                <div class="field telephone<?php echo (strpos($attributeValidationClass, 'required-entry')) ? ' required' : '' ?>">
                     <label for="telephone" class="label"><span><?php /* @escapeNotVerified */ echo __('Phone Number') ?></span></label>
                     <div class="control">
-                        <input type="text" name="telephone" id="telephone" value="<?php echo $block->escapeHtml($block->getFormData()->getTelephone()) ?>" title="<?php /* @escapeNotVerified */ echo __('Phone Number') ?>" class="input-text <?php /* @escapeNotVerified */ echo $this->helper('Magento\Customer\Helper\Address')->getAttributeValidationClass('telephone') ?>">
+                        <input type="text" name="telephone" id="telephone" value="<?php echo $block->escapeHtml($block->getFormData()->getTelephone()) ?>" title="<?php /* @escapeNotVerified */ echo __('Phone Number') ?>" class="input-text <?php /* @escapeNotVerified */ echo $attributeValidationClass ?>">
                     </div>
                 </div>
             <?php endif; ?>