News:

Looking for documentation? Take a look on our wiki

Main Menu

Problem with using text in the Availability field instead of an image.

Started by AnSit, October 17, 2018, 18:20:10 PM

Previous topic - Next topic

AnSit

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

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

AnSit

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

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

AnSit

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

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

AnSit

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

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

<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

<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

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

AnSit

Thank you very much for your help!
Your decision definitely helped.
Now, instead of 30 seconds, the page is updated 3 seconds.

Milbo

added, but different.


<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;?>"/>



<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');
}?>
"/>


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