News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Where is the place where SQL queries come from for customfields table update?

Started by borro, May 27, 2013, 14:55:35 PM

Previous topic - Next topic

borro

Hello

I'm trying to find where is the place in code which generates sql UPDATE query which runs after you clicking SAVE button in product card. 
I made changes in related products logic and now I have to change UPDATE sql-query that modifies #__virtuemart_product_customfields table after saving product card changes
Please help

Thank you
Wish you happiness!

borro

There are such strokes in "Save" function body which defined in administrator/.../vmcontroller.php:


...
$model = VmModel::getModel($this->_cname);
$id = $model->store($data);
...


I'd opened administrator/components/com_virtuemart/helpers/vmmodel.php, and found store function definition there. Due to debug I placed such code in its body:

...
var_dump($data);
die();
...

But when I click Save button in product card which runs Save function of vmcontroller.php and then as i think it has to run modified Store function. But it doesn't happens.
Can any tell me why there is no change in output? Why do I not see var_dump output?
Wish you happiness!

Milbo

The save function is very often customised. Check the custom and customfield model, but be aware that is not written by me. The code will be drastically enhanced in vm2.1. and use vmdebug, it easier then var_dump
Should I fix your bug, please support the VirtueMart project and become a [url=http://extensions.virtuemart.net/support/virtuemart-supporter-membership-detail]member[/url]
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

borro

Quote from: Milbo on June 07, 2013, 12:06:45 PM
The save function is very often customised. Check the custom and customfield model, but be aware that is not written by me. The code will be drastically enhanced in vm2.1. and use vmdebug, it easier then var_dump
thank you. where can i read about benefits of vmdebug and how to use it?
Wish you happiness!

Milbo

Should I fix your bug, please support the VirtueMart project and become a [url=http://extensions.virtuemart.net/support/virtuemart-supporter-membership-detail]member[/url]
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

borro

Wish you happiness!

Milbo

just try it... use it somewhere in the code, just use what I gave you vmdebug('description',$values1, $value2,....)

you must load the vmconfig before, you can also read there about the function. helpers/config.php
Should I fix your bug, please support the VirtueMart project and become a [url=http://extensions.virtuemart.net/support/virtuemart-supporter-membership-detail]member[/url]
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

edward concepcion

I am in same place... i added a field to table jos_virtuemart_product_customfields but cant find where to add field to update statement on admin side...  Somewhat frustrating...

Hoping someone can help...

thanks in Advance

Milbo

Quote from: borro on May 27, 2013, 14:55:35 PM
I made changes in related products logic and now I have to change UPDATE sql-query that modifies #__virtuemart_product_customfields table after saving product card changes

What is a product card? Do you mean the product edit? If you want to change what is stored, you need to change the table file! in the folder "tables". Or take a look in customfields model. I still do not really understand what you are looking for.

Btw instead hacking the core, take a look on the textinput plugin and write a plugin.
Should I fix your bug, please support the VirtueMart project and become a [url=http://extensions.virtuemart.net/support/virtuemart-supporter-membership-detail]member[/url]
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

borro

Hello, friends.

I used the vmdebug function in code. Where should i look for its output?
I've found, right at the page
Wish you happiness!