VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: lemick28 on March 01, 2017, 05:17:08 AM

Title: Template problem with Custom Fields
Post by: lemick28 on March 01, 2017, 05:17:08 AM
When running Ja_vintas template with the latest version of Virtuemart installed on my site it appears that Joomlart uses their own version of Virtuemart and while using that template there is no "Custom attributes" there used to be with the older Virtuemart 2 on Ja vintas
for example the buyer cannot select a specific color although I have those custom attributes set and they do appear when using Beez template as they should.
I have imported into the templates/ja_vintas/html/com_virtuemart/productdetails the file customfield.php which I borrowed from the Virtuemart core files and renamed it "default_customfields.php". so the page loads (it would not without it) however it will not load the custom fields and shows the following errors:
Notice: Undefined variable: viewData in /home/lemick5/public_html/templates/ja_vintas/html/com_virtuemart/productdetails/default_customfields.php on line 15

Notice: Undefined variable: viewData in /home/lemick5/public_html/templates/ja_vintas/html/com_virtuemart/productdetails/default_customfields.php on line 16

Which is the following 2 lines
$product = $viewData['product'];
$position = $viewData['position'];

Thats it I have no idea where to go from there. Obviously Custom fields are Vital to my website.

Here is a link to the product page with custom attributes:
http://www.lemickracing.com/index.php/shop/road-racing/brakes/master-cylinders/beringer-master-cylinders/beringer-br12-master-cylinder-detail

Obviously some Virtuemart files are missing but I dont know which ones they are.
I tried importing the Whole com_virtuemart file into Ja_vintas template to replace Ja_vintas com virtuemart which doesnt work.

Can someone please direct me to which Virtuemart core files are needed in the template in order for the custom fields to work properly?
Title: Re: Template problem with Custom Fields
Post by: Jörgen on March 01, 2017, 10:24:55 AM
Hello

You say that Your VM layout works with the Beez template. Then it should be obvious that the problem is the custom template. Adjust the template by comparing the template files with the working files in standard VM. Or talk to the template designer about this.

regards Jörgen @ Kreativ Fotografi



Title: Re: Template problem with Custom Fields
Post by: jenkinhill on March 01, 2017, 12:16:22 PM
http://forum.virtuemart.net/index.php?topic=108212.0

Title: Re: Template problem with Custom Fields
Post by: Studio 42 on March 14, 2017, 22:28:23 PM
Quote from: lemick28 on March 01, 2017, 05:17:08 AM
When running Ja_vintas template with the latest version of Virtuemart installed on my site it appears that Joomlart uses their own version of Virtuemart and while using that template there is no "Custom attributes" there used to be with the older Virtuemart 2 on Ja vintas
for example the buyer cannot select a specific color although I have those custom attributes set and they do appear when using Beez template as they should.
I have imported into the templates/ja_vintas/html/com_virtuemart/productdetails the file customfield.php which I borrowed from the Virtuemart core files and renamed it "default_customfields.php". so the page loads (it would not without it) however it will not load the custom fields and shows the following errors:
Notice: Undefined variable: viewData in /home/lemick5/public_html/templates/ja_vintas/html/com_virtuemart/productdetails/default_customfields.php on line 15

Notice: Undefined variable: viewData in /home/lemick5/public_html/templates/ja_vintas/html/com_virtuemart/productdetails/default_customfields.php on line 16

Which is the following 2 lines
$product = $viewData['product'];
$position = $viewData['position'];

Thats it I have no idea where to go from there. Obviously Custom fields are Vital to my website.

Here is a link to the product page with custom attributes:
http://www.lemickracing.com/index.php/shop/road-racing/brakes/master-cylinders/beringer-master-cylinders/beringer-br12-master-cylinder-detail

Obviously some Virtuemart files are missing but I dont know which ones they are.
I tried importing the Whole com_virtuemart file into Ja_vintas template to replace Ja_vintas com virtuemart which doesn't work.

Can someone please direct me to which Virtuemart core files are needed in the template in order for the custom fields to work properly?
$product = $viewData['product'];
$position = $viewData['position'];
is only used in VM 3, so your template cannot work.
And $viewData is only used in YOURSHOP\components\com_virtuemart\sublayouts\XXX.php or template override in same template subfolder html\com_virtuemart\sublayouts
SO you certainly bad copied this line of codes or the template devs.
Title: Re: Template problem with Custom Fields
Post by: GJC Web Design on March 14, 2017, 23:06:09 PM
why not just rename the the folder templates//ja_vintas/html/com_virtuemart  to templates//ja_vintas/html/com_virtuemart____

then your install will use the core VM template files

But it sounds like your template is simply not VM3 ready