Skip to content

Commit

Permalink
added currency switcher to product edit page
Browse files Browse the repository at this point in the history
  • Loading branch information
BigAndini committed Feb 27, 2017
1 parent f1c7d82 commit a558799
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
10 changes: 5 additions & 5 deletions module/ErsBase/src/ErsBase/Service/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,18 @@ public function changeCurrency($paramCurrency) {
$item->setPrice($price->getCharge());
$em->flush($item);
}
$em->flush($package);
}
$order->setCurrency($currency);
if($debug) {
error_log('set order to currency: '.$currency);
}
if($order->getPaymentType()) {
$order->setPaymentType(null);
}
$em->flush($order);
}
if($order->getPaymentType()) {
$order->setPaymentType(null);
}
$em->flush($order);

error_log('currency changed!');
return $this;
}

Expand Down
2 changes: 0 additions & 2 deletions module/PreReg/src/PreReg/Controller/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,6 @@ public function editAction() {
public function deleteAction() {
$logger = $this->getServiceLocator()->get('Logger');

$breadcrumbService = new Service\BreadcrumbService();

$breadcrumbService = new Service\BreadcrumbService();

if(!$breadcrumbService->exists('product')) {
Expand Down
1 change: 0 additions & 1 deletion module/PreReg/view/pre-reg/product/add.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
<div class="col-md-6">
<?php if($product->getPriceCount() != 1): ?>
<p class="small text-right"><?php echo sprintf($this->translate('The prices will increase after <br /> %s'), $deadline->getDeadline()->format('d.m.Y H:i:s T')); ?></p>
<p clas="text-right">
<p class="text-right">
<?php echo $this->partial('partial/currency-chooser.phtml', array('form' => $this->currencychooser())); ?>
</p>
Expand Down
12 changes: 4 additions & 8 deletions module/PreReg/view/pre-reg/product/edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
<?php
$form = $this->form;
$form->prepare();
$form->get('submit')->setAttribute('value', 'save changes');
$form->get('submit')->setAttribute('value', 'save changes'); ?>

echo $this->form()->openTag($form); ?>
<div class="row">
<div class="col-md-5" style="text-align: center; margin: 20px 0;">
<i class="fa fa-ticket product-icon-lg"></i>
Expand All @@ -38,17 +37,14 @@
<?php if($product->getPriceCount() != 1): ?>
<p class="small text-right"><?php echo $this->translate('The prices will increase after'); ?><br><?php echo $deadline->getDeadline()->format('d.m.Y H:i:s T'); ?></p>
<p class="text-right">
Show prices in:
<select name="currency">
<option>Euro</option>
<option>Zloty</option>
</select>
<?php echo $this->partial('partial/currency-chooser.phtml', array('form' => $this->currencychooser())); ?>
</p>
<?php endif; ?>
<?php echo $this->partial('partial/product-price.phtml', array('agegroups' => $agegroups, 'deadline' => $deadline, 'product' => $product)); ?>
</div>
</div>
<div class="row">
<?php echo $this->form()->openTag($form); ?>
<div class="col-md-6 ui-tabs-panel ui-widget-content ui-corner-all">
<div id="person-detail">
<ul>
Expand Down Expand Up @@ -125,10 +121,10 @@
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php echo $this->form()->closeTag(); ?>
</div>
</div>
</div>
<?php echo $this->form()->closeTag(); ?>
</div>
<div id="addParticipant" class="modal fade" role="dialog">
<div class="modal-dialog">
Expand Down

0 comments on commit a558799

Please sign in to comment.