Author Topic: Problem with using text in the Availability field instead of an image.  (Read 762 times)

AnSit

  • Jr. Member
  • **
  • Posts: 91
Please tell me how to solve the problem.

In the Availability field, I enter the text I need (without selecting an image!).

And when I save or update the product editing page, this page takes a very long time to load - at least 30 seconds. I found by the browser means that all this time there is a search for an image that does not exist, since I manually filled the field with the text I needed.

Tell me how to remove such a long search for images so that the page does not load for so long? Or can you fix it in the next version of VM? If you can choose an image or enter text.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8892
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Problem with using text in the Availability field instead of an image.
« Reply #1 on: October 17, 2018, 18:38:42 pm »
live url?
standard templates?
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

AnSit

  • Jr. Member
  • **
  • Posts: 91
Re: Problem with using text in the Availability field instead of an image.
« Reply #2 on: October 17, 2018, 19:35:09 pm »
Thank you for your participation!

Yes, the control panel template is standard: isis - Default

Do you want me to give you a link to the site?
But you will not see anything from the frontend. It needs to enter edit mode through the control panel.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8892
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Problem with using text in the Availability field instead of an image.
« Reply #3 on: October 17, 2018, 19:51:03 pm »
you mean the delay is in the admin if u add a text as in screen?

Is that even the intention of that field?

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

AnSit

  • Jr. Member
  • **
  • Posts: 91
Re: Problem with using text in the Availability field instead of an image.
« Reply #4 on: October 17, 2018, 20:58:33 pm »
Yes, all right understood and shown!

When I add just my text there and save or refresh the page, the browser refreshes the page for a very long time. And if you look at the chronology of loading elements of the page, then the problem is precisely in the loading of this element. Over 30 sec.

I tried it in Firefox and Chrome

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8892
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Problem with using text in the Availability field instead of an image.
« Reply #5 on: October 17, 2018, 23:33:19 pm »
but as I say .. it would appear u are supposed to ( or maybe the code is wrong) just add the file name of an image that exists in the folder ( although don't know why it would be intended that way as I assume the dropdown finds all images)

If u add a txt there does it appear as the availability text on the front end?

Don't know why your server spends 30 sec gagging on a 404 image tho -- mine 404's but this uses a few milli secs
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

AnSit

  • Jr. Member
  • **
  • Posts: 91
Re: Problem with using text in the Availability field instead of an image.
« Reply #6 on: October 18, 2018, 02:20:13 am »
Yes, on the front side it is displayed as text, what I wrote in the field.
And it is very convenient when you just need the text, not the image.

I noticed even if you change the version of PHP from 7.2 to 5.6, then the page loads 6-8 seconds.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8892
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Problem with using text in the Availability field instead of an image.
« Reply #7 on: October 18, 2018, 10:32:37 am »
in file ( you can over ride these in your admin template/html/com_virtuemart/products )

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 } ?

hopefully done in the core next release
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

AnSit

  • Jr. Member
  • **
  • Posts: 91
Re: Problem with using text in the Availability field instead of an image.
« Reply #8 on: October 18, 2018, 13:06:44 pm »
Thank you very much for your help!
Your decision definitely helped.
Now, instead of 30 seconds, the page is updated 3 seconds.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9838
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Problem with using text in the Availability field instead of an image.
« Reply #9 on: October 21, 2018, 19:30:18 pm »
added, but different.

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

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

I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/