Need Liter category and price/liter - SOLVED

  • Posts: 137
  • Thank you received: 2
14 years 3 days ago #1948

Hi,

I am in the process of moving my Virtuemart store to HikaShop due to the easier store administration (VirtueMart has been killing me). I am first evaluating the free version and plan to move to the priced version as soon as I am sure that it works fine.

However, I have one big issue that needs to be resolved. I am selling wine and in Germany there is a strict law that yo need to show the volume/weight unit for each product (in this case Liter) and a so-called basis price (Euro per Liter) on each panel where the price is being shown.

Virtuemart has a solution (you can specify Liter as weight unit) and include a small script in the display pages, dividing the price by the Liter unit (e.g. Liter = 0.75, price = 100, results in 100/0.75 = 133,33 Euro / Liter).

In HikaShop I am lost. There is no way to change the weight category to Liter and I have no clue what script could yield me the price / Liter (I have no clue of PHP but in the comprehensive Virtuemart forum a respective script was posted).

Can anyone help me out? If not I would need to abandon HikaShop and need to go back to VirtueMart (yuck).

Thank you very very very very much in advance.

Last edit: 14 years 3 days ago by 1fcb. Reason: solved

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
14 years 3 days ago #1953

Hi,

First, you need to go to the HikaShop menu Display->Views and search for the file listing_price of the view product and edit it. Then, add the code

if(!empty($this->element->product_id) && isset($this->row->product_weight) && bccomp($this->row->product_weight,0,3)){
					$weight_price = $price->price_value_with_tax / $this->row->product_weight;
					echo JText::_('PRICE_SEPARATOR').$this->currencyHelper->format($weight_price,$price->price_currency_id).' / '.JText::_($this->row->product_weight_unit);
				}
just before the code
}
		echo JText::_('PRICE_END');
near the end of the file.

That will display the price relative to the product weight and the product unit on the product page. So if you have a weight of 0.75kg, that will display the price for 1kg.

Then, you can go to the configuration under the tab languages and edit your HikaShop translation file.
There, you can add a line like this:
KG="Liter"
You can do that for each language so that you can translate the unit in each language you use on your website.

Last edit: 14 years 3 days ago by nicolas.

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

  • Posts: 137
  • Thank you received: 2
14 years 3 days ago #1968

Works perfectly. This is absolutely fantastic support :) :) :) :) :)

Thank you so much. I will definitely stay with HikaShop!

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

  • Posts: 137
  • Thank you received: 2
13 years 11 months ago #2513

I just realized that I need the same information (price per Liter) on the panel where all products of a certain category show up (I chose they show up with their respective prices). Can you please tell me which view that would be? I searched for an hour but did not find.

Thank you very much in advance!

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 11 months ago #2514

It's actually the same file.

You can just remove the code

!empty($this->element->product_id) &&
from the previous code and it will display also on the listings of products

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

  • Posts: 137
  • Thank you received: 2
13 years 11 months ago #2515

hmmm... this one did not work. Still showing only the product price but not also the per Liter price on the product listing page. This is the page I need it to be displayed as well: www.die-besten-weine-der-welt.de/compone...00-punkte-weine.html

Thanks, Mirko.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 11 months ago #2517

Yes. It's this file and this modification you need to do. 100% sure :) I even tried on one of our test websites and the modification worked.

You must have missed something somewhere...

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

  • Posts: 137
  • Thank you received: 2
13 years 11 months ago #2580

Maybe we are discussing about different panels. Again implemented what you proposed but it does not yield the results on the following page:


www.die-besten-weine-der-welt.de/compone...00-punkte-weine.html

The php-code on the respective display reads:
}
if(isset($this->row->product_weight) && bccomp($this->row->product_weight,0,3)){
$weight_price = $price->price_value_with_tax / $this->row->product_weight;
echo JText::_('PRICE_SEPARATOR').$this->currencyHelper->format($weight_price,$price->price_currency_id).' / '.JText::_($this->row->product_weight_unit);
}
}
echo JText::_('PRICE_END');
}
?></span>


I wonder what my error could be... Perhaps there is an additional switch in a module definition that needs to be turned on?

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 11 months ago #2581

If you don't at least the verison 1.3.7, it's probably a problem with the modified view not being loaded, please look at this post and apply the modification proposed : www.hikashop.com/en/support/forum/4-how-...n-checkout.html#1852

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

  • Posts: 137
  • Thank you received: 2
13 years 11 months ago #2582

I just migrated to version 1.3.8 and everything works fine. Thank you!

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

Time to create page: 0.069 seconds
Powered by Kunena Forum