Pergunta

I have a brand new e-commerce website (http://missfrisette.com/showphotos.php) each item (hair clip) can be buy

  • 1 clip = 2$
  • 2 clip = 3$
  • 1 bigclip = 3$
  • 2 bigclip = 5$

so i like to have 4 different button that send 4 different definition in the cart...

how to do tha with simplecart or another cart (php and javascript please) thanks

Foi útil?

Solução 2

here is my solution. the only limit, is all the price should be different

<select class="item_price">
<option value="2.00">1 clip</option>'
<option value="3.00">2 clips</option>'
<option value="3.50">1 pince</option>
<option value="5.00">2 pinces</option>
</select>

Outras dicas

The answer by @menardmam really helped me- but I still needed the specific item name to be transfered to the PayPal checkout. So it is kind of hacky, but I used some jquery and got it to do what I needed. This issue doesn't seem to be addressed anywhere even after I searched for a good 2 hours.

If you have multiple products, then you will need to make another class instead of .item_name. I only needed multi-pricing for one product. Multiple multi-pricing products will require slightly more sophisticated code.

http://api.jquery.com/change/

<script>
$("select").change(function () {
      var str = "";
      $("select option:selected").each(function () {
            str += $(this).text() + " ";
          });
      $(".item_name").text(str);
    })
    .change();
</script>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top