Author Topic: Make custom fields more stand out, more user friendly  (Read 604 times)

Huubs

  • Jr. Member
  • **
  • Posts: 112
Make custom fields more stand out, more user friendly
« on: April 03, 2018, 16:16:00 pm »
Hello,

I have a store which has products with custom fields. Works flawlessly, except for the fact that in the order manager, the custom fields get displayed like this:

question answer

So for example

color red
color none

The problem that arises is that in the order manager, you can miss the custom fields and their values because its not very clear when an answer is given, and when no answer is given. I want to add some styling to the answers to make them more stand out (if a value is chosen)

Now I checked the backend files and the custom fields get called via this way:

$product_attribute = VirtueMartModelCustomfields::CustomsFieldOrderDisplay($item,'BE');

And that gets put between <div></div>

Now everything gets defined in this call, but I want to add some classes to the answers to make them stand out. Is this possible?

Huubs

  • Jr. Member
  • **
  • Posts: 112
Re: Make custom fields more stand out, more user friendly
« Reply #1 on: April 05, 2018, 10:24:19 am »
Anyone has an idea? Maybe an override? I tried but it seems that I have to modify the core code?

Else maybe a hack with javascript? It only has to be more user friendly in regards to reading it. Actually changing the code so that the program sees it differently does't have to.

Huubs

  • Jr. Member
  • **
  • Posts: 112
Re: Make custom fields more stand out, more user friendly
« Reply #2 on: April 09, 2018, 11:01:07 am »
Can anybody please support me in this? I have tried to find it myself but I cannot seem to do that.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27109
  • Always on vacation
    • Jenkin Hill Internet
Re: Make custom fields more stand out, more user friendly
« Reply #3 on: April 09, 2018, 11:59:25 am »
It's important to avoid a core hack. You could add a css style for .vm-customfield-cart but that is not specific to just the answer.

It can be done by using Regularlab's ReReplacer which I have used for similar functions to avpoid core hacking on non-VM sites.

I just tested it on VM and found it can be used. It does mean that all possible custom field selections + answers would need entering into the ReReplacer component, though.

eg with ReReplacer set to work in admin area only,  search for Size: M  and replace with Size: <span style="color:red;">M</span> displays Size: M whenever Size: M is found.  Although it is something extra to maintain, different answers could be shown with different colours or made bold etc.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.3.9989 on Joomla 3.9.1 PHP 7.0.32
Testing VM 3.4.3.9993 on Joomla 3.9.1

Huubs

  • Jr. Member
  • **
  • Posts: 112
Re: Make custom fields more stand out, more user friendly
« Reply #4 on: April 09, 2018, 14:44:19 pm »
It's important to avoid a core hack. You could add a css style for .vm-customfield-cart but that is not specific to just the answer.

It can be done by using Regularlab's ReReplacer which I have used for similar functions to avpoid core hacking on non-VM sites.

I just tested it on VM and found it can be used. It does mean that all possible custom field selections + answers would need entering into the ReReplacer component, though.

eg with ReReplacer set to work in admin area only,  search for Size: M  and replace with Size: <span style="color:red;">M</span> displays Size: M whenever Size: M is found.  Although it is something extra to maintain, different answers could be shown with different colours or made bold etc.

I'm not fond of a core hack, so every other possible solution would be preferred.

That ReReplacer tools looks good. I'm gonna check it out.