# How to catch OnSave event of ProductDetail

**URL:** <https://forum.shopware.com/t/how-to-catch-onsave-event-of-productdetail/71360>\
**Category:** Programmierung\
**Created:** [3. Dezember 2020 um 18:06 UTC](https://forum.shopware.com/t/how-to-catch-onsave-event-of-productdetail/71360 "2020-12-03T18:06:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnuricumbo](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/jnuricumbo/32/13321_2.png) [@jnuricumbo](https://forum.shopware.com/u/jnuricumbo)\
**Post date:** [3. Dezember 2020 um 18:06 UTC](https://forum.shopware.com/t/how-to-catch-onsave-event-of-productdetail/71360/1 "2020-12-03T18:06:00Z")

</div>

I have a new tab in the products detail page by followinf [this guide](https://docs.shopware.com/en/shopware-platform-dev-en/how-to/new-tab-admin). but now I need to catch the event onSave when the user click on that button. Any idea how to achiev that?

Thanks

---

<div class="post-metadata">

**Author:** ![Moorleiche](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@Moorleiche](https://forum.shopware.com/u/Moorleiche)\
**Post date:** [3. Dezember 2020 um 19:31 UTC](https://forum.shopware.com/t/how-to-catch-onsave-event-of-productdetail/71360/2 "2020-12-03T19:31:38Z")

</div>

Do you know how to override a vue.js component and inherit a method? In this case you could change the onSave() method of the `sw-product-detail` component 😉

---

<div class="post-metadata">

**Author:** ![jnuricumbo](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/jnuricumbo/32/13321_2.png) [@jnuricumbo](https://forum.shopware.com/u/jnuricumbo)\
**Post date:** [3. Dezember 2020 um 20:28 UTC](https://forum.shopware.com/t/how-to-catch-onsave-event-of-productdetail/71360/3 "2020-12-03T20:28:11Z")

</div>

Hi Moorleiche.&nbsp;No, I don’t know how to do it, maybe that’s why I’m asking, actually vue.js does not have&nbsp;such thing out of the box. Now I see the component factory machanism of SW components, that is good but not the best, since I have to copy the content of the method, if something change in that method in future versions then that would be a problem, or at least I have to keep an eye there and updete the code of my override method.

&nbsp;

---

<div class="post-metadata">

**Author:** ![pavel.b](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@pavel.b](https://forum.shopware.com/u/pavel.b)\
**Post date:** [19. Mai 2023 um 18:35 UTC](https://forum.shopware.com/t/how-to-catch-onsave-event-of-productdetail/71360/4 "2023-05-19T18:35:38Z")

</div>

i think its too late but i just had the same problem and found a solution:

its simple: ` this.$super('onSave');`

so in the code it should look sth like this:

```auto
Shopware.Component.override('sw-product-detail', {
  methods: {
    onSave() {
        // your code
         this.$super('onSave');
    }
  }
}

```
