0

I have created a Module in which Created some custom Tab and on that tab i have added discount coupon code. I have added

<div class="payment-option _collapsible opc-payment-additional discount-code"
 data-bind="mageInit: {'collapsible':{'openedState': '_active'}}">
<div class="payment-option-title field choice" data-role="title">
    <span class="action action-toggle" id="block-discount-heading" role="heading" aria-level="2">
        <!-- ko i18n: 'Apply Discount Code'--><!-- /ko -->
    </span>
</div>
<div class="payment-option-content" data-role="content">
    <!-- ko foreach: getRegion('messages') -->
    <!-- ko template: getTemplate() --><!-- /ko -->
    <!--/ko-->
    <form class="form form-discount" id="discount-form">
        <div class="payment-option-inner">
            <div class="field">
                <label class="label" for="discount-code">
                    <span data-bind="i18n: 'Enter discount code'"></span>
                </label>
                <div class="control">
                    <input class="input-text"
                           type="text"
                           id="discount-code"
                           name="discount_code"
                           data-validate="{'required-entry':true}"
                           data-bind="value: couponCode, attr:{disabled:isApplied() , placeholder: $t('Enter discount code')} " />
                </div>
            </div>
        </div>
        <div class="actions-toolbar">
            <div class="primary">
                <!-- ko ifnot: isApplied() -->
                    <button class="action action-apply" type="submit" data-bind="'value': $t('Apply Discount'), click: apply">
                        <span><!-- ko i18n: 'Apply Discount'--><!-- /ko --></span>
                    </button>
                <!-- /ko -->
                <!-- ko if: isApplied() -->
                    <button class="action action-cancel" type="submit" data-bind="'value': $t('Cancel'), click: cancel">
                        <span><!-- ko i18n: 'Cancel coupon'--><!-- /ko --></span>
                    </button>
                <!-- /ko -->
            </div>
        </div>
        <!-- ko foreach: getRegion('captcha') -->
        <!-- ko template: getTemplate() --><!-- /ko -->
        <!-- /ko -->
    </form>
</div>
</div>

It shows discount coupan but it doesn't work enter image description here

As i have shared image where i have added the coupan code. How should it worked or I have skip some step?

8
  • check the response from your controller
    – Pramod
    Commented Aug 3, 2020 at 4:18
  • I didn't create controller fot that discount coupan. Is there a need for that if i create one what should i implement in it. Because i just add html for discount code in my steps html file.@Chikku
    – Prits
    Commented Aug 3, 2020 at 4:44
  • then how are you sending data?
    – Pramod
    Commented Aug 3, 2020 at 4:45
  • magento.stackexchange.com/questions/291743/…
    – Pramod
    Commented Aug 3, 2020 at 4:47
  • I have added my code on magento.stackexchange.com/questions/318523/… will you please check i want to add discount code on my custom tab how will i do it ?
    – Prits
    Commented Aug 3, 2020 at 4:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.