Jump to content

Cart vocher(Have a promo code?) visable from step 3


misieq122

Recommended Posts

Hello,

I need to display in my checkout page, block cart vocher(Have a promo code?) but i want to display this block from step 3(Shipping method) and 4(Payment). At this moment block are visable from step 1(personal information) so i need to hide this block in step 1 and 2. How to do this?

 

Link to comment
Share on other sites

On 12/5/2022 at 11:27 AM, catzarov said:

Hello misieq122,
Simply select the hook of the module to appear only with step 3 (above the module for delivery) or step 4 (sub-methods for payment)

Screen-05122022-1.png.89435b6d473f83990a4d958bd731bf4f.png

 

Screen-05122022-2.png.620c4475aa252040541f2b86c9c2f665.png

 

I hope I've been helpful ;)

 

Thanks for the information, but I don't know which module is responsible for coupon block. I add coupons in Theme Catalog -> Discounts.

Link to comment
Share on other sites

Hello misieq122, I think I've got you now, what do you want to do, you want to show the form box for a voucher, not a message alert! I don't think it's right, but I'll share with you what I know.

/themes/classic/templates/checkout/_partials/cart-voucher.tpl
Get from this file from line "53" to line "74" the html code.

        <div id="promo-code" class="collapse{if $cart.discounts|count > 0} in{/if}">
          <div class="promo-code">
            {block name='cart_voucher_form'}
              <form action="{$urls.pages.cart}" data-link-action="add-voucher" method="post">
                <input type="hidden" name="token" value="{$static_token}">
                <input type="hidden" name="addDiscount" value="1">
                <input class="promo-input" type="text" name="discount_name" placeholder="{l s='Promo code' d='Shop.Theme.Checkout'}">
                <button type="submit" class="btn btn-primary"><span>{l s='Add' d='Shop.Theme.Actions'}</span></button>
              </form>
            {/block}

            {block name='cart_voucher_notifications'}
              <div class="alert alert-danger js-error" role="alert">
                <i class="material-icons">&#xE001;</i><span class="ml-1 js-error-text"></span>
              </div>
            {/block}

            <a class="collapse-button promo-code-button cancel-promo" role="button" data-toggle="collapse" data-target="#promo-code" aria-expanded="true" aria-controls="promo-code">
              {l s='Close' d='Shop.Theme.Checkout'}
            </a>
          </div>
        </div>

 

Then paste that code into a file: /themes/classic/templates/checkout/_partials/steps/payment.tpl on line 6, immediately after the line: {hook h='displayPaymentTop'}

I haven't tested it in practice to see if it will work, but in that order of thought and action, if it doesn't work, look to revert your edit to the original version.

best regards and success

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...