I'm currently developing an online marketplace and trying to convert all product information like name, price, and description into json format. I have a sample code featuring a selection of products displayed in rows.
<div class='cakes'>
<div class='col-3'>
<img src = 'Images/banana cake.jpg'>
<h4>Banana Cake</h4>
<p>₵30</p>
<button class='add-to-cart' data-id='1'>Add To Cart</button>
</div>
<div class='col-3'>
<img src = 'Images/pastry_box_1.jpg'>
<h4>Pastry Box</h4>
<p>Mini: ₵35 | Midi: ₵50 | Maxi: ₵90</p>
<button class='add-to-cart' data-id='1'>Add To Cart</button>
</div>
<div class='col-3'>
<img src = 'Images/cupcakes_12.jpg'>
<h4>Cupcakes</h4>
<p>Box of 4: ₵30 | Box of 12: ₵85 | Box of 6: ₵40</p>
<button class='add-to-cart' data-id='1'>Add To Cart</button>
</div>
My goal is to compile each product's details into a .json file for my JavaScript implementation, but I'm uncertain on the required steps. The tutorial resources that I'm following include a .json file with the product info, however, the process of creating it has not been explained. Consequently, I'm struggling to proceed as intended.