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

Disable products do no have image

Started by charlycx, November 26, 2013, 22:03:00 PM

Previous topic - Next topic

charlycx

Good afternoon.

Excuse my English.

I have a client with a store with over 4000 products.

many products do no have image.

VM2 can be configured to not display the products that no have image?

Thanks

GJC Web Design

without hacking the core query you could do something like this in the product template

// Start the Output
foreach ($this->products as $product) {
if($product->virtuemart_media_id[0] > 0){


don't forget the closing curly brace

this will only prevent them displaying - will still appear (I assume) in search etc
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

charlycx

Thank you very much ...

Sorry I'm not an expert.

Where exactly put this hack?

thanks again

Quote from: GJC Web Design on November 26, 2013, 22:41:33 PM
without hacking the core query you could do something like this in the product template

// Start the Output
foreach ($this->products as $product) {
if($product->virtuemart_media_id[0] > 0){


don't forget the closing curly brace

this will only prevent them displaying - will still appear (I assume) in search etc

GJC Web Design

make a template over ride

templates/your_template/html/com_virtuemart/category/default.php

default.php is copied from

components/com_virtuemart/views/category/tmpl/default.php

code
if($product->virtuemart_media_id[0] > 0){

goes straight after ~ line 213


// Start the Output
foreach ($this->products as $product) {


................   ............................

closing curly
}

goes immediately before  ~ line 423

} // end of foreach ( $this->products as $product )
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Maxim Pishnyak

Quote from: charlycx on November 26, 2013, 22:03:00 PM
many products do no have image.

VM2 can be configured to not display the products that no have image?
You should use forum search for finding already posted solutions. For example using 1x1 transparent images (placeholders).
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