Additional Option titel to distinguish different options

  • Christoph
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 months 2 weeks ago - 2 months 2 weeks ago #174927 by Christoph
Hi!

I have created some options and my problem is, that some options have the SAME title but DIFFERENT option values.

Example:
Option 1: name is "Package size" and options are 10g, 50g, 100g
Option 2:name is also "Package size", but options are 100ml and 250ml

In the backend list I get the same title "Package size" but no hint which is which.

And I have ten of it ;-)

So an additional "Title" field would be fine, which is shown in the backend list but not anywhere else. So I could enter "Package size 10g, 50g, 100g" and "Package size 100ml, 250ml" but below the article with both options I get only "Package size" (as I wish).

I have written a quick and dirty hack for me, where the name is scanned for special chars ("---") and all after these isn't shown. So in my backend list I have

"Package size --- 10g, 50g, 100g"
"Package size --- 100ml, 250ml"

So I can distinguish them.

The hack is quite simple. I replaced the normal output in components/com_eshop/themes/your_template/views/product/default.php

  echo $option->option_name;

with

  echo trim (substr($option->option_name, 0, strpos($option->option_name, '---')? : strlen($option->option_name)));

That works fine, but an additional title would be better, of course.

Best regards,
Christoph
Last edit: 2 months 2 weeks ago by Christoph.
The following user(s) said Thank You: ssnobben

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

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
2 months 1 week ago #175035 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Additional Option titel to distinguish different options
Hello Christoph,

Thank you for submitting the suggestion here. Seem it is a very odd case when you have multiple options with same name :)

I can help you to override the layouts of EShop at back-end side to add the ID to the option name if you want. So you can look at the ID to know which options.

Sincerely, Giang

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

Moderators: Giang Dinh Truong