Question

first of all, sorry for my english, but I'll try to explain myself best I can.

My question is little tricky, because I made some important changes in the core code of VirtueMart. For some reasons, I added an attribute to the Custom Fields, like Price, called Availability.

enter image description here TIP: The admin site is in Spanish. Disponibilidad = Availability

So, now, when I try to change any value of any created Custom Field, I can't save it. I mean, I can change the value, but when I apply them, It doesn't be saved.

The only field that I can change, is the field I created, the Availability (ironically).

So, my principal question is, how does VirtueMart to pick up the data from the table and sends them to the database?

I work with

  • Joomla v.2.5.11
  • VirtueMart 2

Thanks

Was it helpful?

Solution

The workflow is like follows,

When you save the products details on the backend , It calls a function store() on the product.php model. under administrator/components/com_virtuemart/models/. Inside this function an area like follows.

if(!class_exists('VirtueMartModelCustom')) require(JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'custom.php');

            VirtueMartModelCustom::saveModelCustomfields('product',$data,$product_data->virtuemart_product_id);

It loading the custom model file from the same path and do the task inside saveModelCustomfields()

Hope it helps..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top