Show product price by different units!

  • Posts: 1
  • Thank you received: 0
8 years 8 months ago #208383

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 2.5.28
-- Browser(s) name and version -- : Mozilla

Hi,
We are now testing Hikashop and some other Online shop solutions, for now we are in conflict with Hikashop setting up prices.
We have successfully export items from home made shop and import to Hikashop, create categories etc.

Now, we have problems how to adjust to show product price with different units. Only what we can see now is "Per unit" - all products price is per unit.

What we need?
For example
we have Kiwi (10 sort), Tomato (5 sort) and Lemon (3 sort)
we are selling

- Kiwi one by one - so price will be 1 Kiwi is 1$ (there is no opportunity to buy 1kg Kiwi, only price per quantity - one Kiwi is 30 grams one is 40 etc - so weight is not important here, only quantity)

- Tomato - per KG (so type how many kg and multiple with price - one by one is not important)

- Lemon - per box (so 1 box contains 5 Lemons and some boxes are 1 kg some 1,2 kg etc, but buyer can type just how many boxes of Lemon he want)

There is around 800 items in Hikashop, so is there oportunity to export all items and in Excel create in .csv file one column and set article X kg, aricle Y unit, article Z box etc

If it is possible, please write down how to make this in details.

Thank you

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
8 years 8 months ago #208388

Hi,

Our FAQ explains how to change the "per unit" on a per product basis in the section "I sell packed products, how can I change "each" text in the product page ?":
www.hikashop.com/support/support/documentation/106-faq.html

Once that is setup, your custom product field can be filled automatically with a CSV import as you'll be able to use the "column name" of your custom field as a column of your CSV file.

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

  • Posts: 9
  • Thank you received: 0
8 years 1 month ago #230411

Hello Nicolas,

i need close the same like user nibs in a little different way: I explain what i already did and what i need.

I already did like in the FAQ "I sell packed products, how can I change "each" text in the product page ?" and it works. So now i have price per unit (in german stück), price per roll, price per meter, price per liter, price per whatever.. The problem is, that i need to let this custom field work with "price_per_weight_unit" so the created customfields showing the different units counted down on the default value.. like example:

We sell a roll of tape in size 50m long each roll is 20€:

So the price must look like:
20€ inkl.MwSt. per Roll
0,4€/m zzgl. Versandkosten


so now i need to activate the price per weigth unit.. i already aded Liter (l) and ml but it is not possible to ad Meter(m) or (cm) to the list of weight units.
but i need this for german law close to the price (2.line) like the price per kg

how can i ad this characteristics to the list of possible weight units?

Attachments:
Last edit: 8 years 1 month ago by reinerach.

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
8 years 1 month ago #230447

Hi,

This is the line which displays the price per weight on the product page in the file "listing_price" of the view "product":

echo $this->currencyHelper->format($weight_price,$price->price_currency_id).' / '.JText::_($this->row->product_weight_unit);
So if you want to change the weight unit to use the custom field value, you can change it to:
echo $this->currencyHelper->format($weight_price,$price->price_currency_id).' / '.$this->row->salemethod;

The following user(s) said Thank You: reinerach

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

  • Posts: 9
  • Thank you received: 0
8 years 1 month ago #230454

Hi,

thank you ! It works fine :) sorry got to edit:

The funktion works, but the language override is not showing.. I tryed in both language files with override, but it still shows only the string not the override

now it looks like:

0,4€/GP_PRO_KG

where GP_PRO_KG is one of the values in custom field

Attachments:
Last edit: 8 years 1 month ago by reinerach. Reason: attachement

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

  • Posts: 9
  • Thank you received: 0
8 years 1 month ago #230526

Or do i have to change the custom field to "item"?

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
8 years 1 month ago #230530

Hi,

Do like that then:

echo $this->currencyHelper->format($weight_price,$price->price_currency_id).' / '.JText::_($this->row->salemethod);

The following user(s) said Thank You: reinerach

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

  • Posts: 9
  • Thank you received: 0
8 years 1 month ago #230577

HI,

Thanks, this is perfect! :woohoo: :)

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

  • Posts: 31
  • Thank you received: 2
  • Hikashop Business
7 years 10 months ago #239309

I changed the code in my listing_price.php

But don't understand the instructions:

And to finish, you just have to create a new translation, in Display -> Languages, edit your language file and add in the override area :
PER_PACK="each pack"

I went to hikashop=>display=>views=>
config / languages.php

But I don't know where the override area is. And am i just putting: PER_PACK="each pack" and nothing else?

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

  • Posts: 13201
  • Thank you received: 2322
7 years 10 months ago #239318

Hi,

Please follow these screenshots instructions:
take.ms/6rrlY
take.ms/KmPzu

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

  • Posts: 31
  • Thank you received: 2
  • Hikashop Business
7 years 10 months ago #239394

My client hasn't committed to buying the business license version yet, until she is confident that your shopping cart can do some custom things. Is the language overrides only available for a Essential or higher? The pop up window was blank.

Thanks

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
7 years 10 months ago #239439

Hi,

The language override system is available for all the editions. If the popups are blank in your backend, it's probably a bug of the Joomla popup system which came up with Joomla 3.5.0 or 3.5.1. Make sure that you have the latest version of HikaShop and then set the "popup mode" setting of the HikaShop configuration to "vex" and the popups should then work fine.
Also, note that language overrides can be done in Joomla's languages manager since Joomla 3.2.x

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

  • Posts: 31
  • Thank you received: 2
  • Hikashop Business
7 years 10 months ago #239621

Thanks, but vex didn't work. Any other ideas?

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

  • Posts: 13201
  • Thank you received: 2322
7 years 10 months ago #239634

Hi,

If you set the error reporting level to "maximum" in the Joomla settings, do you have any displayed message like PHP fatal error ?

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

  • Posts: 17
  • Thank you received: 0
6 years 10 months ago #269785

Hello Nicolas,

Also i want to have the "right" unit behind the price.
I tried to do the same like in FAQ106. But the result isn't what i want. I have attached an jpg for you so you can see. changing the code in display=>view doesn't change anything. i don't want to see the specification stuff, i just want to see "/m" behind the price of the product.

Thanks

Attachments:
Last edit: 6 years 10 months ago by Joman.

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
6 years 10 months ago #269793

Hi,

You should turn off the frontend display setting of the custom field so that it doesn't display in the specification area.
Regarding having it just after the price, if you change the code in the view file like indicated in the FAQ it will work.
So something is wrong there. Maybe you've edited the view file for another template than the template you're using on your frontend ?

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

  • Posts: 17
  • Thank you received: 0
6 years 10 months ago #269955

Thank you very much. Now it works. i didn't know that there is generated automatically a view file for every template - also the selfmade ones. But i have also to say that this should be a build in feature for every commercial shopping program - wihtout hacking code.

But anyway - thanks for the fast support.

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

  • Posts: 17
  • Thank you received: 0
6 years 10 months ago #269960

what is the css class for editing the style of the "unit" behind the price?

Last edit: 6 years 10 months ago by Joman.

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
6 years 10 months ago #269961

Hi,

With the modification of the FAQ, there is no HTML element around the text.
But you can easily add it.
Just change to that code instead:

if(isset($this->element->main)) echo '<span class="hikashop_product_price_per_unit">'.JText::_($this->element->main->salemethod).'</span>'; 
elseif(isset($this->row)) echo '<span class="hikashop_product_price_per_unit">'.JText::_($this->row->salemethod).'</span>'; 
else echo '<span class="hikashop_product_price_per_unit">'.JText::_($this->element->salemethod).'</span>';
And then you can use the class hikashop_product_price_per_unit in your CSS

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

  • Posts: 17
  • Thank you received: 0
6 years 10 months ago #270232

Hopefully the last question to the topic.

In the backend of the custom field there are on the right side the "display options" and here on the lower part i can select categories, subcategories and products. when i put the single products in the field than everything goes fine. But with about 50 Products which use different units it is some work to adjust them all like this. So i want to do this just by categories and subcategories but this seems not to work. what am i doinng wrong?,

Thank you

Attachments:

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

Time to create page: 0.136 seconds
Powered by Kunena Forum