Author Topic: Template problem with Custom Fields  (Read 330 times)

lemick28

  • Beginner
  • *
  • Posts: 1
Template problem with Custom Fields
« 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?

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 919
    • Kreativ Fotografi
  • VirtueMart Version: 3.0.19.9
Re: Template problem with Custom Fields
« Reply #1 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



Joomla 3.6.5
Virtuemart 3.0.19.9
Olympiantheme Hera (customized)

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 25790
  • Always on vacation
    • Jenkin Hill Internet
Kelvyn

Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.3 on Joomla 3.7.2 PHP 7.0.19

Testing VM3.2.3 on J!3.7.2

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2110
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Template problem with Custom Fields
« Reply #3 on: March 14, 2017, 22:28:23 pm »
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.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Hero Member
  • *
  • Posts: 7435
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: Template problem with Custom Fields
« Reply #4 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation