Hi,
First, I would recommend doing as little modifications as you can via view overrides.
For example, you have the prices on different lines, you don't need to change anything in the view override.
You can just add custom CSS to your website.
For example:
.hikashop_product_discount, .hikashop_product_price_before_discount, .hikashop_product_price_with_discount { display: block; }
Similarly, to remove the "each" word, you don't need to change anything in the view override. You can change that text with a translation override:
www.hikashop.com/download/languages.html#modify
In fact, you can also add extra texts with translation overrides too, for example, with the translation key PRICE_DISCOUNT_START
Now regarding moving the order of the display of the prices, that can only be done with a view override.
And it's actually not that easy if you don't know PHP.
It would require changing the code:
if(!empty($this->row->discount)) {
if(in_array($this->params->get('show_discount'), array(1, 4))) {
echo '<span class="hikashop_product_discount">'.JText::_('PRICE_DISCOUNT_START').'<span class="hikashop_product_discount_amount">';
if(bccomp($this->row->discount->discount_flat_amount, 0, 5) !== 0) {
echo $this->currencyHelper->format( -1 * $this->row->discount->discount_flat_amount, $price->price_currency_id);
} elseif(bccomp($this->row->discount->discount_percent_amount, 0, 5) !== 0) {
echo -1*$this->row->discount->discount_percent_amount.'%';
}
echo '</span>'.JText::_('PRICE_DISCOUNT_END').'</span>';
}
if(in_array($this->params->get('show_discount'), array(2, 4))) {
echo '<span class="hikashop_product_price_before_discount">'.JText::_('PRICE_DISCOUNT_START').'<span class="hikashop_product_price_before_discount_amount">';
if($this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_value_without_discount_with_tax, $price->price_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax') == 2 || !$this->params->get('price_with_tax')) {
echo $this->currencyHelper->format($price->price_value_without_discount, $price->price_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_AFTER_TAX');
}
if($this->params->get('show_original_price') && !empty($price->price_orig_value_without_discount_with_tax)) {
echo JText::_('PRICE_BEFORE_ORIG');
if($this->params->get('price_with_tax')) {
echo $this->currencyHelper->format($price->price_orig_value_without_discount_with_tax, $price->price_orig_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax') == 2 || !$this->params->get('price_with_tax') && !empty($price->price_orig_value_without_discount)) {
echo $this->currencyHelper->format($price->price_orig_value_without_discount, $price->price_orig_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_AFTER_TAX');
}
echo JText::_('PRICE_AFTER_ORIG');
}
echo '</span>'.JText::_('PRICE_DISCOUNT_END').'</span>';
} elseif($this->params->get('show_discount') == 3) {
}
}
$attributes = '';
if(!empty($this->element->product_id) && !$microDataForCurrentProduct) {
$round = $this->currencyHelper->getRounding($price->price_currency_id, true);
$prefix = 'data-';
$microDataForCurrentProduct = true;
if(empty($this->displayed_price_microdata)) {
$this->displayed_price_microdata = true;
$prefix = '';
}
if($this->params->get('price_with_tax')) {
$price_attributes = str_replace(',','.',$this->currencyHelper->round($price->price_value_with_tax, $round, 0, true));
} else {
$price_attributes = str_replace(',','.',$this->currencyHelper->round($price->price_value, $round, 0, true));
}
$this->itemprop_price = new stdClass();
$this->itemprop_price = $price_attributes .'';
}
echo '<span class="'.implode(' ',$classes).'">';
if($this->params->get('price_with_tax')) {
echo $this->currencyHelper->format(@$price->price_value_with_tax, $price->price_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax') == 2 || !$this->params->get('price_with_tax')) {
echo $this->currencyHelper->format(@$price->price_value, $price->price_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_AFTER_TAX');
}
if($this->params->get('show_original_price') && !empty($price->price_orig_value)) {
echo JText::_('PRICE_BEFORE_ORIG');
if($this->params->get('price_with_tax')) {
echo $this->currencyHelper->format($price->price_orig_value_with_tax, $price->price_orig_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax') == 2 || !$this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_orig_value, $price->price_orig_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_AFTER_TAX');
}
echo JText::_('PRICE_AFTER_ORIG');
}
echo '</span> ';
to:
if(!empty($this->row->discount)) {
if(in_array($this->params->get('show_discount'), array(2, 4))) {
echo '<span class="hikashop_product_price_before_discount">'.JText::_('PRICE_DISCOUNT_START').'<span class="hikashop_product_price_before_discount_amount">';
if($this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_value_without_discount_with_tax, $price->price_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax') == 2 || !$this->params->get('price_with_tax')) {
echo $this->currencyHelper->format($price->price_value_without_discount, $price->price_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_AFTER_TAX');
}
if($this->params->get('show_original_price') && !empty($price->price_orig_value_without_discount_with_tax)) {
echo JText::_('PRICE_BEFORE_ORIG');
if($this->params->get('price_with_tax')) {
echo $this->currencyHelper->format($price->price_orig_value_without_discount_with_tax, $price->price_orig_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax') == 2 || !$this->params->get('price_with_tax') && !empty($price->price_orig_value_without_discount)) {
echo $this->currencyHelper->format($price->price_orig_value_without_discount, $price->price_orig_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_AFTER_TAX');
}
echo JText::_('PRICE_AFTER_ORIG');
}
echo '</span>'.JText::_('PRICE_DISCOUNT_END').'</span>';
} elseif($this->params->get('show_discount') == 3) {
}
echo '<span class="'.implode(' ',$classes).'">';
if($this->params->get('price_with_tax')) {
echo $this->currencyHelper->format(@$price->price_value_with_tax, $price->price_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax') == 2 || !$this->params->get('price_with_tax')) {
echo $this->currencyHelper->format(@$price->price_value, $price->price_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_AFTER_TAX');
}
if($this->params->get('show_original_price') && !empty($price->price_orig_value)) {
echo JText::_('PRICE_BEFORE_ORIG');
if($this->params->get('price_with_tax')) {
echo $this->currencyHelper->format($price->price_orig_value_with_tax, $price->price_orig_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax') == 2 || !$this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_orig_value, $price->price_orig_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_AFTER_TAX');
}
echo JText::_('PRICE_AFTER_ORIG');
}
echo '</span> ';
if(in_array($this->params->get('show_discount'), array(1, 4))) {
echo '<span class="hikashop_product_discount">'.JText::_('PRICE_DISCOUNT_START').'<span class="hikashop_product_discount_amount">';
if(bccomp($this->row->discount->discount_flat_amount, 0, 5) !== 0) {
echo $this->currencyHelper->format( -1 * $this->row->discount->discount_flat_amount, $price->price_currency_id);
} elseif(bccomp($this->row->discount->discount_percent_amount, 0, 5) !== 0) {
echo -1*$this->row->discount->discount_percent_amount.'%';
}
echo '</span>'.JText::_('PRICE_DISCOUNT_END').'</span>';
}
}
else {
echo '<span class="'.implode(' ',$classes).'">';
if($this->params->get('price_with_tax')) {
echo $this->currencyHelper->format(@$price->price_value_with_tax, $price->price_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax') == 2 || !$this->params->get('price_with_tax')) {
echo $this->currencyHelper->format(@$price->price_value, $price->price_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_AFTER_TAX');
}
if($this->params->get('show_original_price') && !empty($price->price_orig_value)) {
echo JText::_('PRICE_BEFORE_ORIG');
if($this->params->get('price_with_tax')) {
echo $this->currencyHelper->format($price->price_orig_value_with_tax, $price->price_orig_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax') == 2 || !$this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_orig_value, $price->price_orig_currency_id);
}
if($this->params->get('price_with_tax') == 2) {
echo JText::_('PRICE_AFTER_TAX');
}
echo JText::_('PRICE_AFTER_ORIG');
}
echo '</span> ';
}
$attributes = '';
if(!empty($this->element->product_id) && !$microDataForCurrentProduct) {
$round = $this->currencyHelper->getRounding($price->price_currency_id, true);
$prefix = 'data-';
$microDataForCurrentProduct = true;
if(empty($this->displayed_price_microdata)) {
$this->displayed_price_microdata = true;
$prefix = '';
}
if($this->params->get('price_with_tax')) {
$price_attributes = str_replace(',','.',$this->currencyHelper->round($price->price_value_with_tax, $round, 0, true));
} else {
$price_attributes = str_replace(',','.',$this->currencyHelper->round($price->price_value, $round, 0, true));
}
$this->itemprop_price = new stdClass();
$this->itemprop_price = $price_attributes .'';
}