Tabela de parcelamento – Script Shopify

Guia de instalação:
Tema em Geral – CLIQUE AQUI
Tema Warehouse – CLIQUE AQUI

Script

<!-- INICIO CODIGO PERSONALIZADO - TABELA DE PARCELAMENTO --> 
<style>
  #installments-table {
    margin-top: 20px;
    width: 100%;
    border-collapse: collapse;
  }
  #installments-table th, #installments-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
  }
  #installments-table th {
    background-color: #ddd;
  }
</style>
    
<script>

 // Recupera preço atual da variante selecionada
  var variantPrice = {{ product.price | money }};

  // Calcula valor das parcelas
  function calculateInstallments(price) {
    var installments = [];
    for (var i = 1; i <= 12; i++) {
      var installment = price / i;
      installments.push({
        count: i,
        value: installment.toFixed(2)
      });
    }
    return installments;
  }
</script>

<div id="installments-table-container">
  <table id="installments-table">
    <thead>
      <tr>
        <th>Parcelas</th>
        <th>Valor</th>
      </tr>
    </thead>
    <tbody>
<!-- INICIO - ALTERAR NUMERO DE PARCELAS --> 
      {% for i in (1..10) %}
<!-- FINAL - ALTERAR NUMERO DE PARCELAS --> 
        <tr>
          <td>{{ i }}x</td>
          <td>{{ product.price | divided_by: i | money }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
</div>
<!-- FIM CODIGO PERSONALIZADO - TABELA DE PARCELAMENTO --> 

Guia de instalação – Temas em Geral

1 – Acesse o arquivo main-product.liquid no seu tema

2 – Procure pela tag </product-form>

3 – Adicione o código abaixo dessa tag

Guia de instalação – Tema Warehouse

1 – Acesse o arquivo product-info.liquid no seu tema

2 – Procure pela div com class product-form__payment-container

3 – Adicione o código abaixo dessa div

Esse tutorial foi util?