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

Category template remove filters

Started by Fintan, August 01, 2013, 11:24:46 AM

Previous topic - Next topic

Fintan

This problem is being persistent with me.
I tried this:
<?php if (!empty($product->prices['salesPrice'])) {
require_once("modules/mod_virtuemart_product/helper.php");
echo mod_virtuemart_product::addtocart ($product);
}
?>


Then this:
QuoteJust wanted to add my solution to this problem as I did not modify any of the root virtuemart code and it includes the custom fields.

It seems to work fine, should not be overwritten if you update virtumart and it is easy to revert to the original virtuemart later.

These are the steps
1 Create a folder rootOfYourSite/templates/yourTemplate/html/com_virtuemart/category
Files included in this folder will have higher preference ("overwrite")  than the orginal virtuemart files

2 Copy default.php to the folder created in step 1
This is the original virtuemart file from components/com_virtuemart/views/category/tmlp/default.php
ecxept for lines 288 where I include addToCartCategory.php and line 291 which is commented out.
In line 252 I included the full description instead of short description of the product

3 Copy addToCartCategory.php to the folder created in step 1
This is the original virtuemart file from components/com/virtuemart/views/productdetails/tmpl/default_addtocart.php
except I did replace all $this->product with $product

Could not figure out this:
Quote2 Copy default.php to the folder created in step 1
This is the original virtuemart file from components/com_virtuemart/views/category/tmlp/default.php
ecxept for lines 288 where I include addToCartCategory.php and line 291 which is commented out.
In line 252 I included the full description instead of short description of the product

My line 288 is empty as is 291 and 252 does not show me any kind of description. (See attach)

I have just one category with my specials.

How can I easily get rid of the filter fields?
http://www.latina-bodyfashion.ch/Test/index.php/en/weekly-specials

I am not good with PHP, so be patient with me please.

There should just be a button in configuration that says "add cart to category view". I know that this basicly a free product and a very complete one at that, but trivial functions should really not require all this hacking. (Sorry, just had to get rid of some steam ;) )

[attachment cleanup by admin]

Maxim Pishnyak

Quote from: Fintan on August 01, 2013, 11:24:46 AM
My line 288 is empty as is 291 and 252 does not show me any kind of description. (See attach)
Check not your, but instead his lines. Your goal is to find how was included addToCartCategory.php in that example default.php.

Then you could use such part of code to include addToCartCategory.php in more suitable part of your category default.php
Quote from: Fintan on August 01, 2013, 11:24:46 AM
How can I easily get rid of the filter fields?
You need to explore your possibilities a bit more.

You need to edit your default.php template file for your VM general category.

Find that file.

Find where are place of these filters that you need to get rid off.

If you have troubles you could explore your current category page with the powerful tool for webmasters called Firebug (check sticked thread in that forum section).

Quote from: Fintan on August 01, 2013, 11:24:46 AM
There should just be a button in configuration that says "add cart to category view". I know that this basicly a free product and a very complete one at that, but trivial functions should really not require all this hacking. (Sorry, just had to get rid of some steam ;) )
Concept of VM is such that what you're calling 'hacking' is customizing prepared templates for various parts for web shop.

The diff between hacking and customizing is that last one is more friendly and more easy to the webmaster.

Now it's easy to learn how to customize look of VM pages.

Obviously customizing is not trivial task in general.

And add-to-cart functionality on category pages is not so requested in most web shops overall.
Majority don't need it.

Also that ones who need add-to-cart in categories anyway need to adjust look of that cart block in most cases.
Manual customizing category template is way it must be.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart