- Posts: 267
- Thank you received: 5
Integration with local sales
6 years 6 months ago #316638
by dvddvd
Integration with local sales was created by dvddvd
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
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.
6 years 6 months ago #316640
by nicolas
Replied by nicolas on topic Integration with local sales
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 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.
6 years 6 months ago #316675
by dvddvd
Replied by dvddvd on topic Integration with local sales
Thanks Nicolas,
I will try to do it by mass actions and I tell you how it works.
Greetings
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.189 seconds