News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

PRODUCT DATAILS PAGE WITH IFRAME INSIDE [SOLVED]

Started by roby.ds, January 15, 2013, 15:21:08 PM

Previous topic - Next topic

roby.ds

Hi.. I need to create an iframe inside the product-details page containing the description
(all of you may ask why?... cause I can control the imported descriptions and there are alweys errors that are going to upset the template layout )

I was looking to insert in my default.php of the product-ditails something like this:

    <!-- <iframe src="details.php" class="w100x100" style=" border:none; height:300px;" scrolling="auto"/ >   

calling a new page created for the ocasion in the product-ditails directory of my template but obviously it doesnt work...
any ideas??

Mod edit: bump message removed. See http://forum.virtuemart.net/index.php?board=114.0

roby.ds

OK... more info.. if this can help:
I need a way to isolate the description content of the product from the rest of the page.
I already created a custom template (product_details.php) in my joomla template.

I've tried to create a page to include however this solution doesn't solve the problem..
I've tried to create a details page containing only the description of the product but i'm not able to call it by an iframe cause i don't know how to call it
and this is not the right way
Quote<!-- <iframe src="details.php" class="w100x100" style=" border:none; height:300px;" scrolling="auto"/ >   

roby.ds

#2
Ok.. working alone and using some solutions found in the forum for other problems i finally solved my own mistery:

I modified my productdetails default page:

At the begin of the code in line 1 i putted:

<?php
$details
=$_GET['details'];
if (!(
$details=='yes')){


I create a variable that i catch from the url so when i set the productdetails default page to be in the frame i can make the system run a different code instead of the default one

Then i changed tha ditails part of the productdetails default page from this:
// Product Description
if (!empty($this->product->product_desc)) {
    ?>
        <div class="product-description">
<?php /** @todo Test if content plugins modify the product description */ ?>
    <span class="title"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE'?></span>
<?php echo $this->product->product_desc?>
        </div>
<?php
    
// Product Description END


to this:

<?php  // Product Description
if (!empty($this->product->product_desc)) {
?>

<div class="product-description">
<?php /** @todo Test if content plugins modify the product description */ ?>
            <iframe src="index.php?option=com_virtuemart&view=productdetails&amp;virtuemart_product_id=<?php echo $this->product->virtuemart_product_id ?>&amp;virtuemart_category_id=<?php echo $this->product->virtuemart_category_id ?>&amp;tmpl=component&amp;details=yes" class="w100x100" style=" border:none; height:300px;" scrolling="auto" style="clear:both;"></iframe>
</div>
<?php }
 
 // Product Description END
 ?>



I call an iframe setting it to call the same page with all the variables... (to tryed to use the JRoot command instead to put directly the the link but it toesnt work )

then at the end of the page code i putted this:
}else{
if (!empty($this->product->product_desc)) {
?>
<div class="product-description">
<?php /** @todo Test if content plugins modify the product description */ ?>
<span class="title"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE'); ?></span>
<span class="description"><?php  echo $this->product->product_desc?></span>
</div>
<?php }
}
?>


so when the page is runned in the iframe the productdetails default page (inside the frame) only show the product description...

Sorry for my english

pgad003