- Posts: 18
- Thank you received: 0
Re: An "old price" field
Could you tell me is there an "old price" field. I mean, you can fill this field and on product's page you can see an old price, which was struck off (or something else...), and below is displayed a new one price.
If it's not provided, could you give me a hint of how to make this in a right way.
Please Log in or Create an account to join the conversation.
To do this, you can create a new custom field on the table "Product" and then, in the product edition page you can set the old price in this custom field.
You can find some documentation about custom fields here:
www.hikashop.com/en/support/documentatio...p-field-listing.html
Then you just have to edit the view "product / show_default" to display the field as you want.
Please Log in or Create an account to join the conversation.
Old price: [strike]800[/strike]
New price: 900
Or did I understand something wrong?
Please Log in or Create an account to join the conversation.
Some edition in the view file and css customization are needed.
Please Log in or Create an account to join the conversation.
if($this->params->get('old_price')==2||!$this->params->get('old_price')){
echo $this->currencyHelper->format($price->old_price,$price->price_currency_id);
Please Log in or Create an account to join the conversation.
New question is: is it possible to display an "old price" field not on the product's page, but on page where multiple products are shown? I tried to do it in this way:
in listing price add
Please Log in or Create an account to join the conversation.
To add the price in the product show page, you can use this kind of code:
To add under the code:
In the product listing, you just have to add the line:
Inthese examples your customfield must be named "old_price" you can replace "old_price" by your custome field name.
Please Log in or Create an account to join the conversation.
echo $this->row->old_price, EUR;
New price: 15 EUR
[strike]Old price: 25 EUR[/strike]
This variant AMAZING
A big thank you.
Please Log in or Create an account to join the conversation.
Could you please explain what you have now and what you want ?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Then, instead of:
echo $this->row->old_price, EUR;
you can use:
echo '<br/>'.$this->row->old_price, EUR;
Please Log in or Create an account to join the conversation.
I cant find the settings
if ($this->params->get('show_price')) {
$this->row = & $this->element;
$this->setLayout('listing_price');
echo $this->loadTemplate();
}
Please Log in or Create an account to join the conversation.
This code changed a bit and is now:
Please Log in or Create an account to join the conversation.
But how do i add 2 custom items there?
i added
<?php
echo $this->row->gratisgemonteerd;
echo $this->row->gratisgeleverd;
?>
But how do i add a break.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
If you want to add a separation between both prices you'll just have to use that kind of code :
Kind regards,
Mohamed Thelji.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Replace the YOUR_SEPARATION_TEXT in the code example of Mohamed by <br/> and you'll have them one on each line.
If you want something else, it would require some additional HTML tags with classes and CSS so that the texts could be styled.
You might want to contact our partners if you which for someone to help you with such customization:
www.hikashop.com/home/our-partners.html
Please Log in or Create an account to join the conversation.