Added voicenumber to OrderProduct

This commit is contained in:
Frank Schubert
2023-05-23 16:21:41 +02:00
parent de2b478c2f
commit cdae3cd24a
3 changed files with 72 additions and 4 deletions

View File

@@ -623,7 +623,23 @@
</div>
</div>
<?php if(
(is_array($product->product->attributes) && count($product->product->attributes))
&& (array_key_exists(TT_ATTRIB_VOICENUMBER_REQUIRED_NAME, $product->product->attributes)
&& $product->product->attributes[TT_ATTRIB_VOICENUMBER_REQUIRED_NAME]->value == 1)
|| $product->voicenumber
): ?>
<div class="row mt-1 mb-2" id="voicenumber-<?=$i?>-line">
<?php else: ?>
<div class="row mt-1 mb-2 hidden" id="voicenumber-<?=$i?>-line">
<?php endif; ?>
<!-- line to input voicenumber -->
<div class="col-6">
<label class="form-label" for="voicenumber-<?=$i?>">Rufnummer</label>
<textarea class="form-control" name="products[<?=$i?>][voicenumber]" id="voicenumber-<?=$i?>" placeholder="Eine Rufnummer pro Zeile (+43 123 456 78)" /><?=(is_array($product->voicenumbers) && count($product->voicenumbers)) ? implode("\n", $product->voicenumbers) : ""?></textarea>
<small>Wenn Rufnummern bekannt sind oder portiert werden (Eine Rufnummer pro Zeile (+43 123 456 78))</small>
</div>
</div>
<div class="row mt-1 mb-2">
<!-- line 2 -->
@@ -709,8 +725,6 @@
<label class="form-label" for="price_setup-<?=$i?>">Preis Setup</label>
<input type="text" class="form-control" name="products[<?=$i?>][price_setup]" id="price_setup-<?=$i?>" value="" placeholder="Preis Setup" />
</div>
</div>
<div class="row mt-1 mb-2 hidden" id="termination_id-<?=$i?>-line">
@@ -726,7 +740,14 @@
</div>
</div>
<div class="row mt-1 mb-2 hidden" id="voicenumber-<?=$i?>-line">
<!-- line to input voicenumber -->
<div class="col-6">
<label class="form-label" for="voicenumber-<?=$i?>">Rufnummer</label>
<textarea class="form-control" name="products[<?=$i?>][voicenumber]" id="voicenumber-<?=$i?>" placeholder="Eine Rufnummer pro Zeile (+43 123 456 78)" /></textarea>
<small>Wenn Rufnummern bekannt sind oder portiert werden (Eine Rufnummer pro Zeile (+43 123 456 78))</small>
</div>
</div>
<div class="row mt-1 mb-2">
<!-- line 2 -->
@@ -1193,6 +1214,13 @@
$('#termination_id-' + id + '-line').hide();
//$('#termination_id-' + id + '-line').hide();
}
if(typeof p.attributes === 'object' && "needs_number" in p.attributes && p.attributes.needs_number == 1) {
console.log("needs_number");
$('#voicenumber-' + id + '-line').show();
} else {
$('#voicenumber-' + id + '-line').hide();
}
},
'json');
@@ -1509,6 +1537,15 @@
</div> \
</div> \
\
<div class="row mt-1 mb-2 hidden" id="voicenumber-' + i + '-line"> \
<!-- line to input voicenumber --> \
<div class="col-6"> \
<label class="form-label" for="voicenumber-' + i + '">Rufnummer</label> \
<textarea class="form-control" name="products[' + i + '][voicenumber]" id="voicenumber-' + i + '" placeholder="Eine Rufnummer pro Zeile (+43 123 456 78)" /></textarea> \
<small>Wenn Rufnummern bekannt sind oder portiert werden (Eine Rufnummer pro Zeile (+43 123 456 78))</small> \
</div> \
</div> \
\
<div class="row mt-1 mb-2"> \
<!-- line 2 --> \
<div class="col-8"> \