menardmam
menardmam

Reputation: 9986

SimpleCart(JS) multiple price

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

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

Upvotes: 0

Views: 1566

Answers (2)

Shacleford
Shacleford

Reputation: 11

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>

Upvotes: 1

menardmam
menardmam

Reputation: 9986

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>

Upvotes: 0

Related Questions