Can the Price be displayed as a pair and each

  • Posts: 2
  • Thank you received: 0
11 years 11 months ago #81793

Hi there

Just want to say great but of software but i am trying to work something out

When a product is displayed it has the price as say £45.00 each but i would like to get it to display for some products as £45.00 a pair

is there away to be able to display either a pair or each depending on the product you are selling

Cheers in advance for you help

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #81842

Hi,

Yes it's possible, you have to edit the view "product / listing_price" and where you can find the code"JText::_('PER_UNIT');" add a php condition before.
Check if the product have the ID ..., display PER_UNIT, else display PER_PAIR.

And create a new translation in HikaShop > Configuration > Languages, your language file, something like: PER_PAIR="a pair"

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
11 years 10 months ago #81860

Ok thanks for getting back to me so quickly

im very new to the whole editing of php files so im not 100% sure what i need to add in can you let me know i found the file you said about and the line you are talking about im just not sure what to add in there

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #81989

Hi,

A similar question has already been posted on this forum, I invite you to make a search on that.
If you don't find your answer, then come back here ;)

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
11 years 7 months ago #94937

Ive been trying to do this with no luck. do i have the coding right?

}else{
echo JText::_('PER_UNIT');
if(isset($this->element->main)) echo JText::_($this->element->main->salemethod);
elseif(isset($this->row)) echo JText::_($this->row->salemethod);
else echo JText::_($this->element->salemethod);
}

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #95003

Hi,

You can use:

				}else{
					if(isset($this->row->salemethod)){
						echo $this->row->salemethod;
					}else{
						echo JText::_('PER_UNIT');
					}
				}
If you have a translation for each "salemethod" so you can use:
				}else{
					if(isset($this->row->salemethod)){
						echo JText::_($this->row->salemethod);
					}else{
						echo JText::_('PER_UNIT');
					}
				}

and in the language file, add (for example): PER_PAIR="Per pair" if one of the salemethod value is "PER_PAIR".

Please Log in or Create an account to join the conversation.

  • Posts: 90
  • Thank you received: 1
11 years 7 months ago #95050

Hey John,

I've actually just set up similar logic in our store using this method and also have a custom field on the backend for each product that allows me to set whether it's "Each" or "From" pricing.

The thread is a little bloated with some garbage from me but may contain extra info to help you: www.hikashop.com/en/forum/2-general-talk...ext-after-price.html

Good luck! :laugh:


:) — Josh

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
11 years 7 months ago #95150

Thank you SOOO much guys. Im hoping i can get to the point where i can help people out like you guys have for me. Cheers

Please Log in or Create an account to join the conversation.

Time to create page: 0.107 seconds
Powered by Kunena Forum