Log 2030

$products = array(); // Create an empty array to store the products

// Loop to create a group of fields for the products
for ($i = 0; $i ”, // Placeholder for product name
‘price’ => 0, // Placeholder for product price
‘quantity’ => 0 // Placeholder for product quantity
);

$products[] = $product; // Add each product to the array
}

return json_encode($products); // Convert the array to JSON format and return it as a list

$totalAmount = 0; // Variable to store the total amount

// Loop through each product and calculate its total price (price * quantity)
foreach ($products as $product) {
$totalAmount += ($product[‘price’] * $product[‘quantity’]);
}

return “Total Amount: ” . number_format($totalAmount, 2); // Echo the total amount with proper formatting

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
  • Attributes
  • Custom attributes
  • Custom fields
Click outside to hide the comparison bar
Compare