summaryrefslogtreecommitdiff
path: root/views/blocks/product-price.phtml
blob: 24b856cc06e1ee0acb7426889972b65b13a00e76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php

	/**
	 * Block „Produktpreis“: Preisangaben eines Produktartikels in einer Abfrage-Schleife (Kategorie-Vorlage)
	 *
	 * Wie eine Kachel der Produktliste ohne Bild und Titel; Bild und Titel kommen aus der Beitragsvorlage.
	 * @version 4.6.1
	 */

	if (!defined('ABSPATH')) exit;

	$arBlock = $this->view['wpsg_block'];
	$oProduct = $arBlock['oProduct'];
	$product_id = intval($oProduct->id);
	$name = $oProduct->getProductName();
	$hint_id = \wpsg\Blocks::kleinunternehmerHintID('price-'.$product_id);

?>
<?php if ($this->canDisplayPrice()) { $price = $oProduct->getPrice($product_id); ?>
<div class="wpsg-product-list__price">
	<?php if ($this->hasMod('wpsg_mod_productvariants') && $this->callMod('wpsg_mod_productvariants', 'isVariantsProduct', [$product_id])) { ?>
		<?php echo wpsg_translate(esc_html__('ab #1#', 'wpsg'), wpsg_price_html($price, 'list')); ?>
	<?php } else { ?>
		<?php echo wpsg_price_html($price, 'list'); ?>
	<?php } ?>
</div>
<?php if ($this->hasMod('wpsg_mod_fuellmenge')) { ?>
<div class="wpsg-product-list__baseprice"><?php echo $this->callMod('wpsg_mod_fuellmenge', 'renderPriceInfo', [$price, $oProduct->__get('fmenge'), $product_id]); ?></div>
<?php } ?>
<div class="wpsg-product-list__taxnote wpsg_produkt_preishinweis"><?php echo \wpsg\Blocks::priceNote($oProduct, $hint_id); ?></div>
<?php echo \wpsg\Blocks::kleinunternehmerHint($hint_id); ?>
<?php } else { ?>
<div class="wpsg-product-list__price"><?php echo esc_html__('Preise nur für eingeloggte Benutzer', 'wpsg'); ?></div>
<?php } ?>

<div class="wpsg-product-list__action">
	<?php if ($arBlock['buy']) { ?>
	<form method="post" action="<?php echo esc_url($this->getCurrentURL()); ?>">
		<input type="hidden" name="wpsg[produkt_id]" value="<?php echo esc_attr((string)$product_id); ?>" />
		<input type="hidden" name="wpsg[menge]" value="1" />
		<input type="hidden" name="myReferer" value="<?php echo esc_attr($this->getCurrentURL()); ?>" />
		<button type="submit" name="wpsg[submit]" value="1" class="wpsg_button wpsg_add_basket<?php echo wpsg_button_class(); ?>"><?php echo esc_html(wpsg_button_text('add_to_basket', __('In den Warenkorb', 'wpsg'))); ?><span class="screen-reader-text"><?php echo esc_html(': '.$name); ?></span></button>
	</form>
	<?php } else { ?>
	<a class="wpsg_button<?php echo wpsg_button_class(); ?>" href="<?php echo esc_url($arBlock['url']); ?>"><?php echo esc_html(wpsg_button_text('to_product', __('Zum Produkt', 'wpsg'))); ?><span class="screen-reader-text"><?php echo esc_html(': '.$name); ?></span></a>
	<?php } ?>
</div>