[Skip to main content](#vessel-content)

#   Mass action delete extra or some character from product name

##

- **[naizak](/forum/user/2680-naizak "View naizak's Profile")**
- [![naizak's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2680-naizak "View naizak's Profile") Topic Author
- [ Offline](/forum/user/2680-naizak)

Less More

- Posts: 153
- Thank you received: 12
-

5 years 2 weeks ago -  5 years 5 days ago [\#336429](#336429) by [naizak](/forum/user/2680-naizak "View naizak's Profile")  *[Mass action delete extra or some character from product name](/forum/44-mass-actions/903336-mass-action-delete-extra-or-some-character-from-product-name#336429 "-- HikaShop version -- : 4.4.4 Essential -- Joomla version -- : 3.10.2 -- PHP version -- : 7.4.24  Hi, i have 900 product witch i would like to delete first 3 character in the name of the products Example :  &#42; 10-produitun  &#42; 11-produitdeux  &#42; 12-produitdeux  would be possible to delete with mass action only &quot;10-&quot; &quot;11-&quot; &quot;12-&quot; etc... , if it's possible how can i do it please :unsure: Best regards")* was created by *[naizak](/forum/user/2680-naizak "View naizak's Profile")*

-- HikaShop version -- : 4.4.4 Essential
-- Joomla version -- : 3.10.2
-- PHP version -- : 7.4.24

Hi,
i have 900 product witch i would like to delete first 3 character in the name of the products
Example :

- 10-produitun
- 11-produitdeux
- 12-produitdeux

would be possible to delete with mass action only "**10-**" "**11-**" "**12-**" etc... ,
if it's possible how can i do it please ![:unsure:](/media/kunena/emoticons/18.png ":unsure:")
Best regards

Last edit: 5 years 5 days ago by [naizak](/forum/user/2680-naizak "View naizak's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy85MDMzMzYtbWFzcy1hY3Rpb24tZGVsZXRlLWV4dHJhLW9yLXNvbWUtY2hhcmFjdGVyLWZyb20tcHJvZHVjdC1uYW1lP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

5 years 2 weeks ago [\#336433](#336433) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Mass action delete extra or some character from product name](/forum/44-mass-actions/903336-mass-action-delete-extra-or-some-character-from-product-name#336433 "-- HikaShop version -- : 4.4.4 Essential -- Joomla version -- : 3.10.2 -- PHP version -- : 7.4.24  Hi, i have 900 product witch i would like to delete first 3 character in the name of the products Example :  &#42; 10-produitun  &#42; 11-produitdeux  &#42; 12-produitdeux  would be possible to delete with mass action only &quot;10-&quot; &quot;11-&quot; &quot;12-&quot; etc... , if it's possible how can i do it please :unsure: Best regards")*

Hi,

It's should be possible with an action "Run MySQL query" and the text: Code:

UPDATE #__hikashop_product SET product_name = REGEX_REPLACE(product_name, '^[0-9]+\-', '') WHERE product_id={product_id};

The following user(s) said Thank You: [naizak](/forum/user/2680-naizak "View naizak's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy85MDMzMzYtbWFzcy1hY3Rpb24tZGVsZXRlLWV4dHJhLW9yLXNvbWUtY2hhcmFjdGVyLWZyb20tcHJvZHVjdC1uYW1lP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[naizak](/forum/user/2680-naizak "View naizak's Profile")**
- [![naizak's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2680-naizak "View naizak's Profile") Topic Author
- [ Offline](/forum/user/2680-naizak)

Less More

- Posts: 153
- Thank you received: 12
-

5 years 2 weeks ago [\#336444](#336444) by [naizak](/forum/user/2680-naizak "View naizak's Profile")  Replied by *[naizak](/forum/user/2680-naizak "View naizak's Profile")* on topic *[Mass action delete extra or some character from product name](/forum/44-mass-actions/903336-mass-action-delete-extra-or-some-character-from-product-name#336444 "-- HikaShop version -- : 4.4.4 Essential -- Joomla version -- : 3.10.2 -- PHP version -- : 7.4.24  Hi, i have 900 product witch i would like to delete first 3 character in the name of the products Example :  &#42; 10-produitun  &#42; 11-produitdeux  &#42; 12-produitdeux  would be possible to delete with mass action only &quot;10-&quot; &quot;11-&quot; &quot;12-&quot; etc... , if it's possible how can i do it please :unsure: Best regards")*

Thank you very much Nicolas

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy85MDMzMzYtbWFzcy1hY3Rpb24tZGVsZXRlLWV4dHJhLW9yLXNvbWUtY2hhcmFjdGVyLWZyb20tcHJvZHVjdC1uYW1lP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[naizak](/forum/user/2680-naizak "View naizak's Profile")**
- [![naizak's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2680-naizak "View naizak's Profile") Topic Author
- [ Offline](/forum/user/2680-naizak)

Less More

- Posts: 153
- Thank you received: 12
-

5 years 2 weeks ago [\#336503](#336503) by [naizak](/forum/user/2680-naizak "View naizak's Profile")  Replied by *[naizak](/forum/user/2680-naizak "View naizak's Profile")* on topic *[Mass action delete extra or some character from product name](/forum/44-mass-actions/903336-mass-action-delete-extra-or-some-character-from-product-name#336503 "-- HikaShop version -- : 4.4.4 Essential -- Joomla version -- : 3.10.2 -- PHP version -- : 7.4.24  Hi, i have 900 product witch i would like to delete first 3 character in the name of the products Example :  &#42; 10-produitun  &#42; 11-produitdeux  &#42; 12-produitdeux  would be possible to delete with mass action only &quot;10-&quot; &quot;11-&quot; &quot;12-&quot; etc... , if it's possible how can i do it please :unsure: Best regards")*

i got an error when i tested
"1305 FUNCTION adp_migrer.REGEX_REPLACE does not exist "

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy85MDMzMzYtbWFzcy1hY3Rpb24tZGVsZXRlLWV4dHJhLW9yLXNvbWUtY2hhcmFjdGVyLWZyb20tcHJvZHVjdC1uYW1lP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

5 years 2 weeks ago -  5 years 1 week ago [\#336511](#336511) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Mass action delete extra or some character from product name](/forum/44-mass-actions/903336-mass-action-delete-extra-or-some-character-from-product-name#336511 "-- HikaShop version -- : 4.4.4 Essential -- Joomla version -- : 3.10.2 -- PHP version -- : 7.4.24  Hi, i have 900 product witch i would like to delete first 3 character in the name of the products Example :  &#42; 10-produitun  &#42; 11-produitdeux  &#42; 12-produitdeux  would be possible to delete with mass action only &quot;10-&quot; &quot;11-&quot; &quot;12-&quot; etc... , if it's possible how can i do it please :unsure: Best regards")*

Hi,

The function REGEX_REPLACE was added in MySQL 8.0.4. You must be using an older version of MySQL.
Unfortunately, with old versions of MySQL there is no regex replacement functions so you can't use this.
In that case, you can try instead to use a "run PHP code" action with the code: Code:

$db = JFactory::getDBO(); $name = preg_replace('#^[0-9]+\-#','', '{product_name}'); $db-&gt;setQuery('UPDATE #__hikashop_product SET product_name =' . $db-&gt;Quote($name).' WHERE product_id = {product_id}'); $db-&gt;execute();

That will do the same but got through PHP to run the regex before doing the MySQL query from the PHP code.

Last edit: 5 years 1 week ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

The following user(s) said Thank You: [naizak](/forum/user/2680-naizak "View naizak's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy85MDMzMzYtbWFzcy1hY3Rpb24tZGVsZXRlLWV4dHJhLW9yLXNvbWUtY2hhcmFjdGVyLWZyb20tcHJvZHVjdC1uYW1lP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[naizak](/forum/user/2680-naizak "View naizak's Profile")**
- [![naizak's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2680-naizak "View naizak's Profile") Topic Author
- [ Offline](/forum/user/2680-naizak)

Less More

- Posts: 153
- Thank you received: 12
-

5 years 2 weeks ago [\#336537](#336537) by [naizak](/forum/user/2680-naizak "View naizak's Profile")  Replied by *[naizak](/forum/user/2680-naizak "View naizak's Profile")* on topic *[Mass action delete extra or some character from product name](/forum/44-mass-actions/903336-mass-action-delete-extra-or-some-character-from-product-name#336537 "-- HikaShop version -- : 4.4.4 Essential -- Joomla version -- : 3.10.2 -- PHP version -- : 7.4.24  Hi, i have 900 product witch i would like to delete first 3 character in the name of the products Example :  &#42; 10-produitun  &#42; 11-produitdeux  &#42; 12-produitdeux  would be possible to delete with mass action only &quot;10-&quot; &quot;11-&quot; &quot;12-&quot; etc... , if it's possible how can i do it please :unsure: Best regards")*

Thank you Very much Nicolas

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy85MDMzMzYtbWFzcy1hY3Rpb24tZGVsZXRlLWV4dHJhLW9yLXNvbWUtY2hhcmFjdGVyLWZyb20tcHJvZHVjdC1uYW1lP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[naizak](/forum/user/2680-naizak "View naizak's Profile")**
- [![naizak's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2680-naizak "View naizak's Profile") Topic Author
- [ Offline](/forum/user/2680-naizak)

Less More

- Posts: 153
- Thank you received: 12
-

5 years 1 week ago -  5 years 1 week ago [\#336660](#336660) by [naizak](/forum/user/2680-naizak "View naizak's Profile")  Replied by *[naizak](/forum/user/2680-naizak "View naizak's Profile")* on topic *[Mass action delete extra or some character from product name](/forum/44-mass-actions/903336-mass-action-delete-extra-or-some-character-from-product-name#336660 "-- HikaShop version -- : 4.4.4 Essential -- Joomla version -- : 3.10.2 -- PHP version -- : 7.4.24  Hi, i have 900 product witch i would like to delete first 3 character in the name of the products Example :  &#42; 10-produitun  &#42; 11-produitdeux  &#42; 12-produitdeux  would be possible to delete with mass action only &quot;10-&quot; &quot;11-&quot; &quot;12-&quot; etc... , if it's possible how can i do it please :unsure: Best regards")*

hi,
Seems to be an error in the code :
syntax error, unexpected '$db' (T_VARIABLE), expecting ')'
i'm so bad in php ![:(](/media/kunena/emoticons/22.png ":(")

php versions :7.4.25
Joomla : 4.0.4

Last edit: 5 years 1 week ago by [naizak](/forum/user/2680-naizak "View naizak's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy85MDMzMzYtbWFzcy1hY3Rpb24tZGVsZXRlLWV4dHJhLW9yLXNvbWUtY2hhcmFjdGVyLWZyb20tcHJvZHVjdC1uYW1lP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

5 years 1 week ago [\#336666](#336666) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Mass action delete extra or some character from product name](/forum/44-mass-actions/903336-mass-action-delete-extra-or-some-character-from-product-name#336666 "-- HikaShop version -- : 4.4.4 Essential -- Joomla version -- : 3.10.2 -- PHP version -- : 7.4.24  Hi, i have 900 product witch i would like to delete first 3 character in the name of the products Example :  &#42; 10-produitun  &#42; 11-produitdeux  &#42; 12-produitdeux  would be possible to delete with mass action only &quot;10-&quot; &quot;11-&quot; &quot;12-&quot; etc... , if it's possible how can i do it please :unsure: Best regards")*

Hi,

I modified the code in my previous message. Please try with the new version of the code there.

The following user(s) said Thank You: [naizak](/forum/user/2680-naizak "View naizak's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy85MDMzMzYtbWFzcy1hY3Rpb24tZGVsZXRlLWV4dHJhLW9yLXNvbWUtY2hhcmFjdGVyLWZyb20tcHJvZHVjdC1uYW1lP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[naizak](/forum/user/2680-naizak "View naizak's Profile")**
- [![naizak's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2680-naizak "View naizak's Profile") Topic Author
- [ Offline](/forum/user/2680-naizak)

Less More

- Posts: 153
- Thank you received: 12
-

5 years 5 days ago -  5 years 5 days ago [\#336739](#336739) by [naizak](/forum/user/2680-naizak "View naizak's Profile")  Replied by *[naizak](/forum/user/2680-naizak "View naizak's Profile")* on topic *[Mass action delete extra or some character from product name](/forum/44-mass-actions/903336-mass-action-delete-extra-or-some-character-from-product-name#336739 "-- HikaShop version -- : 4.4.4 Essential -- Joomla version -- : 3.10.2 -- PHP version -- : 7.4.24  Hi, i have 900 product witch i would like to delete first 3 character in the name of the products Example :  &#42; 10-produitun  &#42; 11-produitdeux  &#42; 12-produitdeux  would be possible to delete with mass action only &quot;10-&quot; &quot;11-&quot; &quot;12-&quot; etc... , if it's possible how can i do it please :unsure: Best regards")*

Work like a charm , thanks you very very much Monsieur :woohoo: ![:)](/media/kunena/emoticons/3.png ":)")

PS : i didn't get mail notification sorry for late answer

Last edit: 5 years 5 days ago by [naizak](/forum/user/2680-naizak "View naizak's Profile").

The following user(s) said Thank You: [Philip](/forum/user/34318-philip "View Philip's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy85MDMzMzYtbWFzcy1hY3Rpb24tZGVsZXRlLWV4dHJhLW9yLXNvbWUtY2hhcmFjdGVyLWZyb20tcHJvZHVjdC1uYW1lP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.122 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
