VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: skhn123 on May 29, 2014, 13:28:07 PM

Title: blank head tag in category page if i replace default.php with edited default.php
Post by: skhn123 on May 29, 2014, 13:28:07 PM
Hello Everyone,

i am using VM 2.6.0 also i am using override for category pages and its working fine but when i try to add some custom code in it. It goes white and the Head tag is blank so no style or JavaScript and it just showing only category title, one product picture and shorting option that's it.

i was using joomla cache before but now i have disable it.

please help me.
Sadique.

[attachment cleanup by admin]
Title: Re: blank head tag in category page if i replace default.php with edited default.php
Post by: jenkinhill on May 29, 2014, 14:58:17 PM
So whatever custom code you add is not correct and causes an error. As you don't show what code you were adding and why, nobody can help.
Title: Re: blank head tag in category page if i replace default.php with edited default.php
Post by: skhn123 on May 29, 2014, 15:28:11 PM
oh sorry for that (my bad)

i add some code to display second image of product in category page, here is the complete code for image display:

<div class="prod-img">
<a title="<?php echo $product->product_name ?>" rel="vm-additional-images" href="<?php echo $product->link?>">
<?php
echo $product->images[0]->displayMediaThumb('class="browseProductImage"'false); ?>

                           
                            <?php
echo $product->images[1]->displayMediaThumb('class="browseProductImage flip"'false); ?>

</a>
</div>
Title: Re: blank head tag in category page if i replace default.php with edited default.php
Post by: skhn123 on May 31, 2014, 13:06:14 PM
please help me it stopping me to go further.  :(
Title: Re: blank head tag in category page if i replace default.php with edited default.php
Post by: GJC Web Design on May 31, 2014, 14:30:48 PM
no $product->images[1]  ????
Title: Re: blank head tag in category page if i replace default.php with edited default.php
Post by: skhn123 on May 31, 2014, 14:43:33 PM
hello GJC

i add these two codes to display two (first and second) images of same product:
for first image:
<?php echo $product->images[0]->displayMediaThumb('class="browseProductImage"'false); ?>

for second image:
<?php echo $product->images[1]->displayMediaThumb('class="browseProductImage flip"'false); ?>

and its working almost fine in localhost in every category except for just one category i dont know why. but when i upload it to my live server it makes all category looks like same as i attached in my previous post.
Title: Re: blank head tag in category page if i replace default.php with edited default.php
Post by: skhn123 on May 31, 2014, 14:52:23 PM
hey GJC,

I just found out what was the problem. actually some of my product don't have second image or we could say additional images. thats why it was working weird. now because of this a new question has arise that how to check if it has any additional image then apply this code:

<?php echo $product->images[1]->displayMediaThumb('class="browseProductImage flip"'false); ?>

do you have any solution?
please help.
Title: Re: blank head tag in category page if i replace default.php with edited default.php
Post by: GJC Web Design on May 31, 2014, 15:11:09 PM
Come on - you have to learn some coding if you want to code!!!!!

2 mins on Google will tell you!!! You can't just continue to ask others to code your site for you.....

if($product->images[1]) {

$product->images[1]->displayMediaThumb('class="browseProductImage flip"', false);

}
Title: Re: blank head tag in category page if i replace default.php with edited default.php
Post by: skhn123 on June 02, 2014, 14:35:45 PM
hey GJC

:( Sorry for late update but actually i already accomplice that (and yes Google did help me  ;) ) but anyway thanks for your time and support i really appreciate it.