0

I have this JSON table that I need to add on my HTML as a dropdown list and when the chosen product is selected, it shows its price and shows a button to simulate a shopping procedure (increase items in the add button and decrease in the other - as if I was choosing to buy a certain quantity and those that are multiple of 2 will just be bought in pairs and the multiple of 5 will just be bought 5 at a time like, 5, 10, 15.. as the multiple of 10.)

I am trying to implement this kind of interactivity with javascript. Can someone help me?

I just want to simulate a shopping where I can choose the quantity of my product and the price will be shown as a total according to this quantity.

[
   {
      "price":550000,
      "multiple":1,
      "id":"1",
      "name":"Millenium Falcon"
   },
   {
      "price":60000,
      "multiple":2,
      "id":"2",
      "name":"X-Wing"
   },
   {
      "price":4570000,
      "multiple":1,
      "id":"3",
      "name":"Super Star Destroyer"
   },
   {
      "price":75000,
      "multiple":2,
      "id":"4",
      "name":"TIE Fighter"
   },
   {
      "price":6000,
      "multiple":5,
      "id":"5",
      "name":"Lightsaber"
   },
   {
      "price":5800,
      "multiple":1,
      "id":"6",
      "name":"DLT-19 Heavy Blaster Rifle"
   },
   {
      "price":1500,
      "multiple":10,
      "id":"7",
      "name":"DL-44 Heavy Blaster Pistol"
   }
]
  • Is this in a Magento1 or Magento2 store? Do you use JS libraries, or do you have experience with any? – where Aug 6 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.