Hello,
Sorry if my post is not as the right place!
I am looking for a solution to add a new view for product details page, not for overriding default.php view.
I need to add a donation product to a website, and let customers decide how much they want to donate.
So I created a product with price=0 and add custom field for donation.
But on product detail view appears price=0 I don't want to see!
I tried to duplicate "productdetails/tmpl/default.php" and named it "no_price.php", I modified it to not display price but I don't know how to add "no_price" view to "default", "pdf" and "notify": how can I do?
Thanks for your answers!
products->product->product information->product details page dropdown
Thanks but it's not the solution: "no_price" doesn't appear in dropdown list, only "No override", "default", "pdf" and "notify"!
How can I add "no_price" to that list?
add a template over ride called no_price.php to your product details over rides
Sorry but no!
I added "no_price.php" in "my_template/html/com_virtuemart/productdetails" folder, but dropdown list remains "no override, default, pdf, notify" in product category form and product information.
Works every time for me in VM2.6.6 Make sure that the path is correct, with no typos, and that the correct template has been chosen. There is one commercial template developer that uses a different path for overrides, so check that if you have a commercial teamplate.
I'm using beez5 as default template on a test site (J! 2.5.22 VM 2.6.6), override in "templates/beez5/html/com_virtuemart/productdetails/no_price.php" where "no_price.php" is a modified copy of "components/com_virtuemart/views/productdetails/default.php", but "no_price" don't appear on dropdown list.
I don't understand what to do for listing "no_price" in this list.
Just realised you have an underscore in the file name. That prevents the file being seen, it should be a hyphen if you need a spacer. http://docs.joomla.org/Layout_Overrides_in_Joomla
Thanks Kelvyn! It's OK now.
Another question: is it possible to duplicate and modify default_addtocart.php -> no-price_addtocart.php to not show quantity and "+" and "-" buttons, and change text for addtocart button?
Quote from: RobertG on July 13, 2014, 15:49:01 PM
Another question: is it possible to duplicate and modify default_addtocart.php -> no-price_addtocart.php to not show quantity and "+" and "-" buttons, and change text for addtocart button?
I reply to myself ;):yes, it's the right way!
View named "no-price.php" and addtocart file named "no-price.addtocart.php" work together!
New problem! In 2.9.8 version, there is no more "default_addocart.php", because addtocart is now in "sublayouts/addtocart.php" and called line 167 of "productdetails/default.php" by
Quoteecho shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$this->product));
So my question is: how to override this sublayout?
You may add "components/com_virtuemart/sublayouts/addtocart.php", rename and modify it: "my_template/html/com_virtuemart/sublayouts/noshipping.php" when special detail view for product is "my_template/html/com_virtuemart/productdetails/noshipping.php" where the previous quoted line is now
Quoteecho shopFunctionsF::renderVmSubLayout('noshipping',array('product'=>$this->product));
Don't play with 2.9.8 yet - but if you do please report your findings on the dev & testing board, http://forum.virtuemart.net/index.php?board=136.0
Not only is is a test/development pre-release version, but as you found it uses a somewhat different templating system with sublayouts. These are overriden by placing the files in yourtemplate/html/com_virtuemart/sublayouts/