summaryrefslogtreecommitdiff
path: root/views/warenkorb/progress.phtml
blob: 2a94a55c3b863ce1ee52cf5bd5591760c0fb2aca (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php 

	/**
	 * Fortschrittsbalken
	 * @version 4.6.1
	 */

?>
<?php if (\wpsg\ThemeStyle::isThemeMode()) {

	// Modus „neu“: nummerierte Liste, der aktuelle Schritt mit aria-current (Punkt 8.9)
	$arSteps = [
		1 => [__('Warenkorb', 'wpsg'), $this->getUrl(wpsg_ShopController::URL_BASKET)],
		2 => [__('Kundendaten', 'wpsg'), $this->getURL(wpsg_ShopController::URL_CHECKOUT)],
		3 => [__('Versand/Zahlung', 'wpsg'), $this->getURL(wpsg_ShopController::URL_CHECKOUT2)],
		4 => [__('Abschluss', 'wpsg'), $this->getURL(wpsg_ShopController::URL_OVERVIEW)]
	];
	$current = intval($GLOBALS['step']);

?>
<nav class="wpsg-steps" aria-label="<?php echo esc_attr__('Schritte der Bestellung', 'wpsg'); ?>">
	<ol class="wpsg-steps__list">
		<?php foreach ($arSteps as $nr => $arStep) { $class = (($nr === $current)?'is-current':(($nr < $current)?'is-done':'')); ?>
		<li class="wpsg-steps__step <?php echo esc_attr($class); ?>"<?php echo (($nr === $current)?' aria-current="step"':''); ?>>
			<?php if ($nr < $current) { ?><a href="<?php echo esc_url($arStep[1]); ?>"><?php } ?>
			<span class="wpsg-steps__number"><?php echo esc_html((string)$nr); ?></span>
			<span class="wpsg-steps__label"><?php echo str_replace('/', '/<wbr>', esc_html($arStep[0])); ?></span>
			<?php if ($nr < $current) { ?></a><?php } ?>
		</li>
		<?php } ?>
	</ol>
</nav>
<?php return; } ?>

<div class="wpsg_progress">
      
	<a href="<?php echo $this->getUrl(wpsg_ShopController::URL_BASKET); ?>">      
		<span class="step step1 <?php echo (($GLOBALS['step'] === 1)?'current':'done'); ?>" title="<?php echo __('Hier gelangen Sie zum Warenkorb', 'wpsg'); ?>"><span class="dot"></span><span class="text"><?php echo __('Warenkorb', 'wpsg'); ?></span></span>
	</a>

	<?php if ($GLOBALS['step'] > 1) { ?><a href="<?php echo $this->getURL(wpsg_ShopController::URL_CHECKOUT); ?>"><?php } ?>
	<span class="step step2 <?php echo (($GLOBALS['step'] ===2)?'current':''); ?> <?php echo (($GLOBALS['step'] > 2)?'done':''); ?>" title="<?php echo __('Hier gelangen Sie zum Formular der Kundendaten', 'wpsg'); ?>">
		<span class="dot"></span><span class="text"><?php echo __('Kundendaten', 'wpsg'); ?></span>
	</span>            
	<?php if ($GLOBALS['step'] > 1) { ?></a><?php } ?>
	
	<?php if ($GLOBALS['step'] > 2) { ?><a href="<?php echo $this->getURL(wpsg_ShopController::URL_CHECKOUT2); ?>"><?php } ?>
	<span class="step step3 <?php echo (($GLOBALS['step'] === 3)?'current':''); ?> <?php echo (($GLOBALS['step'] > 3)?'done':''); ?>" title="<?php echo __('Hier gelangen Sie zur Auswahl der Bezahlmethode und der Versandart', 'wpsg'); ?>">
		<span class="dot"></span><span class="text"><?php echo __('Versand/Zahlung', 'wpsg'); ?></span>
	</span>            
	<?php if ($GLOBALS['step'] > 2) { ?></a><?php } ?>
            
	<?php if ($GLOBALS['step'] > 3) { ?><a href="<?php echo $this->getURL(wpsg_ShopController::URL_OVERVIEW); ?>"><?php } ?>
	<span class="step step4 <?php echo (($GLOBALS['step'] === 4)?'current':''); ?> <?php echo (($GLOBALS['step'] > 4)?'done':''); ?>" title="<?php echo __('Hier gelangen Sie zum Bestellübersicht', 'wpsg'); ?>">
		<span class="dot"></span><span class="text"><?php echo __('Abschluss', 'wpsg'); ?></span>
	</span>
	<?php if ($GLOBALS['step'] > 3) { ?></a><?php } ?>

</div>

<div class="wpsg_clear"></div>