I'm looking for a way to automatically have a product SKU assigned when creating a new product, but am unable to get this done.
Looking into the pipelines I found the SaveProduct pipeline, so I figure I add a task to it to generate an Sku whenever the saved product has an empty (or some fixed default like '-') and generate an Sku.
After adding the task to the pipeline as I've done multiple times already now the task never gets executed when adding or changing a product in the uCommerce backend.
Is there anything specific I need to do to get this to work?
As far I know the SaveProduct pipeline is only executed when a product is saved in the backend and not upon creation. You write that you have created pipeline components before but just for being sure do you have added your pipeline task to the SaveProduct.config?
I thought I had deleted this topic as after cleaning the solution, restarting my pc and fully rebuilding the solution my pipeline task did get picked up. I think there was some caching going on that was preventing my newly registered task from being instantiated.
It's all working great now, but thanks for taking the time to write a reply.
Great to hear you found a solution. Just as a side note: uCommerce cache all pipeline/components etc. configuration at start up. So if you make changes to your configs you have to recycle your AppPool, IISExpress or saving the web.config.
Yeah, that's what I did before I posted where, which made me think I did something wrong. But in the end it worked after deleting the obj directory, restarting the pc and cleaning and rebuiding the entire project.
Not sure which of those steps fixed the issue, but it's not uncommon for Visual Studio to mess up a site if you build and edit it while testing it, so I'm not too surprised :)
Automatically assign product SKU
I'm looking for a way to automatically have a product SKU assigned when creating a new product, but am unable to get this done.
Looking into the pipelines I found the SaveProduct pipeline, so I figure I add a task to it to generate an Sku whenever the saved product has an empty (or some fixed default like '-') and generate an Sku.
After adding the task to the pipeline as I've done multiple times already now the task never gets executed when adding or changing a product in the uCommerce backend.
Is there anything specific I need to do to get this to work?
Hi Robert,
As far I know the SaveProduct pipeline is only executed when a product is saved in the backend and not upon creation. You write that you have created pipeline components before but just for being sure do you have added your pipeline task to the SaveProduct.config?
Best regards
Martin
Hi Martin,
I thought I had deleted this topic as after cleaning the solution, restarting my pc and fully rebuilding the solution my pipeline task did get picked up. I think there was some caching going on that was preventing my newly registered task from being instantiated.
It's all working great now, but thanks for taking the time to write a reply.
Hi Robert,
Great to hear you found a solution. Just as a side note: uCommerce cache all pipeline/components etc. configuration at start up. So if you make changes to your configs you have to recycle your AppPool, IISExpress or saving the web.config.
Best regards
Martin
Yeah, that's what I did before I posted where, which made me think I did something wrong. But in the end it worked after deleting the obj directory, restarting the pc and cleaning and rebuiding the entire project.
Not sure which of those steps fixed the issue, but it's not uncommon for Visual Studio to mess up a site if you build and edit it while testing it, so I'm not too surprised :)
is working on a reply...