Insert Characteristic title into variant name

  • Posts: 259
  • Thank you received: 22
1 year 4 months ago #354180

Currently we have variant names displayed as "Product Name":"Characteristic1 Value" "Characteristic2 value"
eg. for a Hoodie with characteristics colour and size the variant name might be Hoodie: red XL
Is there a way to include the characteristic title as well so it would be Hoodie: Colour Red Size XL?

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
1 year 4 months ago #354185

Hi,

There is no option for that.
However, there are two ways to can acheive that:
- you could enter the text you want (like "Colour Red Size XL") as "name" of each variant, by editing them one by one in each product edit page. If you have only a handful of products, it could be a solution.
- you can change the line:

$variant->characteristics_text .= $separator . $char_value;
to:
$characteristicClass = hikashop_get('class.characteristic');
$parent = $characteristicClass->get($val->characteristic_parent_id);
$variant->characteristics_text .= $separator . $parent->characteristic_value. $separator . $char_value;
in the file administrator/components/com_hikashop/classes/product.php
Note that if you do it like that, you'll loose that change after each update of HikaShop. A cleaner solution would be to override the product class and redefine the whole checkVariant function with that modification above in it:
www.hikashop.com/support/documentation/6...ntation.html#classes
That way, you wouldn't loose the change after each update. The drawback is that this requires a bit of developer skills.

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

Time to create page: 0.070 seconds
Powered by Kunena Forum