How can I modify my e-commerce site code for different product buttons?

iasthai_og
Tourist
13 0 5

Hi guys

 

I'm currently trying to figure out how to amend this code to suit the following purpose:

I sell both items and workshops. I would like the buttons for my items to be 'add to cart', and for my workshops to be 'book now'.

I've made sure that all my items are tagged as specific products (eg, rings, earrings etc) and my workshops tagged as workshops. 

Still, I'm unsure how to add a condition to the code that will amend the displayed buttons. Can anyone help?

Here is the current code: 

 

<button type="submit" name="add"
{% unless current_variant.available %} aria-disabled="true"{% endunless %}
aria-label="{% unless current_variant.available %}{{ 'products.product.sold_out' | t }}{% else %}{{ 'products.product.add_to_cart' | t }}{% endunless %}"
class="btn product-form__cart-submit{% if section.settings.enable_payment_button %} btn--secondary-accent{% endif %}"
data-add-to-cart>
<span data-add-to-cart-text>
{{ 'Add to Cart' | json | remove: '"' }}

Replies 0 (0)