Author Topic: Save function in product edit  (Read 116 times)

alexanderflr

  • Beginner
  • *
  • Posts: 15
  • A beginner
  • VirtueMart Version: 3.2.2
Save function in product edit
« on: September 12, 2017, 17:45:30 pm »
Hi,

Does anyone know where I can find Save classes for product price?
I'm looking for a way to stop Save button to save prices when I edit a product. I don't need the possibility to edit the prices because I created a software that does that and inserts the prices automatically in the database.

I'm using Joomla! 3.7.5 Stable, PHP 7.0.18, Virtuemart 3.2.2
Thank you,
VM 3.2.2 on Joomla! 3.7.4 Stable, PHP Version 7.0.18

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1021
    • Kreativ Fotografi
  • VirtueMart Version: 3.0.19.9
Re: Save function in product edit
« Reply #1 on: September 12, 2017, 22:45:11 pm »
Make an override for the view:

administrator/templates/isis/html/com_virtuemart/product/product_edit_status.php

regards

Jörgen @ Kreativ Fotografi
Joomla 3.6.5
Virtuemart 3.0.19.9
Olympiantheme Hera (customized)

alexanderflr

  • Beginner
  • *
  • Posts: 15
  • A beginner
  • VirtueMart Version: 3.2.2
Re: Save function in product edit
« Reply #2 on: September 13, 2017, 11:16:47 am »
Hi,
I checked that and is nothing to do with prices  :'(

Thank you.
VM 3.2.2 on Joomla! 3.7.4 Stable, PHP Version 7.0.18

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1021
    • Kreativ Fotografi
  • VirtueMart Version: 3.0.19.9
Re: Save function in product edit
« Reply #3 on: September 13, 2017, 11:30:27 am »
Sorry
Was a bit Quick, You will find the original files under
administrator/components/com_virtuemart/views/product/tmpl

and the override should be this file
administrator/templates/youradmintemplate/html/com_virtuemart/product/product_edit_price.php

regards

Jörgen @ Kreativ Fotografi
Joomla 3.6.5
Virtuemart 3.0.19.9
Olympiantheme Hera (customized)

alexanderflr

  • Beginner
  • *
  • Posts: 15
  • A beginner
  • VirtueMart Version: 3.2.2
Re: Save function in product edit
« Reply #4 on: September 20, 2017, 09:58:53 am »
Hi,

Thank you.

I tried to do that but if I change something else to the product and save, all of the prices disappear  :'(
VM 3.2.2 on Joomla! 3.7.4 Stable, PHP Version 7.0.18

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9322
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Save function in product edit
« Reply #5 on: Today at 10:36:00 »
Because the normal way in php is to load the form with the current values and to store the whole thing.

So when your system sets the prices, they should be there, when you edit the product and stored with the rest of the form. There is only one function working different, the toggle function. we update only the boolean, when you use the toggle function in the list (to publish or make a product featured). In all other cases, the form overwrites anything which is there. The same with the config. When you store the config, it starts with fresh data. It loads first the config file, then the all values get overwritten by the form. So any values stored in the config, which are not in the file or form get deleted.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/