News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Is possible to have two or more default.php for one View, and how to call them?

Started by aksatob, November 06, 2012, 10:49:18 AM

Previous topic - Next topic

aksatob

Hi,

i know that Views can be override with copy default.php to template folder, but i need something a little bit different.

I want to keep standard productdeail view for shop, BUT i need also custom view for productdetails in popup window.

So its possible somehow  :) this :
template/html/com_virtuemart/productdetails/default.php
template/html/com_virtuemart/productdetails/defaultpopup.php

and in some link to product call defaultpopup.php instead default.php?

and if it is possible, can also modified default (defaultpopup.php)  use modified other php files (mean defaultpopup_showprices.php etc..)

thanks to any help or hints how to made this, or different workaround which gave me option using two different productdetails layouts.

jenkinhill

For each product you can specify a different override for Product Details Page - set on the Product information page.

You can also set different product overrides for each category - Default Product Details Page on Category general information page.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

aksatob

Quote from: jenkinhill on November 06, 2012, 13:31:10 PM
For each product you can specify a different override for Product Details Page - set on the Product information page.

You can also set different product overrides for each category - Default Product Details Page on Category general information page.

thanks for reply, but its posible to change it by code? or it  can be done only in backend?

to clarify:

i want to display each product by two ways:
first - normal  "eshop" view -its ok- i can modify defalt.php to get "default" layout which i need
second - i modified a little bit for myself module - mod_virtuemart_product - it displays product images with basic text and href to productdetails which is open in popup window (fancybox) - in this case i want to use modified layout of productdetails (that defaultpopup.php...)

so its mean that single product should be viewed in both ways - depend on user selection (e.g. if customer browse e-shop - or click on "banner" of images displayaed in custom module) - so its reason why i cant select "hard"  override in backend - it should be done by "custom" link in code..)

jenkinhill

Never tied it using code as we do not support hacking the core code - but "editing" a module should be OK. AFAIK the override to be used is read from the db but I'm not sure how/if it is added to the session/url.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

aksatob

Quote from: jenkinhill on November 06, 2012, 19:24:33 PM
Never tied it using code as we do not support hacking the core code - but "editing" a module should be OK......

I am not hacking anything.. at the first : i dont have a skill to do that  ;D Override is all what i am talking about.. i override default.php of mod_vm_product to change layout (name first, then image, then price), change image link - from image to product detail (all this changes are desribed here by MODs so i gues its ok)
At the last replace lightbox by fancybox - also not hacking i think... :) and because using popup, i want to for example hide navigation buttons of productdetail page - its make no sence to me why customers should be able to browse categories in popup window (it should be used only for product description, quantity change and add to card button). I can hide them by overrride productdetails default.php, but its mean, i think, that they are dissapear also from regular e-shop view - where i want to keep them... Each product can be at same time displayed normally in e-shop (mean in "main window") but also in module mod_vm_prod so i want to specify, that for productdetail page in "main page" will be used one layout  - and for productdetails page of same product in popup window (which will be open by click on image in module mod_vm_product) will be used second layout... I think that this cant be done in backend - because in administration you can choose product page "view php" but its used for that product everywhere on site...


i know, due my bad english, its maybe hard to understand what is the point from my view.. but for me its make sence to have separate (diferent) layouts for normal and popup view of product details....  I've seen that feature on several Pro templates, so i was asking, if i am ,for example, didnt miss some "standard" override feature..

aksatob

Solved by additional parameter in link and few If else condition in productdetails default.php , not so clear that i want it, but functional so i can live with it....  ;)