News:

Support the VirtueMart project and become a member

Main Menu

404 on non existent availability image when using text

Started by GJC Web Design, October 18, 2018, 10:39:31 AM

Previous topic - Next topic

GJC Web Design

no check for images causes 404 call to non existent files

administrator\components\com_virtuemart\views\product\tmpl\product_edit_status.php

~ line 123

replace
Code: [Select]
<td><img border="0" id="imagelib" alt="<?php echo vmText::_('COM_VIRTUEMART_PREVIEW'); ?>" name="imagelib" src="<?php if ($this->product->product_availability) echo JURI::root(true).$this->imagePath.$this->product->product_availability;?>"/></td>

with

Code: [Select]
      <td>
      <?php
         if(file_exists(JPATH_ROOT . '/' . VmConfig::get('assets_general_path') . 'images/availability/' . $this->product->product_availability)){ ?>
            <img border="0" id="imagelib" alt="<?php echo vmText::_('COM_VIRTUEMART_PREVIEW'); ?>" name="imagelib" src="<?php if ($this->product->product_availability) echo JURI::root(true).$this->imagePath.$this->product->product_availability;?>"/>
      <?php   } ?>
      </td>

and in administrator\components\com_virtuemart\views\config\tmpl\default_shopfront.php ~ line 141 perhaps better/cleaner to replace

Code: [Select]
      <img id="imagelib" alt="<?php echo vmText::_('COM_VIRTUEMART_PREVIEW'); ?>" name="imagelib" src="<?php if (VmConfig::get('rised_availability')) {
         echo JURI::root(true) . $this->imagePath . VmConfig::get('rised_availability');
      }?>"/>

with

Code: [Select]
   <?php if(VmConfig::get('rised_availability')){ ?>
      <img id="imagelib" alt="<?php echo vmText::_('COM_VIRTUEMART_PREVIEW'); ?>" name="imagelib" src="<?php if (VmConfig::get('rised_availability')) {
         echo JURI::root(true) . $this->imagePath . VmConfig::get('rised_availability');
      }?>"/>
   <?php } ?

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