diff options
Diffstat (limited to 'views')
| -rw-r--r-- | views/css/frontend.css | 5 | ||||
| -rw-r--r-- | views/mods/mod_paypalapi/settings_edit.phtml | 17 | ||||
| -rw-r--r-- | views/mods/mod_printshop/basket_row.phtml | 48 | ||||
| -rw-r--r-- | views/mods/mod_printshop/basket_row_before.phtml | 34 | ||||
| -rw-r--r-- | views/mods/mod_printshop/mail_row.phtml | 17 | ||||
| -rw-r--r-- | views/mods/mod_printshop/mail_row_html.phtml | 19 | ||||
| -rw-r--r-- | views/mods/mod_printshop/order_view_row.phtml | 46 | ||||
| -rw-r--r-- | views/mods/mod_printshop/overview_row.phtml | 38 | ||||
| -rw-r--r-- | views/mods/mod_printshop/overview_row_before.phtml | 34 | ||||
| -rw-r--r-- | views/mods/mod_printshop/product.phtml | 227 | ||||
| -rw-r--r-- | views/mods/mod_printshop/producttemplate.phtml | 449 | ||||
| -rw-r--r-- | views/mods/mod_printshop/produkt_addedit_content.phtml | 236 | ||||
| -rw-r--r-- | views/mods/mod_printshop/settings_edit.phtml | 11 | ||||
| -rw-r--r-- | views/warenkorb/checkout.phtml | 1 | ||||
| -rw-r--r-- | views/warenkorb/checkout2.phtml | 2 | ||||
| -rw-r--r-- | views/warenkorb/index.phtml | 4 |
16 files changed, 1183 insertions, 5 deletions
diff --git a/views/css/frontend.css b/views/css/frontend.css index 54565d4..3ad7d25 100644 --- a/views/css/frontend.css +++ b/views/css/frontend.css @@ -76,6 +76,9 @@ input.wpsg_error { border-color:red !important; } .wpsg_basket .wpsg_cell_gesamtsumme_value { font-weight:bold; }
.wpsg_basket .wpsg_refreshbutton, .wpsg_basketbutton { float:left; padding:0.75em 1em; }
.wpsg_basket .wpsg_basket_weiter_shoppen {background:#1a1a1a none repeat scroll 0 0; border:0 none; border-radius:2px; color:#fff; font-weight:700; line-height:1; text-transform:uppercase; padding:0.85em 0.875em 0.78em;}
+.wpsg_basket .product_action_printshop .label { align-self:flex-start; }
+.wpsg_basket .product_action_printshop .files ul li { list-style:none; display:flex; align-items:center; justify-content:flex-end; }
+.wpsg_basket .product_action_printshop .files ul li img { margin-left:5px; cursor:pointer; }
/* Checkout + Request*/
.wpsg_checkout .wpsg_checkoutblock { width:100%; clear:both; margin-bottom:2px; position:relative; width:100%; }
@@ -543,4 +546,4 @@ input.wpsg_error { border-color:red !important; } .wpsg_produkt_wrapper2 .wpsg_produkt_produktbilder { width:260px; max-width:260px; }
.wpsg_produkt_wrapper2 .wpsg_productimages { margin-right:0px !important; }
.wpsg_produkt_wrapper2 .bigimg img { margin:0 15px 15px 15px; width:100px; height:auto; float:left; }
-
\ No newline at end of file +
diff --git a/views/mods/mod_paypalapi/settings_edit.phtml b/views/mods/mod_paypalapi/settings_edit.phtml index 7d6678a..e6ae1ef 100644 --- a/views/mods/mod_paypalapi/settings_edit.phtml +++ b/views/mods/mod_paypalapi/settings_edit.phtml @@ -6,6 +6,7 @@ ?>
+<?php echo wpsg_drawForm_Select('wpsg_mod_paypalapi_version', __('API Version', 'wpsg'), ['v1' => 'V1', 'v2' => 'V2'], $this->get_option('wpsg_mod_paypalapi_version'), []); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_clientid', __('Client ID', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_clientid'), array('hint' => __('Erhalten Sie im PayPal Account.', 'wpsg'), 'help' => 'wpsg_mod_paypal_clientid', 'hint' => wpsg_translate('nohspc_'.__('Erhalten Sie im <a target="_blank" href="#1#">PayPal Developer Interface</a>.', 'wpsg'), 'https://developer.paypal.com/'))); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_secret', __('Secret', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_secret'), array('hint' => __('Erhalten Sie im PayPal Account.', 'wpsg'), 'help' => 'wpsg_mod_paypal_secret', 'hint' => wpsg_translate('nohspc_'.__('Erhalten Sie im <a target="_blank" href="#1#">PayPal Developer Interface</a>.', 'wpsg'), 'https://developer.paypal.com/'))); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_sandbox', __('Sandbox', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_sandbox'), array('help' => 'wpsg_mod_paypal_sandbox')); ?>
@@ -98,10 +99,22 @@ <?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_paypalexpress_subject', __('Betreff für Zahlung', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_paypalexpress_subject'), array('help' => 'wpsg_mod_paypal_subject')); ?>
<?php echo wpsg_drawForm_Textarea('wpsg_mod_paypalapi_plus_hint', __('Hinweistext', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_plus_hint'), array('help' => 'wpsg_shippay_hint')); ?>
-<script type="text/javascript">/* <![CDATA[ */
+<script>
jQuery(document).ready(function() {
+ var wpsg_mod_paypalapi_version = jQuery('#wpsg_mod_paypalapi_version').val();
+
+ jQuery('#wpsg_mod_paypalapi_version').on('change', function() {
+
+ if (jQuery(this).val() === 'v2' && wpsg_mod_paypalapi_version === 'v1') {
+
+ alert('<?php echo __('Beim Wechseln von V1 auf V2 sollte eine neue App im PayPal Developer Intervace angelegt werden.', 'wpsg'); ?>');
+
+ }
+
+ });
+
jQuery('#wpsg_mod_paypalapi_plus_aktiv').on('change', function() {
jQuery('.wpsg_mod_paypalapi_plus_aktiv_layer').hide();
@@ -161,4 +174,4 @@ } );
-/* ]]> */</script>
\ No newline at end of file +</script>
\ No newline at end of file diff --git a/views/mods/mod_printshop/basket_row.phtml b/views/mods/mod_printshop/basket_row.phtml new file mode 100644 index 0000000..c48a14b --- /dev/null +++ b/views/mods/mod_printshop/basket_row.phtml @@ -0,0 +1,48 @@ +<?php
+
+ declare(strict_types=1);
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 13.02.2020
+ * Time: 06:25
+ */
+
+ $view = $this->view['wpsg_mod_printshop'];
+
+?>
+
+<div class="product_action product_action_printshop">
+ <div class="label">
+
+ <?php echo __("Bestellupload", "wpsg"); ?><br />
+
+ <input type="file" name="wpsg_mod_printshop[<?php echo $view['product_index']; ?>][]" <?php echo (($view['length'] > 1)?'multiple':''); ?> />
+
+ </div>
+ <div class="files">
+
+ <?php if (wpsg_isSizedArray($view['files'])) { ?>
+
+ <ul>
+ <?php foreach ($view['files'] as $file_index => $f) { ?>
+ <li>
+ <input type="checkbox" name="wpsg_mod_printshop[<?php echo $view['product_index'] ?>][delete_file][]" value="<?php echo $file_index; ?>" class="checkbox" style="display:none;" />
+ <a href="<?php echo $this->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_printshop', 'downloadFile', ['product_index' => $view['product_index'], 'file_index' => $file_index], false); ?>" target="_blank">
+ <?php echo $f['file_name']; ?>
+ </a>
+ <img
+ onclick="event.target.parentElement.querySelector('.checkbox').checked = 'checked'; event.target.parentElement.style.display = 'none'; return false"
+ class="delete" title="<?php echo __('Datei entfernen.', 'wpsg'); ?>" src="<?php echo WPSG_URL; ?>views/gfx/bin_x.png" alt="<?php echo __('Löschen', 'wpsg'); ?>" alt="X" />
+ </li>
+ <?php } ?>
+ </ul>
+
+ <?php } else { ?>
+
+ <p><?php echo __('Noch keine Uploads durchgeführt.', 'wpsg'); ?></p>
+
+ <?php } ?>
+
+ </div>
+</div>
\ No newline at end of file diff --git a/views/mods/mod_printshop/basket_row_before.phtml b/views/mods/mod_printshop/basket_row_before.phtml new file mode 100644 index 0000000..f596d70 --- /dev/null +++ b/views/mods/mod_printshop/basket_row_before.phtml @@ -0,0 +1,34 @@ +<?php
+
+ declare(strict_types=1);
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 13.02.2020
+ * Time: 06:25
+ */
+
+ $view = $this->view['wpsg_mod_printshop'];
+
+?>
+
+<div class="product_action product_action_price_onepice">
+ <div class="title">
+ <?php echo wpsg_translate(__("Preis je #1#", "wpsg"), $view['unit_price'].'²'); ?>
+ </div>
+ <div class="price">
+ <?php echo wpsg_ff($view['price_onepice'], $this->get_option('wpsg_currency').'/'.$view['unit_price'].'²'); ?>
+ </div>
+</div>
+
+<div class="product_action product_action_area">
+ <div class="title">
+ <span class="label"><?php echo __("Fläche", "wpsg"); ?></span>
+ <span class="rect">
+ (<?php echo wpsg_ff($view['width'], $view['unit_price'], true, 0); ?> x <?php echo wpsg_ff($view['length'], $view['unit_price'], true, 0); ?>)
+ </span>
+ </div>
+ <div class="price">
+ <?php echo wpsg_ff($view['area'], $view['unit_price'].'²'); ?>
+ </div>
+</div>
diff --git a/views/mods/mod_printshop/mail_row.phtml b/views/mods/mod_printshop/mail_row.phtml new file mode 100644 index 0000000..fd98b6c --- /dev/null +++ b/views/mods/mod_printshop/mail_row.phtml @@ -0,0 +1,17 @@ +<?php
+
+ declare(strict_types=1);
+
+ /**
+ * Template für die Integration des Flächenprodukts in die Text Mail im Bereich der Produkte
+ */
+
+ $view = $this->view['wpsg_mod_printshop'];
+
+ // 150,55 m x 1,5 m = 225,83 m²
+ $strOut = wpsg_ff($view['width'], $view['unit_price'], true, 0).' x '.wpsg_ff($view['length'], $view['unit_price'], true, 0).' = '.wpsg_ff($view['area'], $view['unit_price'].'²');
+
+ // (1 m² ≅ 1,00 EUR)
+ $strOut .= '('.wpsg_ff($view['price_onepice'], $this->get_option('wpsg_currency').' / '.$view['unit_price'].'²').')';
+
+ echo wpsg_pad_left(__('Größe:', 'wpsg').' ', 12); ?><?php echo $strOut; ?>
diff --git a/views/mods/mod_printshop/mail_row_html.phtml b/views/mods/mod_printshop/mail_row_html.phtml new file mode 100644 index 0000000..5762585 --- /dev/null +++ b/views/mods/mod_printshop/mail_row_html.phtml @@ -0,0 +1,19 @@ +<?php
+
+ declare(strict_types=1);
+
+ /**
+ * Template für die Integration des Flächenprodukts in die HTML Mails im Bereich Produkt
+ */
+
+ $view = $this->view['wpsg_mod_printshop'];
+
+?>
+
+<tr class="productrow productrow2 <?php echo ((($view['i'] % 2) == 0)?'productrow_odd':'productrow_even'); ?>">
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_pos"> </td>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_productvars_value" colspan="<?php echo ((sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?'5':'4'); ?>">
+ <?php echo __('Größe', 'wpsg'); ?>: <?php echo wpsg_ff($view['width'], $view['unit_price'], true, 0); ?> x <?php echo wpsg_ff($view['length'], $view['unit_price'], true, 0); ?> = <?php echo wpsg_ff($view['area'], $view['unit_price'].'²'); ?>
+ (1 <?php echo $view['unit_price'] ?>² ≅ <?php echo wpsg_ff($view['price_onepice'], $this->get_option('wpsg_currency')); ?>)
+ </td>
+</tr>
diff --git a/views/mods/mod_printshop/order_view_row.phtml b/views/mods/mod_printshop/order_view_row.phtml new file mode 100644 index 0000000..233eeb3 --- /dev/null +++ b/views/mods/mod_printshop/order_view_row.phtml @@ -0,0 +1,46 @@ +<?php
+
+ declare(strict_types=1);
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 13.02.2020
+ * Time: 06:25
+ */
+
+ $view = $this->view['wpsg_mod_printshop'];
+ $arCalculation = $this->view['arCalculation'];
+
+?>
+
+<tr class="wpsg_<?php echo (($view['i'] % 2 == 0)?'odd':'even'); ?> wpsg_areaproduct">
+ <td class="wpsg_cell_name"></td>
+ <td class="wpsg_cell_value" colspan="<?php echo ((sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?4:3); ?>">
+
+ <?php echo __('Größe', 'wpsg'); ?>
+ <?php echo wpsg_ff($view['width'], $view['unit_price'], true, 0); ?> x <?php echo wpsg_ff($view['length'], $view['unit_price'], true, 0); ?> = <?php echo wpsg_ff($view['area'], $view['unit_price'].'²'); ?>
+ (1 <?php echo $view['unit_price'] ?>² ≅ <?php echo wpsg_ff($view['price_onepice'], $this->get_option('wpsg_currency')); ?>)
+
+ </td>
+</tr>
+
+<?php if (wpsg_isSizedArray($view['arFiles'])) { ?>
+
+ <tr class="wpsg_<?php echo (($view['i'] % 2 == 0)?'odd':'even'); ?> wpsg_areaproduct">
+ <td class="wpsg_cell_name"></td>
+ <td class="wpsg_cell_value" colspan="<?php echo ((sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?4:3); ?>">
+
+ <?php $arFileLinks = []; foreach ($view['arFiles'] as $f) {
+
+
+ $url = wpsg_admin_url('Order', 'ajax', ['do' => 'download', 'mod' => 'wpsg_mod_printshop', 'noheader' => '1', 'order_id' => $view['order_id'], 'product_index' => $view['product_index'], 'file' => rawurlencode(basename($f))]);
+
+ $arFileLinks[] = '<a href="'.$url.'" target="_blank">'.basename($f).'</a>';
+
+ } echo implode(', ', $arFileLinks); ?>
+
+ </td>
+ </tr>
+
+
+<?php }
diff --git a/views/mods/mod_printshop/overview_row.phtml b/views/mods/mod_printshop/overview_row.phtml new file mode 100644 index 0000000..711ee21 --- /dev/null +++ b/views/mods/mod_printshop/overview_row.phtml @@ -0,0 +1,38 @@ +<?php
+
+ declare(strict_types=1);
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 13.02.2020
+ * Time: 06:25
+ */
+
+ $view = $this->view['wpsg_mod_printshop'];
+
+?>
+
+<div class="product_action product_action_printshop">
+ <div class="label">
+
+ <?php echo __("Uploads", "wpsg"); ?><br />
+
+ </div>
+ <div class="files">
+
+ <?php if (wpsg_isSizedArray($view['files'])) {
+
+ $arFiles = [];
+
+ foreach ($view['files'] as $file_index => $f) {
+
+ $arFiles[] = '<a href="'.$this->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_printshop', 'downloadFile', ['product_index' => $view['product_index'], 'file_index' => $file_index], false).'" target="_blank">'.$f['file_name'].'</a>';
+
+ }
+
+ echo implode(', ', $arFiles);
+
+ } ?>
+
+ </div>
+</div>
diff --git a/views/mods/mod_printshop/overview_row_before.phtml b/views/mods/mod_printshop/overview_row_before.phtml new file mode 100644 index 0000000..f596d70 --- /dev/null +++ b/views/mods/mod_printshop/overview_row_before.phtml @@ -0,0 +1,34 @@ +<?php
+
+ declare(strict_types=1);
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 13.02.2020
+ * Time: 06:25
+ */
+
+ $view = $this->view['wpsg_mod_printshop'];
+
+?>
+
+<div class="product_action product_action_price_onepice">
+ <div class="title">
+ <?php echo wpsg_translate(__("Preis je #1#", "wpsg"), $view['unit_price'].'²'); ?>
+ </div>
+ <div class="price">
+ <?php echo wpsg_ff($view['price_onepice'], $this->get_option('wpsg_currency').'/'.$view['unit_price'].'²'); ?>
+ </div>
+</div>
+
+<div class="product_action product_action_area">
+ <div class="title">
+ <span class="label"><?php echo __("Fläche", "wpsg"); ?></span>
+ <span class="rect">
+ (<?php echo wpsg_ff($view['width'], $view['unit_price'], true, 0); ?> x <?php echo wpsg_ff($view['length'], $view['unit_price'], true, 0); ?>)
+ </span>
+ </div>
+ <div class="price">
+ <?php echo wpsg_ff($view['area'], $view['unit_price'].'²'); ?>
+ </div>
+</div>
diff --git a/views/mods/mod_printshop/product.phtml b/views/mods/mod_printshop/product.phtml new file mode 100644 index 0000000..628a795 --- /dev/null +++ b/views/mods/mod_printshop/product.phtml @@ -0,0 +1,227 @@ +<?php
+
+ declare(strict_types=1);
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 14.01.2020
+ * Time: 10:04
+ */
+
+ $ap = $this->view['ap'];
+
+ $pi = $this->view['product_index'];
+
+ /** @var wpsg_product $oProduct */
+ $oProduct = $this->view['oProduct'];
+
+ if ($ap['mode'] === wpsg_mod_printshop::MODE_AREA) {
+
+ $width = '';
+ $length = '';
+
+ } else if ($ap['mode'] === wpsg_mod_printshop::MODE_AREA_SELECT) {
+
+ $arWidth = [];
+ $arLength = [];
+
+ for ($i = intval($ap['width_min']); $i <= intval($ap['width_max']); $i += intval($ap['width_step'])) {
+
+ $arWidth[] = $i;
+
+ }
+
+ for ($i = intval($ap['length_min']); $i <= intval($ap['length_max']); $i += intval($ap['length_step'])) {
+
+ $arLength[] = $i;
+
+ }
+
+ $width = $arWidth[0];
+ $length = $arLength[0];
+
+ } else if ($ap['mode'] === wpsg_mod_printshop::MODE_LFM) {
+
+ $width = $ap['width'];
+ $length = '';
+
+ } else if ($ap['mode'] === wpsg_mod_printshop::MODE_LFM_SELECT) {
+
+ for ($i = intval($ap['length_min']); $i <= intval($ap['length_max']); $i += intval($ap['length_step'])) {
+
+ $arLength[] = $i;
+
+ }
+
+ $width = $ap['width'];
+ $length = $arLength[0];
+
+ }
+
+?>
+
+<div class="row">
+
+ <input type="hidden" name="wpsg[insertAreaProduct]" value="1" />
+
+ <?php if ($ap['mode'] === wpsg_mod_printshop::MODE_AREA) { ?>
+
+ <div class="form-group">
+ <label for="product_<?php echo $pi; ?>_width"><?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+ <input type="text" name="wpsg[width]" value="<?php echo $width; ?>" class="wpsg_mod_printshop_input form-control" id="product_<?php echo $pi; ?>_width" placeholder="<?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?>" required="required" />
+ </div>
+
+ <br />
+
+ <div class="form-group">
+ <label for="product_<?php echo $pi; ?>_length"><?php echo wpsg_translate(__('Länge in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+ <input type="text" name="wpsg[length]" value="<?php echo $length; ?>" class="wpsg_mod_printshop_input form-control" id="product_<?php echo $pi; ?>_length" placeholder="<?php echo wpsg_translate(__('Länge in #1#', 'wpsg'), $ap['price_unit']); ?>" required="required" />
+ </div>
+
+ <?php } else if ($ap['mode'] === wpsg_mod_printshop::MODE_AREA_SELECT) { ?>
+
+ <div class="form-group">
+ <label for="product_<?php echo $pi; ?>_width"><?php echo wpsg_translate(__('Breite x Länge in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+ <div class="width_length_wrap">
+
+ <select name="wpsg[width]" class="form-control wpsg_mod_printshop_change" id="product_<?php echo $pi; ?>_width">
+ <?php foreach ($arWidth as $w) { ?>
+ <option value="<?php echo $w; ?>" <?php echo (($w === $width)?'selected="selected"':''); ?>><?php echo $w; ?></option>
+ <?php } ?>
+ </select>
+
+ <span>x</span>
+
+ <select name="wpsg[length]" class="form-control wpsg_mod_printshop_change" id="product_<?php echo $pi; ?>_length">
+ <?php foreach ($arLength as $l) { ?>
+ <option value="<?php echo $l; ?>" <?php echo (($l === $length)?'selected="selected"':''); ?>><?php echo $l; ?></option>
+ <?php } ?>
+ </select>
+
+ </div>
+ </div>
+
+ <?php } else if ($ap['mode'] === wpsg_mod_printshop::MODE_LFM) { ?>
+
+ <div class="form-group">
+ <label for="product_<?php echo $pi; ?>_width"><?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+ <input name="wpsg[width]" type="text" value="<?php echo wpsg_ff($width, false, true, 0); ?>" class="wpsg_mod_printshop_input form-control" id="product_<?php echo $pi; ?>_width" placeholder="<?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?>" disabled="disabled" readonly="readonly" />
+ </div>
+
+ <br />
+
+ <div class="form-group">
+ <label for="product_<?php echo $pi; ?>_length"><?php echo wpsg_translate(__('Länge in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+ <input name="wpsg[length]" type="text" value="<?php echo wpsg_ff($length, false, true, 0); ?>" class="wpsg_mod_printshop_input form-control" id="product_<?php echo $pi; ?>_length" placeholder="<?php echo wpsg_translate(__('Länge in #1#', 'wpsg'), $ap['price_unit']); ?>" required="required" />
+ </div>
+
+ <?php } else if ($ap['mode'] === wpsg_mod_printshop::MODE_LFM_SELECT) { ?>
+
+ <div class="form-group">
+ <label for="product_<?php echo $pi; ?>_width"><?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+ <input type="text" value="<?php echo $width; ?>" class="wpsg_mod_printshop_input form-control" id="product_<?php echo $pi; ?>_width" placeholder="<?php echo wpsg_translate(__('Breite in #1#', 'wpsg'), $ap['price_unit']); ?>" disabled="disabled" readonly="readonly" />
+ </div>
+
+ <br />
+
+ <div class="form-group">
+ <label for="product_<?php echo $pi; ?>_length"><?php echo wpsg_translate(__('Länge in #1#', 'wpsg'), $ap['price_unit']); ?></label>
+ <select name="wpsg[length]" class="form-control wpsg_mod_printshop_change" id="product_<?php echo $pi; ?>_length">
+ <?php foreach ($arLength as $l) { ?>
+ <option value="<?php echo $l; ?>" <?php echo (($l === $length)?'selected="selected"':''); ?>><?php echo $l; ?></option>
+ <?php } ?>
+ </select>
+ </div>
+
+ <?php } ?>
+
+ <br />
+
+ <div class="form-group">
+ <label for="product_<?php echo $pi; ?>_price"><?php echo wpsg_translate(__('Stückpreis in #1#', 'wpsg'), $this->get_option('wpsg_currency')); ?></label>
+ <input type="text" value="" class="form-control" id="product_<?php echo $pi; ?>_price" placeholder="" disabled="disabled" />
+ </div>
+
+ <br />
+
+</div>
+
+<style>
+
+ .width_length_wrap > select { width:75px; }
+ .width_length_wrap > select:first-child { margin-right:5px; }
+ .width_length_wrap > select:last-child { margin-left:5px; }
+ select.form-control { width:100%; }
+
+</style>
+
+<script>
+
+ if (typeof wpsg_mod_printshop_calculate !== "function") {
+
+ function wpsg_mod_printshop_calculate(mode, price, product_index) {
+
+ var error = 0;
+
+ var jqWidth = jQuery('#product_' + product_index + '_width');
+ var jqLength = jQuery('#product_' + product_index + '_length');
+
+ var width = parseFloat(jqWidth.val().replace(',', '.'));
+ var length = parseFloat(jqLength.val().replace(',', '.'));
+
+ if (isNaN(width) || width <= 0) { jqWidth.addClass('wpsg_error'); error ++; }
+ else jqWidth.removeClass('wpsg_error');
+
+ if (isNaN(length) || length <= 0) { jqLength.addClass('wpsg_error'); error ++; }
+ else jqLength.removeClass('wpsg_error');
+
+ if (error === 0) {
+
+ var price = wpsg_round(width * length, 2) * price;
+
+ jQuery('#product_' + product_index + '_price').val(wpsg_numberformat(wpsg_round(price, 2), 2, ',', '.')).removeClass('wpsg_error');
+
+ } else {
+
+ jQuery('#product_' + product_index + '_price').val('<?php echo __('Keine Berechnung möglich', 'wpsg'); ?>').addClass('wpsg_error');
+
+ }
+
+ return error;
+
+ }
+
+ }
+
+ jQuery(document).ready(function() {
+
+ jQuery('#wpsg_produktform_<?php echo $pi; ?> .wpsg_mod_printshop_input, #wpsg_produktform_<?php echo $pi; ?> .wpsg_menge').on('input', function() {
+
+ wpsg_mod_printshop_calculate('<?php echo $ap['mode']; ?>', <?php echo wpsg_tf($this->view['data']['preis']); ?>, <?php echo $pi; ?>);
+
+ });
+
+ jQuery('#wpsg_produktform_<?php echo $pi; ?> .wpsg_mod_printshop_change').on('change', function() {
+
+ wpsg_mod_printshop_calculate('<?php echo $ap['mode']; ?>', <?php echo wpsg_tf($this->view['data']['preis']); ?>, <?php echo $pi; ?>);
+
+ });
+
+ jQuery('.wpsg_add_basket_<?php echo $pi; ?>').on('click', function(event) {
+
+ if (wpsg_mod_printshop_calculate('<?php echo $ap['mode']; ?>', <?php echo wpsg_tf($this->view['data']['preis']); ?>, <?php echo $pi; ?>) > 0) {
+
+ event.stopPropagation();
+ event.preventDefault();
+
+ return false;
+
+ }
+
+ });
+
+ wpsg_mod_printshop_calculate('<?php echo $ap['mode']; ?>', <?php echo wpsg_tf($this->view['data']['preis']); ?>, <?php echo $pi; ?>);
+
+ });
+
+</script>
\ No newline at end of file diff --git a/views/mods/mod_printshop/producttemplate.phtml b/views/mods/mod_printshop/producttemplate.phtml new file mode 100644 index 0000000..4092bb5 --- /dev/null +++ b/views/mods/mod_printshop/producttemplate.phtml @@ -0,0 +1,449 @@ +<?php
+
+ /*
+ * Template für Flächenprodukte im Frontend
+ * Angepasstes standard.phtml
+ */
+
+ /** @var wpsg_product $oProduct */
+ $oProduct = $this->view['oProduct'];
+
+ $ap = [
+ 'set' => intval($oProduct->getMeta('wpsg_mod_printshop_set')),
+ 'mode' => intval($oProduct->getMeta('wpsg_mod_printshop_mode')),
+ 'price_unit' => sanitize_text_field($oProduct->getMeta('wpsg_mod_printshop_unit_price')),
+ 'width' => wpsg_tf($oProduct->getMeta('wpsg_mod_printshop_width')),
+ 'width_step' => intval($oProduct->getMeta('wpsg_mod_printshop_width_step')),
+ 'width_min' => intval($oProduct->getMeta('wpsg_mod_printshop_width_min')),
+ 'width_max' => intval($oProduct->getMeta('wpsg_mod_printshop_width_max')),
+ 'length_step' => intval($oProduct->getMeta('wpsg_mod_printshop_length_step')),
+ 'length_min' => intval($oProduct->getMeta('wpsg_mod_printshop_length_min')),
+ 'length_max' => intval($oProduct->getMeta('wpsg_mod_printshop_length_max'))
+ ];
+
+ $this->view['ap'] = $ap;
+
+?>
+
+<div class="wpsg_produkt_wrapper">
+
+ <input type="hidden" name="wpsg_post_id" value="<?php echo get_the_ID(); ?>" />
+ <input type="hidden" name="titleDisplayed" value="<?php echo $this->titleDisplayed; ?>" />
+
+ <div class="wpsg_produkt wpsg_product_name">
+
+ <?php if (!$this->titleDisplayed) { ?>
+ <h1 itemprop="name" class="wpsg_producttitle"><?php echo $this->getProductName($this->view['data']['id']); ?></h1>
+ <h2 itemprop="detailname" class="wpsg_productdetailtitle"><?php echo $this->view['data']['detailname']; ?></h2>
+ <?php } ?>
+
+ <?php $this->callMods('product_top_afterheadline', array(&$this->view['data']['id'], $this->getTemplateIndex())); ?>
+
+ </div>
+
+ <?php $this->callMods('product_top', array(&$this->view['data']['id'], $this->getTemplateIndex())); ?>
+
+ <div itemscope itemtype="http://schema.org/Product" class="wpsg_produkt wpsg_produkt_<?php echo $this->view['data']['id']; ?>">
+
+ <?php /* Block für die Produktbilder START */ ?>
+ <?php
+
+ /* Das ist das primäre Anzeigebild des Produktes (AttachmentID) */
+ $arAttachmentID = $this->imagehandler->getAttachmentID($this->view['data']['product_key']);
+
+ /* Array mit allen AttachmentIDs der Produktbilder */
+ $arAttachmentIDsAll = $this->imagehandler->getAttachmentIDs($this->view['data']['product_id']);
+
+ ?>
+
+ <?php if (wpsg_isSizedArray($arAttachmentIDsAll)) { ?>
+ <div class="wpsg_productimages">
+
+ <div class="wpsg_produkt_produktbilder">
+
+ <?php if (sizeof($arAttachmentIDsAll) > 0) { for ($i = 0; $i < sizeof($arAttachmentIDsAll); $i ++) { ?>
+
+ <?php /* URL für die Lightbox */ ?>
+ <?php $att = wp_get_attachment_image_src($arAttachmentIDsAll[$i], array(800, 600), false); ?>
+
+ <a <?php if ($arAttachmentIDsAll[$i] != $arAttachmentID) echo 'style="display:none;"'; ?> rel="gallery-wpsg-<?php echo $this->getTemplateIndex(); ?>" title="<?php echo $this->getProductName($this->view['data']['id']); ?>" href="<?php echo $att[0]; ?>" class="thickbox">
+
+ <?php echo wp_get_attachment_image($arAttachmentIDsAll[$i], array(300, 300), false, array()); ?>
+
+ </a>
+
+ <?php } } ?>
+
+ </div>
+
+ </div>
+ <?php } ?>
+ <?php /* Block für die Produktbilder ENDE */ ?>
+
+ <?php if ($this->get_option('wpsg_showArticelnumber') == '1') { ?>
+ <div class="wpsg_artikelnummer">
+ <?php echo __('Artikelnummer', 'wpsg'); ?>: <span class="wpsg_anr"><?php echo wpsg_hspc($this->view['data']['anr']); ?></span><br />
+ <?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_ean'))) {?>
+ <?php echo __('EAN','wpsg');?>:<span class="wpsg_ean"><?php echo wpsg_hspc($this->view['data']['ean']); ?></span><br />
+ <?php } ?>
+ <?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_gtin'))) {?>
+ <?php echo __('GTIN','wpsg');?>:<span class="wpsg_gtin"><?php echo wpsg_hspc($this->view['data']['gtin']); ?></span><br />
+ <?php }?></div>
+ <?php } ?>
+
+ <?php /* Abfrage Preisanzeige nur für eingeloggte User aktiv und User eingeloggt START*/ ?>
+ <?php if ($this->view['oProduct']->canDisplayPrice()) { ?>
+
+ <div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="wpsg_produkt_preis">
+
+ <meta itemprop="priceCurrency" content="<?php echo $this->get_option('wpsg_currency'); ?>" />
+
+ <?php echo wpsg_translate(__('Preis je #1#²:', 'wpsg'), $ap['price_unit']); ?>
+
+ <?php $oldPrice = $this->view['oProduct']->getOldPrice(); ?>
+
+ <?php if ($oldPrice !== false && $oldPrice != $this->view['oProduct']->getPrice($this->view['data']['product_key'])) { ?>
+ <span class="wpsg_mod_productview_price wpsg_mod_productview_current"><?php echo wpsg_ff($this->view['oProduct']->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span>
+ <span class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></span>
+ <?php } else { ?>
+ <span class="wpsg_mod_productview_price"><?php echo wpsg_ff($this->view['oProduct']->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span>
+ <?php } ?>
+
+ </div>
+
+ <?php if ($this->get_option('wpsg_kleinunternehmer')) { /* Kleinunternehmerregelung aktiviert START */ ?>
+
+ <div class="wpsg_produkt_preishinweis">
+ <?php echo wpsg_translate(__('#2# zzgl. #1#', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>', '<a href="#kkhint" title="'.wpsg_hspc($this->get_option('wpsg_kleinunternehmer_text')).'">Endpreis</a>'); ?>
+ </div>
+
+ <?php } else { /* Kleinunternehmerregelung aktiviert ENDE */ ?>
+
+ <div class="wpsg_produkt_preishinweis">
+ <?php if ($this->getFrontendTaxview() == WPSG_NETTO) { /* Frontend = NETTO Preise */ ?>
+ <?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1') { /* Versandkostenfrei aktiv */?>
+
+ <?php if ($this->get_option('wpsg_mod_freeshipping_minvalue') > 0) { ?>
+ <?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und <a href="#3#">ab #2# € versandkostenfrei</a>)', 'wpsg'),
+ wpsg_ff($this->view['data']['mwst_value']),
+ wpsg_ff($this->get_option('wpsg_mod_freeshipping_minvalue')),
+ $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)
+ ); ?>
+ <?php } else { ?>
+ <?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und versandkostenfrei)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value'])); ?>
+ <?php } ?>
+
+ <?php } else { ?>
+ <?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>
+ <?php }?>
+ <?php } else { /* Frontend = BRUTTO Preise */ ?>
+ <?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1') { /* Versandkostenfrei aktiv */ ?>
+
+ <?php if ($this->get_option('wpsg_mod_freeshipping_minvalue') > 0) { ?>
+ <?php echo wpsg_translate(__('(inkl. #1#% MwSt. und <a href="#3#">ab #2# € versandkostenfrei</a>)', 'wpsg'),
+ wpsg_ff($this->view['data']['mwst_value']),
+ wpsg_ff($this->get_option('wpsg_mod_freeshipping_minvalue')),
+ $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)
+ ); ?>
+ <?php } else { ?>
+ <?php echo wpsg_translate(__('(inkl. #1#% MwSt. und versandkostenfrei)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value'])); ?>
+ <?php } ?>
+
+ <?php } else { ?>
+ <?php echo wpsg_translate(__('(inkl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>
+ <?php }?>
+ <?php } ?>
+ </div>
+
+ <?php } ?>
+
+ <?php } else {?>
+
+ <?php echo wpsg_translate(__('Die Produktpreise werden nur eingeloggten Benutzern angezeigt. Loggen Sie sich <a href="'.$this->getURL(wpsg_ShopController::URL_PROFIL).'">hier</a> bitte ein, um zu bestellen.')); ?>
+
+ <?php }?>
+ <?php /* Abfrage Preisanzeige nur für eingeloggte User aktiv und User eingeloggt ENDE */ ?>
+
+ <div itemprop="description" class="wpsg_produkt_shortdescription">
+
+ <span><?php echo $this->view['data']['shortdesc']; ?></span>
+
+ </div>
+
+ <div class="wpsg_clear"></div>
+
+ <?php /* Lagerbestand START*/?>
+ <?php if ($this->hasMod('wpsg_mod_stock') && $this->get_option('wpsg_mod_stock_showProduct') == '1') { ?>
+
+ <div class="wpsg_mod_produktindex_stock">
+
+ <?php if (($this->view['data']['stock']) > '0') {?>
+
+ <label><?php echo __('Lagerbestand', 'wpsg'); ?></label>
+ <?php echo wpsg_translate(__('#1# Artikel auf Lager','wpsg'), $this->view['data']['stock']); ?>
+
+ <?php } else { ?>
+
+ <label><?php echo wpsg_translate(__('', 'wpsg')); ?></label>
+
+ <?php } ?>
+
+ </div>
+ <?php } ?>
+ <?php /* Lagerbestand ENDE*/?>
+
+ <?php /* Füllmengenanzeige START */ ?>
+ <?php if ($this->hasMod('wpsg_mod_fuellmenge')) { ?>
+
+ <div class="wpsg_produkt_fuellmenge">
+
+ <?php if (($this->view['data']['fmenge']) > '0') { ?>
+
+ <span class="label label_fuellmenge"><?php echo wpsg_translate(__('Füllmenge:', 'wpsg')); ?></span>
+
+ <?php echo wpsg_translate(__('#1# (#2# / #3#)', 'wpsg'),
+ '<span class="wpsg_fmenge">'.wpsg_ff($this->view['data']['fmenge'], '', true).'</span> '.$this->view['data']['feinheit'],
+ '<span class="fmenge_preis">'.wpsg_ff($this->view['data']['fmenge_preis'], $this->get_option('wpsg_currency')).'</span> ',
+ wpsg_ff($this->get_option('wpsg_mod_fuellmenge_bezug'), $this->view['data']['feinheit'])
+ ); ?>
+
+ <?php } else { ?>
+
+ <label><?php echo wpsg_translate(__('', 'wpsg')); ?></label>
+
+ <?php } ?>
+
+ </div>
+
+ <?php } ?>
+ <?php /* Füllmengenanzeige ENDE */ ?>
+
+ <?php /* Gewichtsanzeige START */ ?>
+ <?php if ($this->hasMod('wpsg_mod_weight') && $this->get_option('wpsg_mod_weight_showProduct') === '1') { ?>
+ <div class="wpsg_mod_weight_produkt">
+
+ <?php if (($this->view['data']['weight']) > '0') { ?>
+ <span class="label label_weight"><?php echo wpsg_translate(__('Gewicht:', 'wpsg')); ?></span>
+ <?php echo wpsg_translate(__('#1# #2#', 'wpsg'), '<span class="wpsg_weight" id="weight_'.$this->view['data']['id'].'">'.wpsg_ff($this->view['data']['weight']).'</span>', $this->get_option('wpsg_mod_weight_unit')); ?>
+ <?php } else { ?>
+ <label><?php wpsg_translate(__('', 'wpsg'))?></label>
+ <?php } ?>
+ </div>
+ <?php } ?>
+ <?php /* Gewichtsanzeige ENDE */ ?>
+
+ <?php /* Lieferzeit Anzeige START */ ?>
+ <?php if ($this->hasMod('wpsg_mod_deliverytime') && $this->get_option('wpsg_mod_deliverytime_show_product') == '1') { ?>
+
+ <?php /* Produkt nur im Store, nicht im Onlineshop vorhanden */ ?>
+ <?php if ($this->callMod('wpsg_mod_deliverytime', 'isStoreProduct', array($this->view['data']['product_key']))) { ?>
+
+ <div class="wpsg_product_only_store"><?php echo __($this->callMod('wpsg_mod_deliverytime', 'displayStoreText', array($this->view['data']['product_key']))); ?></div>
+
+ <?php $stl = 0; $stl = $this->callMod('wpsg_mod_deliverytime', 'displayStoreLink', array($this->view['data']['product_key'])) ?>
+ <?php if (wpsg_isSizedInt($stl)) { ?>
+
+ <a href="<?php echo get_permalink($stl); ?>"><?php echo __('So erreichen Sie uns.'); ?></a>
+
+ <?php } ?>
+
+ <?php } else { ?>
+
+ <?php $strDelayNote = $this->callMod('wpsg_mod_deliverytime', 'displayDelayTime', array($this->view['data']['product_key'])); ?>
+ <?php if (wpsg_isSizedString($strDelayNote)) { ?>
+
+ <div class="wpsg_mod_deliverytime_offline">
+
+ <div class="wpsg_mod_deliverytime_delay"><?php echo wpsg_hspc($strDelayNote); ?></div>
+
+ </div>
+
+ <?php } else { ?>
+
+ <div class="wpsg_mod_deliverytime">
+ <span class="label label_deliverytime"><?php echo wpsg_translate(__('Lieferzeit:', 'wpsg')); ?></span>
+ <?php echo $this->callMod('wpsg_mod_deliverytime', 'displayDeliveryTime', array($this->view['data']['product_key'])); ?>
+ </div>
+
+ <?php } ?>
+
+ <?php } ?>
+
+ <?php } ?>
+ <?php /* Lieferzeit Anzeige ENDE */ ?>
+
+ <?php /* Produktkurzbeschreibung START */ ?>
+ <div class="wpsg_product_informationarea">
+
+ <?php if (strlen(trim($this->view['data']['beschreibung'])) > 0) { ?>
+ <div class="wpsg_product_information_short">
+ <div class="wpsg_produkt_additional_information">
+ <div itemprop="description" class="wpsg_produkt_shortdescription">
+ <span><?php echo $this->view['data']['beschreibung']; ?></span>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ </div>
+ <?php /* Produktkurzbeschreibung ENDE */ ?>
+
+ <?php /* Varianten START */ ?>
+ <div class="wpsg_produkt_varianten">
+ <?php echo $this->callMod('wpsg_mod_productvariants', 'renderTemplate', array($this->view['data']['product_key'])); ?>
+ </div>
+ <?php /* Varianten ENDE */ ?>
+
+ <?php $this->callMods('product_bottom', array(&$this->view['data']['product_key'], $this->getTemplateIndex())); ?>
+
+ <?php /* Flächenprodukt */ ?>
+ <?php if ($ap['set'] === 1) { ?>
+ <?php $this->render(WPSG_PATH_VIEW.'mods/mod_printshop/product.phtml'); ?>
+ <?php } ?>
+
+ <div class="wpsg_product_buttonarea">
+ <div class="wpsg_product_buttons_add_basket">
+ <?php if ($this->view['oProduct']->canOrder()) { ?>
+ <div class="wpsg_produkt_add_basket_wrapper">
+
+ <label class="wpsg_amount_label" for="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>"><?php echo __('Anzahl', 'wpsg'); ?></label>
+
+ <input type="text" value="<?php echo ((wpsg_isSizedInt($this->view['data']['menge']))?$this->view['data']['menge']:'1'); ?>" name="wpsg[menge]" class="wpsg_menge" id="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>" <?php echo (($this->view['data']['basket_multiple'] == 4)?' readonly="readonly" ':''); ?> />
+
+ <?php /* Urlaubsmodus aktiv */ ?>
+ <?php if ($this->hasMod('wpsg_mod_deliverytime') && ($this->get_option('wpsg_mod_deliverytime_holiday') == '1')) { ?>
+
+ <?php if ($this->callMod('wpsg_mod_deliverytime', 'holiday', array($this->view['data']['product_key']))) { ?>
+
+ <div class="wpsg_product_deliverytime_holiday" style="height:50px; padding:10px; width:50%; float:right; border:1px solid #ff0000;">
+
+ <?php echo __($this->callMod('wpsg_mod_deliverytime', 'displayHolidaytext', array($this->view['data']['product_key']))); ?>
+
+ </div>
+
+ <?php } ?>
+
+ <?php } else {?>
+
+ <input class="wpsg_button wpsg_add_basket wpsg_add_basket_<?php echo $this->getTemplateIndex(); ?>" type="submit" value="<?php echo __('In den Warenkorb', 'wpsg'); ?>" name="wpsg[submit]" />
+
+ <?php } ?>
+
+ <?php if (in_array($this->get_option('wpsg_afterinsert'), array('2', '3'))) { ?>
+ <script type="text/javascript">
+
+ jQuery(document).ready(function() {
+
+ jQuery('.wpsg_add_basket_<?php echo $this->getTemplateIndex(); ?>').bind('click', function() {
+
+ wpsg_blockProductTemplate(<?php echo $this->getTemplateIndex(); ?>);
+
+ jQuery.ajax( {
+ url: '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET); ?>',
+ data: {
+ 'wpsg_form_data': jQuery('#wpsg_produktform_<?php echo $this->getTemplateIndex(); ?>').serialize(),
+ 'wpsg[ajax]': '1',
+ 'wpsg[submit]': '1'
+ },
+ success: function(data) {
+
+ wpsg_refreshBasketWidget();
+
+ <?php if ($this->get_option('wpsg_afterinsert') == '2') { ?>
+
+ tb_show('<?php echo __('Ihr Warenkorb', 'wpsg'); ?>', '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET_AJAX); ?>&height=500');
+
+ <?php } else { ?>
+
+ jQuery('body').append(data);
+
+ <?php } ?>
+
+ wpsg_unblockProductTemplate(<?php echo $this->getTemplateIndex(); ?>);
+
+ }
+ } );
+
+ return false;
+
+ } );
+
+ } );
+
+ </script>
+ <?php } ?>
+
+ </div>
+ <?php } ?>
+ </div>
+ </div>
+
+ <div class="wpsg_clear"></div>
+
+ <?php if ($this->hasMod('wpsg_mod_request') && $this->callMod('wpsg_mod_request', 'isRequestProduct', array($this->view['data']['id']))) { ?>
+ <label class="wpsg_amount_label" for="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>"><?php echo __('Anzahl', 'wpsg'); ?></label>
+ <input type="text" value="<?php echo ((wpsg_isSizedInt($this->view['data']['menge']))?$this->view['data']['menge']:'1'); ?>" name="wpsg[menge]" class="wpsg_menge" id="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>" <?php echo (($this->view['data']['basket_multiple'] == 4)?' readonly="readonly" ':''); ?> />
+
+ <input class="wpsg_button wpsg_add_requestlist" id="wpsg_add_requestlist_<?php echo $this->getTemplateIndex(); ?>" type="submit" value="<?php echo __('Auf die Anfrageliste', 'wpsg'); ?>" name="wpsg[submit_request]" />
+ <?php } ?>
+
+ <?php /* Produktlangbeschreibung START */ ?>
+ <div class="wpsg_product_informationarea">
+
+ <?php if (strlen(trim($this->view['data']['longdescription'])) > 0) { ?>
+ <div class="wpsg_product_information_large">
+ <div class="wpsg_produkt_additional_information">
+ <div itemprop="description" class="wpsg_produkt_longdescription">
+ <span><?php echo $this->view['data']['longdescription']; ?></span>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ </div>
+ <?php /* Produktlangbeschreibung ENDE */ ?>
+
+ <?php /* zusätzliche Informationen START */ ?>
+ <div class="wpsg_product_informationarea">
+
+ <?php if (strlen(trim($this->view['data']['moreinfos'])) > 0) { ?>
+ <div class="wpsg_product_information_large">
+ <div class="wpsg_produkt_additional_information">
+ <div itemprop="description" class="wpsg_produkt_moreinfos">
+ <span><?php echo $this->view['data']['moreinfos']; ?></span>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ </div>
+ <?php /* zusätzliche Informationen ENDE */ ?>
+
+ <?php /* zusätzliche Lieferumfang START */ ?>
+ <div class="wpsg_product_informationarea">
+
+ <?php if (strlen(trim($this->view['data']['moreinfos2'])) > 0) { ?>
+ <div class="wpsg_product_information_large">
+ <div class="wpsg_produkt_additional_information">
+ <div itemprop="description" class="wpsg_produkt_moreinfos2">
+ <span><?php echo $this->view['data']['moreinfos2']; ?></span>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ </div>
+ <?php /* zusätzliche Lieferumfang ENDE */ ?>
+
+ <div class="wpsg_clear"></div>
+
+ <?php /* Social Media Integration */ ?>
+ <div class="wpsg_product_social_media">
+ <?php if (is_plugin_active('plugin-directory/shariff.php')) {?>
+ <?php echo do_shortcode('[shariff]')?>
+ <?php } ?>
+ </div>
+
+ </div>
+
+</div>
\ No newline at end of file diff --git a/views/mods/mod_printshop/produkt_addedit_content.phtml b/views/mods/mod_printshop/produkt_addedit_content.phtml new file mode 100644 index 0000000..20f2a8c --- /dev/null +++ b/views/mods/mod_printshop/produkt_addedit_content.phtml @@ -0,0 +1,236 @@ +<?php
+
+ declare(strict_types=1);
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 14.01.2020
+ * Time: 07:35
+ */
+
+ $view = $this->view['wpsg_mod_printshop'];
+
+ $arMode = [
+ wpsg_mod_printshop::MODE_AREA => __('Flächenprodukt, freie Eingabe von Breite/Länge im Frontend', 'wpsg'),
+ wpsg_mod_printshop::MODE_AREA_SELECT => __('Flächenprodukt, definierte Auswahl von Breite/Länge im Frontend', 'wpsg'),
+ wpsg_mod_printshop::MODE_LFM => __('Flächenprodukt, freie Eingabe der Laufmeter im Frontend', 'wpsg'),
+ wpsg_mod_printshop::MODE_LFM_SELECT => __('Flächenprodukt, definierte Auswahl der Laufmeter im Frontend', 'wpsg')
+ ];
+
+ if (!isset($view['mode'])) $view['mode'] = wpsg_mod_printshop::MODE_AREA;
+ if (!isset($view['unit_price'])) $view['unit_price'] = 'm';
+
+ if (!isset($view['width_step'])) $view['width_step'] = 10; else $view['width_step'] = $view['width_step'];
+ if (!isset($view['width_min'])) $view['width_min'] = 10; else $view['width_min'] = $view['width_min'];
+ if (!isset($view['width_max'])) $view['width_max'] = 100; else $view['width_max'] = $view['width_max'];
+
+ if (!isset($view['length_step'])) $view['length_step'] = 10; else $view['length_step'] = $view['length_step'];
+ if (!isset($view['length_min'])) $view['length_min'] = 10; else $view['length_min'] = $view['length_min'];
+ if (!isset($view['length_max'])) $view['length_max'] = 100; else $view['length_max'] = $view['length_max'];
+
+ if (!isset($view['width'])) $view['width'] = 1000; else $view['width'] = wpsg_tf($view['width']);
+
+?>
+
+<?php echo wpsg_drawForm_AdminboxStart(__('Druckereiprodukt', 'wpsg')); ?>
+
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_printshop[set]', __('Produkt als Flächenprodukt behandeln'), $view['set']); ?>
+
+ <div class="wpsg_mod_printshop wpsg_mod_printshop_1" style="display:none;">
+
+ <?php echo wpsg_drawForm_Select('wpsg_mod_printshop[mode]', __('Modus'), $arMode, $view['mode']); ?>
+
+ <br />
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_printshop[unit_price]', __('Einheit (Ohne ²)'), $view['unit_price']); ?>
+
+ <div class="wpsg_mod_printshop_mode wpsg_mod_printshop_mode_<?php echo wpsg_mod_printshop::MODE_AREA; ?>">
+
+ </div>
+
+ <div class="wpsg_mod_printshop_mode wpsg_mod_printshop_mode_<?php echo wpsg_mod_printshop::MODE_AREA_SELECT; ?>">
+
+ <br />
+
+ <div class="form-group form-group-sm">
+ <label class="col-sm-6 control-label"></label>
+ <div class="col-sm-6">
+
+ <div class="row">
+ <div class="col col-sm-4">
+ <?php echo __('Schritte', 'wpsg'); ?>
+ </div>
+ <div class="col col-sm-4">
+ <?php echo __('min.', 'wpsg'); ?>
+ </div>
+ <div class="col col-sm-4">
+ <?php echo __('max.', 'wpsg'); ?>
+ </div>
+ </div>
+
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <div class="form-group form-group-sm">
+ <label class="col-sm-6 control-label"><?php echo __('Breite', 'wpsg'); ?></label>
+ <div class="col-sm-6">
+
+ <div class="row">
+ <div class="col col-sm-4">
+ <input type="number" value="<?php echo $view['width_step']; ?>" name="wpsg_mod_printshop[width_step]" class="wpsg_mod_printshop_input" />
+ </div>
+ <div class="col col-sm-4">
+ <input type="number" value="<?php echo $view['width_min']; ?>" name="wpsg_mod_printshop[width_min]" class="wpsg_mod_printshop_input" />
+ </div>
+ <div class="col col-sm-4">
+ <input type="number" value="<?php echo $view['width_max']; ?>" name="wpsg_mod_printshop[width_max]" class="wpsg_mod_printshop_input" />
+ </div>
+ </div>
+
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <div class="form-group form-group-sm">
+ <label class="col-sm-6 control-label"><?php echo __('Länge', 'wpsg'); ?></label>
+ <div class="col-sm-6">
+
+ <div class="row">
+ <div class="col col-sm-4">
+ <input type="number" value="<?php echo $view['length_step']; ?>" name="wpsg_mod_printshop[length_step]" class="wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+ </div>
+ <div class="col col-sm-4">
+ <input type="number" value="<?php echo $view['length_min']; ?>" name="wpsg_mod_printshop[length_min]" class="wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+ </div>
+ <div class="col col-sm-4">
+ <input type="number" value="<?php echo $view['length_max']; ?>" name="wpsg_mod_printshop[length_max]" class="wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+ </div>
+ </div>
+
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ </div>
+
+ <div class="wpsg_mod_printshop_mode wpsg_mod_printshop_mode_<?php echo wpsg_mod_printshop::MODE_LFM; ?>">
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_printshop[width]', __('Breite für Preisberechnung'), wpsg_ff($view['width'], false, true, 0), ['input_class' => 'wpsg_mod_printshop_input_same']); ?>
+
+ </div>
+
+ <div class="wpsg_mod_printshop_mode wpsg_mod_printshop_mode_<?php echo wpsg_mod_printshop::MODE_LFM_SELECT; ?>">
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_printshop[width]', __('Breite für Preisberechnung'), wpsg_ff($view['width'], false, true, 0), ['input_class' => 'wpsg_mod_printshop_input_same']); ?>
+
+ <br />
+
+ <div class="form-group form-group-sm">
+ <label class="col-sm-6 control-label"></label>
+ <div class="col-sm-6">
+
+ <div class="row">
+ <div class="col col-sm-4">
+ <?php echo __('Schritte', 'wpsg'); ?>
+ </div>
+ <div class="col col-sm-4">
+ <?php echo __('min.', 'wpsg'); ?>
+ </div>
+ <div class="col col-sm-4">
+ <?php echo __('max.', 'wpsg'); ?>
+ </div>
+ </div>
+
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <div class="form-group form-group-sm">
+ <label class="col-sm-6 control-label"><?php echo __('Länge', 'wpsg'); ?></label>
+ <div class="col-sm-6">
+
+ <div class="row">
+ <div class="col col-sm-4">
+ <input type="number" value="<?php echo $view['length_step']; ?>" name="wpsg_mod_printshop[length_step]" class="wpsg_mod_printshop_same wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+ </div>
+ <div class="col col-sm-4">
+ <input type="number" value="<?php echo $view['length_min']; ?>" name="wpsg_mod_printshop[length_min]" class="wpsg_mod_printshop_same wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+ </div>
+ <div class="col col-sm-4">
+ <input type="number" value="<?php echo $view['length_max']; ?>" name="wpsg_mod_printshop[length_max]" class="wpsg_mod_printshop_same wpsg_mod_printshop_input wpsg_mod_printshop_input_same" />
+ </div>
+ </div>
+
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ </div>
+
+ <br />
+
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_printshop[productupload_set]', __('Bestellupload ermöglichen', 'wpsg'), (($view['productupload_set'])?true:false)); ?>
+
+ <div class="wpsg_mod_printshop_productupload_set_1" style="<?php echo (($view['wpsg_mod_printshop[productupload_set]'] === true)?'display:block;':'display:none;'); ?>">
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_printshop[productupload_length]', __('Maximale Anzahl an Uploads'), $view['productupload_length']); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_printshop[productupload_mandatory]', __('Pflichtfeld'), $view['productupload_mandatory']); ?>
+
+ </div>
+
+ </div>
+
+<?php echo wpsg_drawForm_AdminboxEnd(); ?>
+
+<style>
+
+ .wpsg_mod_printshop_input { width:100%; }
+
+</style>
+
+<script>
+
+ jQuery(document).ready(function() {
+
+ jQuery('#wpsg_mod_printshop_productupload_set').on('change', function() {
+
+ if (jQuery(this).prop('checked') === true) {
+
+ jQuery('.wpsg_mod_printshop_productupload_set_1').show();
+ jQuery('#wpsg_mod_printshop_productupload_length').focus();
+
+ } else {
+
+ jQuery('.wpsg_mod_printshop_productupload_set_1').hide();
+
+ }
+
+ } ).change();
+
+ jQuery('.wpsg_mod_printshop_input_same').on('input', function() {
+
+ var jqThis = jQuery(this);
+
+ jQuery('.wpsg_mod_printshop_input_same[name="' + jqThis.attr("name") + '"]').val(jqThis.val());
+ console.log((jqThis.val()));
+
+ });
+
+ jQuery('#wpsg_mod_printshopmode').on('change', function() {
+
+ jQuery('.wpsg_mod_printshop_mode').hide();
+ jQuery('.wpsg_mod_printshop_mode_' + jQuery(this).val()).show().find('input').first().focus();
+
+ }).change();
+
+ jQuery('#wpsg_mod_printshopset').on('change', function() {
+
+ jQuery('.wpsg_mod_printshop').hide();
+ jQuery('.wpsg_mod_printshop_' + ((jQuery(this).prop('checked'))?'1':'0')).show();
+
+ }).change();
+
+ } );
+
+</script>
\ No newline at end of file diff --git a/views/mods/mod_printshop/settings_edit.phtml b/views/mods/mod_printshop/settings_edit.phtml new file mode 100644 index 0000000..eb3229e --- /dev/null +++ b/views/mods/mod_printshop/settings_edit.phtml @@ -0,0 +1,11 @@ +<?php
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 14.01.2020
+ * Time: 07:30
+ */
+
+ declare(strict_types=1);
+
+
diff --git a/views/warenkorb/checkout.phtml b/views/warenkorb/checkout.phtml index 5c87af4..5e0ebcf 100644 --- a/views/warenkorb/checkout.phtml +++ b/views/warenkorb/checkout.phtml @@ -6,6 +6,7 @@ */
//wpsg_debug($this->view);
+
?>
<script type="text/javascript">/* <![CDATA[ */
diff --git a/views/warenkorb/checkout2.phtml b/views/warenkorb/checkout2.phtml index adf49c2..4e5b205 100644 --- a/views/warenkorb/checkout2.phtml +++ b/views/warenkorb/checkout2.phtml @@ -69,7 +69,7 @@ <img class="wpsg_payship_logo" src="<?php echo $p['logo']; ?>" alt="<?php echo $p['name']; ?>" />
<?php } ?>
- <?php if ((isset($p['hint']) && trim($p['hint']) != '') || $p['price'] > 0) { ?>
+ <?php if ((isset($p['hint']) && trim($p['hint']) != '') || wpsg_getFloat($p['price']) > 0) { ?>
<div id="payment_<?php echo $p['id']; ?>_hint" class="shippay_hint">
<?php if ($p['price'] > 0) { ?>
<?php echo __('Gebühr', 'wpsg'); ?>: <?php echo wpsg_ff($p['price'], $this->get_option('wpsg_currency')); ?><br />
diff --git a/views/warenkorb/index.phtml b/views/warenkorb/index.phtml index 2bcccf1..17f9f07 100644 --- a/views/warenkorb/index.phtml +++ b/views/warenkorb/index.phtml @@ -120,4 +120,6 @@ <?php } ?>
</ul>
-</aside>
\ No newline at end of file +</aside>
+
+<?php wpsg_debug($_SESSION['wpsg']); ?>
\ No newline at end of file |
