Join several fields under OPERATION mode

  • Posts: 634
  • Thank you received: 16
8 years 8 months ago #231684

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8

I want to store all core size field sunder a single custom field so I get something like this:

product_width x product_length x product_height

So I tried this setup

product_width+" x "+product_length+" x "+product_height



and the same with ' x ' instead of " x "

also used . instead of +

but the system is TOO SMART and tends to add the values instead of building a text string.

So, how can I join fields to show like its values separated by a constant string like " x "?

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
8 years 8 months ago #231692

Hi,

The mass actions does not allow yet this kind of actions, but it is a good idea.
I add it on our Todo list. For now this will require custom code, potentially a custom mass action.

Here is the developer documentation: www.hikashop.com/support/documentation/1...s-action-plugin.html

The following user(s) said Thank You: PeterChain

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

  • Posts: 634
  • Thank you received: 16
8 years 8 months ago #231784

Thanks Xavier,

maybe you could guide me on what file / function is doing this OPERATION processing so instead of creating a custom Mass Action I may try to develop this JOINT processing and give this code to you if I am successful in making it work.

regards,

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

  • Posts: 13201
  • Thank you received: 2322
8 years 8 months ago #231803

Hi,

The file to edit is "administrator/components/com_hikashop/classes/massaction.php", and the function is "updateValueSecure".
There is "if" conditions and I think that in this case the best would be to edit the 'string' if condition.

But making a new plugin is not so complicated and could be a better solution ;)

The following user(s) said Thank You: PeterChain

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

  • Posts: 634
  • Thank you received: 16
8 years 8 months ago #232153

Made a new plugin. Was quick.

Thanks for the advice.

anyhow adding this feature to Mass Actions IS A MUST. :)

You know I am a true believer in the hidden power of Mass Actions.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 8 months ago #232157

Hi,

Glad to see that you made a plugin for that feature :)
We keep that feature in mind and it is already listed on our todo list.

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

  • Posts: 634
  • Thank you received: 16
6 years 11 months ago #283179

Wanted to reborn this topic on the hope there was some improvement after such a long time.

I want to join several values in a "Update the values" action set with OPERATION mode.

first and simple I want to join

product.product_code + " " + product.product_name
these are both from same table.

then would be great if I could add the Brand name stored in the Category Table
product.product_code + " " + product.product_name + " " + category.category_name (for brand)

I guess the brand thing would be not possible, but for the other part should be possible at this time to join.

I already know how to do this with a triggered plugin but to do with mass actions has become a major need.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
6 years 11 months ago #283185

Hi,

We didn't move forward on such capability because we actually started some work to completely redo the mass action system so that it will be more flexible and easier to integrate with for other extensions (for example for HikaMarket to add vendor mass actions). So we didn't want to work on new features to it before that, since that would mean having to rewrite them for the new system just after that.

What Xavier was saying was that you could add such support of joins inside the mass action system by developing a plugin.
All the triggers, filters and actions of the mass action system are handled by the hikashop system massaction plugin and the different hikashop massaction plugins installed automatically with HikaShop. They implement triggers like onMassactionTableActionsLoad where the actions are registered or the trigger onProcessProductMassActionupdateValues where the "update values" action is processed.
So with a plugin you could easily add your own action to the list of actions with its own processing, inspired from what is already there so you could have MySQL joins, and why not even support brands data.
Such plugin could potentially even be distributed for others wanting to do joins.
So Xavier actually though that that's what you already did. But apparently you did some other kind of plugin.

The following user(s) said Thank You: PeterChain

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

  • Posts: 634
  • Thank you received: 16
6 years 11 months ago #283210

Thanks Nicolas for such an extensive explanation.

You are right in the sense that we did not build exactly that kind of plugin but a specific one for that very specific need.

We are glad to know that you are under development of a brand new philosophy.

We'll wait for this.

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

Time to create page: 0.087 seconds
Powered by Kunena Forum