How to add dynamic buttons to cart drawer

Solved

How to add dynamic buttons to cart drawer

undercoverfresh
Excursionist
138 0 19

I want to add the dynamic buttons to cart drawer at the bottom like this on dawn theme on mobile only like this


URLknmb1c-pf.myshopify.com

password samurai

IMG_7342.jpeg

Accepted Solution (1)
B2Bridge
Excursionist
316 64 79

This is an accepted solution.

You must replace the old code with new code:

Replace this:

{% if additional_checkout_buttons %}
  <div class="additional-checkout-buttons">
    {{ content_for_additional_checkout_buttons }}
  </div>
{% endif %}

To this:

{% if additional_checkout_buttons %}
  <div class="additional-checkout-buttons--vertical">
    {{ content_for_additional_checkout_buttons }}
  </div>
{% endif %}

 

B2Bridge: All-in-one B2B wholesale solution, enabling merchants to set up a complete B2B store quickly and without coding.
With features like customizable registration forms, customer segmentation, and tailored price lists, it simplifies wholesale management.
B2Bridge also includes a dedicated Quick Order page and flexible Net Payment Terms, streamlining operations for wholesalers and enhancing the buying experience.

View solution in original post

Replies 11 (11)

B2Bridge
Excursionist
316 64 79

Hi @undercoverfresh, to do that, please follow our instruction:

Step 1: Open Online Store -> Themes -> Edit code.

Step 2: Find cart-drawer.liquid file.

Step 3: Paste this code below checkout button:

{% if additional_checkout_buttons %}
  <div class="additional-checkout-buttons">
    {{ content_for_additional_checkout_buttons }}
  </div>
{% endif %}

B2Bridge_0-1739163129298.png

If this helpful, please let us know by giving us a like and marking its as a solution. Thanks you 😍

 

B2Bridge: All-in-one B2B wholesale solution, enabling merchants to set up a complete B2B store quickly and without coding.
With features like customizable registration forms, customer segmentation, and tailored price lists, it simplifies wholesale management.
B2Bridge also includes a dedicated Quick Order page and flexible Net Payment Terms, streamlining operations for wholesalers and enhancing the buying experience.

undercoverfresh
Excursionist
138 0 19

It worked but this is how it looks on desktop could you make the code for desktop and mobile? And for desktop stacked like the photo?

IMG_7386.jpeg

B2Bridge
Excursionist
316 64 79

You can try this:

<style>
.wallet-cart-grid {
  justify-content: flex-start;
  flex-direction: column;
  margin: 0;
  max-width: none;
}

.wallet-cart-button-container:first-child {
   margin: 8px 0 0;
}

.wallet-cart-button-container {
   width: 100%;
   height: clamp(25px, var(--shopify-accelerated-checkout-button-block-size, 54px), 55px);
   margin: 8px 0 0;
   max-width: none;
}
</style>

B2Bridge: All-in-one B2B wholesale solution, enabling merchants to set up a complete B2B store quickly and without coding.
With features like customizable registration forms, customer segmentation, and tailored price lists, it simplifies wholesale management.
B2Bridge also includes a dedicated Quick Order page and flexible Net Payment Terms, streamlining operations for wholesalers and enhancing the buying experience.

undercoverfresh
Excursionist
138 0 19

I should put it at the same place before?

B2Bridge
Excursionist
316 64 79

Put this at the top of cart-drawer.liquid

B2Bridge: All-in-one B2B wholesale solution, enabling merchants to set up a complete B2B store quickly and without coding.
With features like customizable registration forms, customer segmentation, and tailored price lists, it simplifies wholesale management.
B2Bridge also includes a dedicated Quick Order page and flexible Net Payment Terms, streamlining operations for wholesalers and enhancing the buying experience.

undercoverfresh
Excursionist
138 0 19

Mobile is good, desktop shows same problem  

image.jpg

B2Bridge
Excursionist
316 64 79

Try this:

{% if additional_checkout_buttons %}
  <div class="additional-checkout-buttons--vertical">
    {{ content_for_additional_checkout_buttons }}
  </div>
{% endif %}

B2Bridge: All-in-one B2B wholesale solution, enabling merchants to set up a complete B2B store quickly and without coding.
With features like customizable registration forms, customer segmentation, and tailored price lists, it simplifies wholesale management.
B2Bridge also includes a dedicated Quick Order page and flexible Net Payment Terms, streamlining operations for wholesalers and enhancing the buying experience.

undercoverfresh
Excursionist
138 0 19

I put it at the very top of cart-drawer.liquid and it shows on the draws but also on top of page 

IMG_7395.jpeg

B2Bridge
Excursionist
316 64 79

This is an accepted solution.

You must replace the old code with new code:

Replace this:

{% if additional_checkout_buttons %}
  <div class="additional-checkout-buttons">
    {{ content_for_additional_checkout_buttons }}
  </div>
{% endif %}

To this:

{% if additional_checkout_buttons %}
  <div class="additional-checkout-buttons--vertical">
    {{ content_for_additional_checkout_buttons }}
  </div>
{% endif %}

 

B2Bridge: All-in-one B2B wholesale solution, enabling merchants to set up a complete B2B store quickly and without coding.
With features like customizable registration forms, customer segmentation, and tailored price lists, it simplifies wholesale management.
B2Bridge also includes a dedicated Quick Order page and flexible Net Payment Terms, streamlining operations for wholesalers and enhancing the buying experience.

undercoverfresh
Excursionist
138 0 19

I added the code to the first place you said to add it and it worked thank you

B2Bridge
Excursionist
316 64 79

You are welcome 😊

B2Bridge: All-in-one B2B wholesale solution, enabling merchants to set up a complete B2B store quickly and without coding.
With features like customizable registration forms, customer segmentation, and tailored price lists, it simplifies wholesale management.
B2Bridge also includes a dedicated Quick Order page and flexible Net Payment Terms, streamlining operations for wholesalers and enhancing the buying experience.