So, habe mich nun als Antiphpler ein bisschen näher damit auseinander gesetzt und bitte Euch folgenden Lösungsansatz zu betrachten:
1. Eigene Konfiguration für den "Gutscheinshop"
2. inputvar installieren
3. Produkte (Gutscheine) ohne Varianten anlegen
4. Miniwarenkorb verwenden bei dem keine "Kassenseite" ausgewählt ist
5. Neues Warenkorbtemplate für den Gutscheinshop verwenden (iso_cart_full.xhtml) > habe hierzu in meinem Fall eine iso_cart_gutscheine.xhtml für das Warenkorbtemplate angelegt und hier die quantity auf hidden gestellt sowie eine if/else-Abfrage eingebaut:
Zeile "quantity!:
Code:
<td class="col_2 quantity"><input name="quantity[<?php echo $product['cart_item_id']; ?>]" size="3" type="hidden" class="text" value="<?php echo $product['quantity']; ?>" maxlength="3" /></td>
if/else-Abfrage um mehrere Produkte für einen Gutschein zu verhindern:
Code:
<?php if ((count($this->products))> 1): ?>
<div class='warning'>
Info: Sie haben derzeit insgesamt <strong><?php echo(count($this->products)); ?></strong> Produkte gewählt</br>
Bitte wählen Sie nur <strong>ein</strong> Produkt zur Erstellung Ihres Gutscheins!
</div>
<?php else: ?>
<div class="submit_container">
<input type="submit" class="submit update" name="update_cart" id="ctrl_update_cart" value="<?php echo $GLOBALS['TL_LANG']['MSC']['updateCartBT']; ?>" /><?php if ($this->checkoutJumpTo): ?>
<input type="submit" class="submit checkout" name="checkout" id="ctrl_checkout" value="<?php echo $this->checkoutJumpToLabel; ?>" /><?php endif; ?>
</div>
<?php endif; ?>
Gesamter Code der iso_cart_gutscheine.xhtml:
Code:
<div class="cart_full">
<?php if ($this->hasError): ?>
<p class="message error"><?php echo $this->minSubtotalError; ?></p>
<?php endif; ?>
<form action="<?php echo $this->action; ?>" id="<?php echo $this->formId; ?>" method="post">
<div class="formbody">
<input type="hidden" name="FORM_SUBMIT" value="<?php echo $this->formSubmit; ?>" />
<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}" />
<table cellpadding="0" cellspacing="0" summary="<?php echo $this->summary; ?>">
<tfoot>
<tr class="foot_0 foot_first subtotal">
<td class="col_first">[nbsp]</td>
<td class="name" colspan="2"><?php echo $this->subTotalLabel; ?></td>
<td class="price">[nbsp]</td>
<td class="price total"><?php echo $this->subTotalPrice; ?></td>
<td class="tax">[nbsp]</td>
<td class="col_last remove">[nbsp]</td>
</tr>
<?php foreach( $this->surcharges as $surcharge ): ?>
<tr class="<?php echo $surcharge['rowclass']; ?>">
<td class="col_first">[nbsp]</td>
<td class="name" colspan="2"><?php echo $surcharge['label']; ?></td>
<td class="price"><?php echo $surcharge['price']; ?></td>
<td class="price total"><?php echo $surcharge['total_price']; ?></td>
<td class="tax"><?php echo $surcharge['tax_id']; ?></td>
<td class="col_last remove">[nbsp]</td>
</tr>
<?php endforeach; ?>
<tr class="foot_<?php echo count($this->surcharges)+1; ?> foot_last grandtotal">
<td class="col_first">[nbsp]</td>
<td class="name" colspan="2"><?php echo $this->grandTotalLabel; ?></td>
<td class="price total" colspan="2"><?php echo $this->grandTotalPrice; ?></td>
<td class="tax">[nbsp]</td>
<td class="col_last remove">[nbsp]</td>
</tr>
</tfoot>
<tbody>
<?php foreach($this->products as $product): ?>
<tr class="<?php echo $product['class']; ?>">
<td class="col_0 col_first image"><a href="<?php echo $product['link']; ?>" title="<?php echo $product['name']; ?>"><img src="<?php echo $product['image']['gallery']; ?>" alt="<?php echo $product['image']['alt']; ?>" class="thumbnail"<?php echo $product['image']['gallery_size']; ?> /></a></td>
<td class="col_1 name">
<a href="<?php echo $product['link']; ?>" title="<?php echo $product['name']; ?>"><?php echo $product['name']; ?></a>
<?php if($product['product_options']): ?>
<div class="optionswrapper">
<ul class="productOptions">
<?php foreach($product['product_options'] as $option): ?>
<li><strong><?php echo $option['label']; ?>:</strong> <?php echo $option['value']; ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</td>
<td class="col_2 quantity"><input name="quantity[<?php echo $product['cart_item_id']; ?>]" size="3" type="hidden" class="text" value="<?php echo $product['quantity']; ?>" maxlength="3" /></td>
<td class="col_3 price"><?php echo $product['price']; ?></td>
<td class="col_4 price total"><?php echo $product['total_price']; ?></td>
<td class="col_5 tax"><?php echo $product['tax_id']; ?></td>
<td class="col_6 col_last remove"><a href="<?php echo $product['remove_link']; ?>" title="<?php echo $product['remove_link_title']; ?>" class="remove"><?php echo $product['remove_link_text']; ?></a></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php if ((count($this->products))> 1): ?>
<div class='warning'>
Info: Sie haben derzeit insgesamt <strong><?php echo(count($this->products)); ?></strong> Produkte gewählt</br>
Bitte wählen Sie nur <strong>ein</strong> Produkt zur Erstellung Ihres Gutscheins!
</div>
<?php else: ?>
<div class="submit_container">
<input type="submit" class="submit update" name="update_cart" id="ctrl_update_cart" value="<?php echo $GLOBALS['TL_LANG']['MSC']['updateCartBT']; ?>" /><?php if ($this->checkoutJumpTo): ?>
<input type="submit" class="submit checkout" name="checkout" id="ctrl_checkout" value="<?php echo $this->checkoutJumpToLabel; ?>" /><?php endif; ?>
</div>
<?php endif; ?>
</form>
<?php if(count($this->forms)) echo implode("\n", $this->forms); ?>
</div>
6. Formular in die mod_orderdetails.xhtml eingebunden:
Code:
<div class="ce_form tableless block">
<form id="gutschein" enctype="application/x-www-form-urlencoded" method="get" action="gutschein-erstellen.html">
<div class="formbody">
<input id="ctrl_11" class="text" type="hidden" value="<?php echo $item['name']; ?>" name="name">
<input id="ctrl_12" class="text" type="hidden" value="<?php echo $this->id; ?>" name="nummer">
<input id="ctrl_13" class="textarea" type="hidden" value="<?php echo $item['description']; ?>" name="description">
<div class="submit_container form_page">
<input id="ctrl_11" class="submit next" type="image" value="submit_next" title="go" alt="go" src="tl_files/button.png" name="FORM_NEXT">
</div>
</div>
</form>
</div>
Gesamter Code der mod_orderdetails.xhtml:
Code:
<!-- indexer::stop -->
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<?php if ($this->headline): ?>
<<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
<?php endif; ?>
<h2 class="<?php echo $this->orderStatusKey; ?>"><?php echo $this->orderStatus; ?></h2>
<h2><?php echo $this->orderDetailsHeadline; ?></h2>
<?php foreach( $this->info as $type => $data ): ?>
<div class="info_container <?php echo $type . $data['class']; ?>">
<h3><?php echo $data['headline']; ?></h3>
<div class="info"><?php echo $data['info']; ?></div>
</div>
<?php endforeach; ?>
<div class="clear">[nbsp]</div>
<table cellspacing="0" cellpadding="0" summary="Order items">
<tfoot>
<tr class="foot_0 foot_first subtotal">
<td class="col_first name" colspan="3"><?php echo $this->subTotalLabel; ?></td>
<td class="price">[nbsp]</td>
<td class="price total"><?php echo $this->subTotalPrice; ?></td>
<td class="col_last tax">[nbsp]</td>
</tr>
<?php if (is_array($this->surcharges)): foreach( $this->surcharges as $surcharge ): ?>
<tr>
<td class="col_first name" colspan="3"><?php echo $surcharge['label']; ?></td>
<td class="price"><?php echo $surcharge['price']; ?></td>
<td class="price total"><?php echo $surcharge['total_price']; ?></td>
<td class="col_last tax"><?php echo $surcharge['tax_id']; ?></td>
</tr>
<?php endforeach; endif; ?>
<tr class="foot_<?php echo count($this->surcharges)+1; ?> foot_last grandtotal">
<td class="col_first name" colspan="3"><?php echo $this->grandTotalLabel; ?></td>
<td class="price total" colspan="2"><?php echo $this->grandTotal; ?></td>
<td class="col_last tax">[nbsp]</td>
</tr>
</tfoot>
<tbody>
<?php foreach( $this->items as $item ): ?>
<tr>
<td class="col col_first sku"><?php echo $item['tstamp']; ?></td>
<td class="col_0 col_first sku"><?php echo $item['sku']; ?></td>
<td class="col_1 name"><?php if (strlen($item['href'])): ?><a href="<?php echo $item['href']; ?>"><?php endif; echo $item['name']; if (strlen($item['href'])): ?></a><?php endif; ?>
<?php if(is_array($item['product_options']) && count($item['product_options'])): ?>
<div class="optionswrapper">
<ul class="productOptions">
<?php foreach($item['product_options'] as $option): ?>
<li><strong><?php echo $option['label']; ?>:</strong> <?php echo $option['value']; ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</td>
<td class="col_2 quantity"><?php echo $item['quantity']; ?></td>
<td class="col_3 price"><?php echo $item['price']; ?></td>
<td class="col_4 price total"><?php echo $item['total']; ?></td>
<td class="col_5 col_last tax"><?php echo $item['tax_id']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if (count($this->downloads)): ?>
<h2><?php echo $this->downloadsLabel; ?></h2>
<?php foreach( $this->downloads as $download ): ?>
<div class="download"><?php if ($download['downloadable']): ?><a href="<?php echo $download['href']; ?>" /><?php endif; echo $download['title']; if ($download['downloadable']): ?></a><?php endif; echo $download['remaining']; ?></div>
<?php endforeach; endif; ?>
</div>
<div class="ce_form tableless block">
<form id="gutschein" enctype="application/x-www-form-urlencoded" method="get" action="gutschein-erstellen.html">
<div class="formbody">
<input id="ctrl_11" class="text" type="hidden" value="<?php echo $item['name']; ?>" name="name">
<input id="ctrl_12" class="text" type="hidden" value="<?php echo $this->id; ?>" name="nummer">
<input id="ctrl_13" class="textarea" type="hidden" value="<?php echo $item['description']; ?>" name="description">
<div class="submit_container form_page">
<input id="ctrl_11" class="submit next" type="image" value="submit_next" title="go" alt="go" src="tl_files/button.png" name="FORM_NEXT">
</div>
</div>
</form>
</div>
<!-- indexer::continue -->
7. Formular im efg anlegen mit folgenden Feldern:
- Feld1 (verstecktes Feld) Feldname: "name" und Standardwert:
- Feld2 (verstecktes Feld) Feldname: "nummer" und Standardwert:
HTML-Code:
{{get::nummer}}
- Feld3 (verstecktes Feld) Feldname: "description" und Standardwert:
HTML-Code:
{{get::description}}
- Feld4 (verstecktes Feld) Bildauswahlmenü mit Gutscheinvorlagen
8. Neue Seite mit Formular aus dem efg anlegen (in diesem Fall: gutschein-erstellen.html)>>> Submitbild in der mod_orderdetails ändern! (in diesem Fall tl_files/button.png)
9. ModuleOrderDetails.php ändern (siehe Thread) >>>> Ich weiß, das ist nicht wirklich eine tolle Lösung ist! - um Infos bin ich dankbar.
10. Daten bereinigen in der Systemwartung nicht vergessen!
11. Mit dem Formular aus dem efg (siehe 7.) kann man nun durch Übergabe der Variablen mittels inputvar den Gutschein mittels aufeinanderfolgenden Formularen erstellen lassen und entsprechend mit css formatieren...
Um Infos, Verbesserungsvorschläge und Sicherheitshinweise wäre ich dankbar...
Lesezeichen