displaying variant name instead of characteristics

  • Posts: 100
  • Thank you received: 1
10 years 5 months ago #159283

-- HikaShop version -- : 2.3.1
-- Joomla version -- : 3.3
-- PHP version -- : x5x


HI

I have a main product with 1 characteristic showing in a drop down. I would like the drop down to show the "variant name" instead of the "characteristic" value.







Could you advise which file i would edit for this.

Thanks

Patrick

Attachments:
Last edit: 10 years 5 months ago by paddyrolls.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 5 months ago #159321

Hi,

You would have to edit the file administrator/components/com_hikashop/types/characteristic.php
You'll have to change that line which is where the characteristic value is set in the dropdown :
$values[$k]=$value->characteristic_value;

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

  • Posts: 100
  • Thank you received: 1
10 years 5 months ago #159357

HI Nicolas

Changing this file would mean that when I update it would be over written. I am not sure but could you tell me if there is an override option for this file?

Thanks

Patrick

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 5 months ago #159397

Hi,

That's indeed the case.
You can use the "characteristic display override" system as explained on our developer documentation if you want to do an override:
www.hikashop.com/support/support/documen...r-documentation.html

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

  • Posts: 8
  • Thank you received: 0
6 years 11 months ago #283509

Hi can you please more specific (I'm green on JS), what i need to change? maybe something is changed since 2.3 version in this file...
Im using 3.2.1 version.
Thank you

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 11 months ago #283512

Hi,

Please provide screenshots of what you want to do so that we can better understand your situation and what you want to change where.
Also, the change I was talking about was in the PHP part of that file, so the javascript code in that file was not concerned. Even now, you can ignore it.

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

  • Posts: 8
  • Thank you received: 0
6 years 10 months ago #285965

Now its showing options, I need to show names of the options.

Also it's need to appear in order, not just product page.

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

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 10 months ago #285988

Hi,

You want to remove the line:

$values[$k] = $value->characteristic_value;
and add the line:
$values[$k] = $variant->product_name;
after the line:
if($variantCharacteristic->characteristic_id==$value->characteristic_id){
in that file administrator/components/com_hikashop/types/characteristic.php

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

  • Posts: 8
  • Thank you received: 0
6 years 10 months ago #286032

Now it dosen't display the options at all "no values found" message instead of a list of options.

PHP File attached.

link:
dfus.jls.co.il/%D7%9E%D7%9B%D7%A9%D7%99%...9E%D7%97%D7%95%D7%A7

Attachments:

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 10 months ago #286047

Hi,

Then it means that you have the display out of stock products setting activated in your HikaShop configuration.
Either turn off that setting, or also change the line:
if(!$config->get('show_out_of_stock',1)){
to:
if(true){
in that same file.

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

  • Posts: 8
  • Thank you received: 0
6 years 10 months ago #286059

Hi, Now it's shows full product name + variant name, I need only the variant name, is it possible?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 10 months ago #286062

Hi,

Then try using the line:

$values[$k] = $variant->variant_name;
instead of:
$values[$k] = $variant->product_name;

The following user(s) said Thank You: mark02k

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

  • Posts: 8
  • Thank you received: 0
6 years 10 months ago #286120

Exactly what i need!

Thank you!

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

Time to create page: 0.100 seconds
Powered by Kunena Forum