[solved] Tiny 'mod': how to disable modification of a single product?

Started by lnnntr, April 22, 2016, 21:27:43 PM

Previous topic - Next topic

lnnntr

Hey guys.

I need help. I literally need a one-liner.

Where to paste, something that I reckon will look like

if($product -> id == 123) return false;

so to cancel attempts to modify a single product?


Another oneliner with an error message, like, I don't know,

JSingleton::genericErrorMessage('This product cannot be edited');

would be nice, but isn't necessary.


I really hate to say this, but this is pretty urgent, so I would be *highly* grateful. :) Basically, I as an ugly hack don't display a part of the product form and sending it would erase the corresponding data in the database, which can't happen.

I'm aware of http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem and actually agree that this probably is one, but I have no choice ATM.


Thanks a lot!

lnnntr

Thankfully [solved], I think.

if($product_data -> virtuemart_product_id == 123)
{
vmWarn('No');
return false;
}


in store() in /administrator/components/com_virtuemart/models/product.php.

See you. :)