Log 1819

$totalSum = 0;

// Product 1
$productName1 = ‘Product Name 1’;
$unitPrice1 = 10;
$totalSum += $unitPrice1;

// Product 2
$productName2 = ‘Product Name 2’;
$unitPrice2 = 20;
$totalSum += $unitPrice2;

// Product n…
// Add more product variables and unit prices here

return “The total sum of all products is: ” . $totalSum;

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