Author Topic: 404 on non existent availability image when using text  (Read 475 times)

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9833
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
404 on non existent availability image when using text
« on: October 18, 2018, 10:39:31 am »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation