Redesign logo & storefront, light subtle admin theme, and 3D print cost calculator
This commit is contained in:
@@ -653,19 +653,14 @@ class MakerWorldService
|
||||
$dimensions = is_array($design['dimensions']) ? implode(' x ', $design['dimensions']) : (string) $design['dimensions'];
|
||||
}
|
||||
|
||||
// Calculate a smart suggested retail price
|
||||
// Base starting price of 9.95, + ~0.08 per gram + 1.25 per print hour
|
||||
$suggestedPrice = 14.95;
|
||||
if ($weightGrams || $printTimeHours) {
|
||||
$cost = 5.0;
|
||||
if ($weightGrams) {
|
||||
$cost += ($weightGrams * 0.07);
|
||||
}
|
||||
if ($printTimeHours) {
|
||||
$cost += ($printTimeHours * 1.50);
|
||||
}
|
||||
$suggestedPrice = round(max(9.95, $cost * 1.6), 2);
|
||||
// Calculate a smart suggested retail price using the 3D Printing Cost Calculator
|
||||
$colorCount = 1;
|
||||
if (! empty($profile['filaments']) && is_array($profile['filaments'])) {
|
||||
$colorCount = max(1, min(4, count($profile['filaments'])));
|
||||
}
|
||||
$calculator = app(PriceCalculatorService::class);
|
||||
$calcResult = $calculator->calculate($weightGrams ?: 85, $printTimeHours ?: 4.0, $colorCount);
|
||||
$suggestedPrice = $calcResult['suggested_price'];
|
||||
|
||||
// Creator and MakerWorld URL
|
||||
$authorName = $design['designCreator']['name'] ?? $design['designCreator']['handle'] ?? 'MakerWorld Creator';
|
||||
|
||||
Reference in New Issue
Block a user