VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: OriyanJ on December 23, 2015, 12:37:24 PM

Title: Overriding back-office (VM3)
Post by: OriyanJ on December 23, 2015, 12:37:24 PM
I've noticed a few questions regarding this issue but they were all old and I was hoping you'd help me understand it a bit better.
I'm trying to add new inputs to the back-office's products, I don't want my changes to get trashed when updating, is there a way to override the files without figuring out how to make a plug in?
Title: Re: Overriding back-office (VM3)
Post by: GJC Web Design on December 23, 2015, 12:46:52 PM
Quoteinputs to the back-office's products
??

use custom fields.. or unused fields and rename
Title: Re: Overriding back-office (VM3)
Post by: OriyanJ on December 23, 2015, 13:00:57 PM
I thought about it but I really prefer editing the template instead of creating countless custom fields for each product.
I have like 10 new fields I want to add and I hoped there's a way to override the admin template.
Title: Re: Overriding back-office (VM3)
Post by: jenkinhill on December 23, 2015, 13:07:29 PM
BE templates can be overriden in the same way as FE, the only difference being that the BE does not use sublayouts.

eg edit the files at administrator/components/com_virtuemart/views/shoppergroup/tmpl/
and put the overrides in
administrator/templates/isis/html/com_virtuemart/shoppergroup/   (assuming you use Isis in the BE).
Title: Re: Overriding back-office (VM3)
Post by: GJC Web Design on December 23, 2015, 13:22:54 PM
but simply adding new fields isn't going to add them to the DB etc .. and any DB changes will be over written
Title: Re: Overriding back-office (VM3)
Post by: OriyanJ on December 23, 2015, 13:27:26 PM
GREAT! jenkinhill, thank you. exactly what I needed to figure out.
GJC Web Design, I did manage to control the DB, adding new tables and fields, are they going to be deleted?
Title: Re: Overriding back-office (VM3)
Post by: jenkinhill on December 23, 2015, 13:45:14 PM
New tables which are not part of the default VM db tables will not be overwritten on update.
Title: Re: Overriding back-office (VM3)
Post by: OriyanJ on December 23, 2015, 15:28:39 PM
You guys are so helpful, much appreciated!
Title: Re: Overriding back-office (VM3)
Post by: OriyanJ on December 23, 2015, 16:15:31 PM
I'm trying to override -
/com_virtuemart/helpers/shopfunctionsf.php with /templates/[TEMPLATE]/html/com_virtuemart/sublayouts/shopfunctionsf.php
/com_virtuemart/tables/products.php with /templates/[TEMPLATE]/html/com_virtuemart/tables/products.php

But it seems not to work, am I doing something wrong?

Title: Re: Overriding back-office (VM3)
Post by: GJC Web Design on December 23, 2015, 16:47:37 PM
helpers don't over ride
Title: Re: Overriding back-office (VM3)
Post by: OriyanJ on December 23, 2015, 18:54:20 PM
1. If helpers don't override that means I'm gonna lose my changes there?
2. What about tables?

Thanks for being patient with me :)
Title: Re: Overriding back-office (VM3)
Post by: AH on December 23, 2015, 19:16:32 PM
Table overrides may get reset if you have messed with existing fields

If you add new table fields the code that manages them will get reset - the "new" table entries should be kept

Display templates that are saved in the relevant html/ directories will not be touched

Language overrides if done using the joomla override method will be kept - if you have just updated the VM language files, they will be lost