Availability Image

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Aug 27, 2013 11:57 pm
Reply with quote
Report this post
Hello, I am having difficulty figuring out why my availability images will not show. I only get the file name showing up instead.

I have read another similar post but I believe my issue to be different.
https://www.gavick.com/forums/140/avail ... ty#p124298

In VM configuration I have out of stock products set to be orderable and an image to be displayed showing when they will be available.

The fact that “7d.gif” shows lets me know the configuration is correct but something could be wrong with the details.php file.

Any help would be appreciated.


Red
User avatar
Fresh Boarder

GK User
Wed Aug 28, 2013 7:55 am
Reply with quote
Report this post
Could you show me your site URL ? It is always easier to check CSS/HTML code on live site.
User avatar
Platinum Boarder

GK User
Wed Aug 28, 2013 5:38 pm
Reply with quote
Report this post
Thanks for getting back to me, here is a link to a product with no stock level.
http://accessible-apps.com/pcp/pc-peripherals-shop/notebooks/asus-vivo-smart-me400c-tablet-pc-detail.html

Many thanks

Richard.
User avatar
Fresh Boarder

GK User
Fri Aug 30, 2013 10:09 am
Reply with quote
Report this post
It looks like something is wrong VM or VM style, please look >> http://d.pr/i/mD7O even the IMG tag is not generated. Could you check whether the same happen on default Joomla! template like Beez ?
User avatar
Platinum Boarder

GK User
Fri Aug 30, 2013 10:14 am
Reply with quote
Report this post
Good thinking, it works in beez template so i will have a look at the standard product details php file and check the code for generating the availability image.

Maybe i can just copy and paste that segment.

thanks


Red
User avatar
Fresh Boarder

GK User
Sat Aug 31, 2013 10:37 am
Reply with quote
Report this post
Hi, I have a fix for this.

From your suggestion of checking out the beez template I was able to determine that if the images cannot be found the text alternative will be displayed exactly as it looks in your link.

The images were exactly where they were supposed to be. So I looked at the code that generated the URL for the image and broke it down piece by piece. There was something missing. Quite small, surprised I caught it.

In the file html/com_virtuemart/productdetails/default.php on line 377

After $templateName there was no “. DS .” code to add a forward slash to the URL.

This is what it was:

Code: Select all
<div class="availability">
       <?php echo (file_exists(JPATH_BASE . DS . 'templates' . DS . $templateName . 'images' . DS . 'vm' . DS . 'availability' . DS . VmConfig::get('rised_availability'))) ? JHTML::image(JURI::root() . 'templates/' . $templateName . '/images/vm/availability/' . VmConfig::get('rised_availability', '7d.gif'), VmConfig::get('rised_availability', '7d.gif'), array('class' => 'availability')) : VmConfig::get('rised_availability'); ?>
</div>


This is what It should be:

Code: Select all
<div class="availability">
    <?php echo (file_exists(JPATH_BASE . DS . 'templates' . DS . $templateName . DS . 'images' . DS . 'vm' . DS . 'availability' . DS . VmConfig::get('rised_availability'))) ? JHTML::image(JURI::root() . 'templates/' . $templateName . '/images/vm/availability/' . VmConfig::get('rised_availability', '7d.gif'), VmConfig::get('rised_availability', '7d.gif'), array('class' => 'availability')) : VmConfig::get('rised_availability'); ?>
</div>


That solved the problem.


Red
User avatar
Fresh Boarder

GK User
Tue Sep 03, 2013 7:58 am
Reply with quote
Report this post
Thanks for sharing your code. I'll add this fix for the template.
User avatar
Platinum Boarder


cron