mass action of all products in a given category

  • Posts: 583
  • Thank you received: 22
  • Hikaserial Subscription Hikashop Multisite
8 years 3 months ago #223462

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.6
-- Browser(s) name and version -- : FF 42

Hi Supportteam,

Please help me! :)

I have the desire to complement the value of a field with additional data.
In this case it's the name of the product where I want to put some extra before the name.

"Old White" must be come "Chalk Paint Old White" ,
"Olive" must be come "Chalk Paint Olive" and so on.
I have 300+ product so I like to do it in a mass action.

But there are two things that I can't figure out.
1: I can't find a filter where you can select only products that belong to a specific category.
Also in the database I can't find a category field where the products belongs to.
2: There is no option to concatenate a field. (I know this would be too complicated, so this is no wish ;)

So I want to know if I'm right that you can't filter products that belong to a specific category.

Maybe there is an SQL query to do this. But I come no further than this.

SELECT product_name
FROM xxx_hikashop_product
INNER JOIN jxxx_hikashop_product_category
ON xxx_hikashop_product.product_id = xxx_hikashop_product_category.product_id WHERE `category_id` =13;

But now I have to make an UPDATE and add extra value in the same field. This is an bridge to far for me ;-)
Maybe you can help me to put me in the right direction. Because I don't know if concatenate is the right search word for this.

Hope you can help me a little bit.

Kind regards,
Lumiga


Kind regards,
Lumiga
Last edit: 8 years 3 months ago by Lumiga.

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

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

Hi,

You can use this MySQL request:

UPDATE `#__hikashop_product` AS p 
	LEFT JOIN `#__hikashop_product_category` AS pc ON p.product_id = pc.product_id 
	LEFT JOIN `#__hikashop_category` AS c ON pc.category_id = c.category_id 
	SET p.product_name = CONCAT('Chalk Paint ',p.product_name) WHERE c.category_name = 'The desired name';

And simply replace 'The desired name' by the correct categoy name, or filter on another category column.

The following user(s) said Thank You: Lumiga

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

  • Posts: 583
  • Thank you received: 22
  • Hikaserial Subscription Hikashop Multisite
8 years 3 months ago #223705

Hi Xavier,

Thank you very much!!!!

Kind regards,
Lumiga


Kind regards,
Lumiga

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

Time to create page: 0.069 seconds
Powered by Kunena Forum