get_attributes(); $rentalRates = []; foreach ($attributes as $attribute) { $name = $attribute->get_name(); if (!is_array($attribute->get_options())) { continue; } if (count($attribute->get_options()) < 1) { continue; } if ($name === "Rental Rate (Daily)") { $rentalRates["daily"] = $attribute->get_options()[0]; } if ($name === "Rental Rate (Weekly)") { $rentalRates["weekly"] = $attribute->get_options()[0]; } if ($name === "Rental Rate (Monthly)") { $rentalRates["monthly"] = $attribute->get_options()[0]; } } if (count($rentalRates)) { echo site()->render("product_rental_rates", $rentalRates); } } }