Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	Update templates/order_history.html
Browse files
    	
        templates/order_history.html
    CHANGED
    
    | @@ -117,15 +117,15 @@ | |
| 117 | 
             
                <script>
         | 
| 118 | 
             
                    function addToCart(itemName) {
         | 
| 119 | 
             
                // Get the price from the button's data-price attribute
         | 
| 120 | 
            -
                const itemPrice = document.getElementById(itemName).dataset.price; | 
| 121 |  | 
| 122 | 
             
                if (!itemPrice) {
         | 
| 123 | 
             
                    alert('Price is missing for the item');
         | 
| 124 | 
             
                    return;
         | 
| 125 | 
             
                }
         | 
| 126 |  | 
| 127 | 
            -
                // Ensure the price is a string
         | 
| 128 | 
            -
                const itemPriceStr = String(itemPrice);  //  | 
| 129 |  | 
| 130 | 
             
                fetch('/cart/add', {
         | 
| 131 | 
             
                    method: 'POST',
         | 
| @@ -149,7 +149,6 @@ | |
| 149 | 
             
                    alert('An error occurred: ' + error);
         | 
| 150 | 
             
                });
         | 
| 151 | 
             
            }
         | 
| 152 | 
            -
             | 
| 153 | 
             
                </script>
         | 
| 154 |  | 
| 155 | 
             
            </body>
         | 
|  | |
| 117 | 
             
                <script>
         | 
| 118 | 
             
                    function addToCart(itemName) {
         | 
| 119 | 
             
                // Get the price from the button's data-price attribute
         | 
| 120 | 
            +
                const itemPrice = document.getElementById(itemName).dataset.price;
         | 
| 121 |  | 
| 122 | 
             
                if (!itemPrice) {
         | 
| 123 | 
             
                    alert('Price is missing for the item');
         | 
| 124 | 
             
                    return;
         | 
| 125 | 
             
                }
         | 
| 126 |  | 
| 127 | 
            +
                // Ensure the price is treated as a string
         | 
| 128 | 
            +
                const itemPriceStr = String(itemPrice);  // Explicitly convert to string
         | 
| 129 |  | 
| 130 | 
             
                fetch('/cart/add', {
         | 
| 131 | 
             
                    method: 'POST',
         | 
|  | |
| 149 | 
             
                    alert('An error occurred: ' + error);
         | 
| 150 | 
             
                });
         | 
| 151 | 
             
            }
         | 
|  | |
| 152 | 
             
                </script>
         | 
| 153 |  | 
| 154 | 
             
            </body>
         |