Integration with local sales

  • Posts: 267
  • Thank you received: 5
  • Hikaserial Standard
4 years 1 week ago #316638

Hello,

I want to carry out an integration with my local sales program to be able to update the stock and prices, to update the values ​​through massive actions. When making product variations a sku is generated that results from the sku of the main product an underscore and the id of the variant. Could the underscore somehow be removed?
In this way, the values ​​of both fields were correlative.

Thank you

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
4 years 1 week ago #316640

Hi,

The format of the SKU of variants allows HikaShop to properly copy the variants when you copy a product.
If you change that, you won't be able to copy the variants along with the products.

Now besides that, it shouldn't be a problem to remove the underscores. But to do it automatically could be problematic.
Now you should be able to do it with a mass action on the "on after a product is updated" (so that it triggers after you save a product) with a filter to target only the variants and an action "update the values" on the product_code using the "operation" mode with a regex using the MySQL function REGEXP_REPLACE.
However, I'm not too familiar with this.
stackoverflow.com/questions/986826/how-t...ion-replace-in-mysql
Beware that this can be dangerous so make sure you make a backup of your hikashop_product table before running such advanced mass action.

The following user(s) said Thank You: dvddvd

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

  • Posts: 267
  • Thank you received: 5
  • Hikaserial Standard
4 years 1 week ago #316675

Thanks Nicolas,
I will try to do it by mass actions and I tell you how it works.
Greetings

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

Time to create page: 0.063 seconds
Powered by Kunena Forum