Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Page Substitution


Hkanaris

Recommended Posts

I think this is what I am looking for.

 

Basically, when you go to the product page, at current you have an Image, and a description, and then the add to cart button etc. Is it possible to have then have buttons, or a links, for technical specification, more images, and possibly read reviews on that product. I think I came accross a contribution which I think will do some of what I want.

 

This is a very simple mod.  All the changes are in catalog/product_info.php:

 

find the line with:

 

<?php echo stripslashes($product_info['products_description']); ?>

and replace it with:

<?php
      $description = stripslashes($product_info['products_description']);
      if (substr($description,0,11) == "page_insert")
 {
     // we want to insert a page here instead based on posted #
         $explode_description = explode(chr(13).chr(10),$description);
         $index = (int)$HTTP_GET_VARS['page_index'];
    if (count($explode_description) < 2)
       echo $description;
         else
    {
            if ($index >= count($explode_description))
  {  // invalid index, show page 1
	 $index = 1;
  } 
  if ($index < 1)
               $index = 1;
   include $explode_description[$index];
    }
 }
      else
         echo stripslashes($product_info['products_description']);
    ?></p>

 

 

To use this mod, replace the description with the word "page_insert" followed by a carriage return / line feed (usually just by hitting enter) then list each of the pages you'd like displayed.  For example:

 

page_insert

clock_radio_overview.html

clock_radio_details.html

 

This will put the clock_radio_overview.html in place of the product description.  To display the clock_radio_details.html, add &page_index=2 to the end of the URL:

 

www.myecomsite.com/product_info.php?products_id=28&page_index=2

 

page_index starts at 1.  If it is invalid or not present, the first page on the list is used.

 

You can still enter descriptions for your products as always, just don't start it with the word "page_insert" as this is the trigger for the mod.

 

I have done this nut the keep geting the following error

 

Warning: main(e808.html&page_index=1): failed to open stream: No such file or directory in /homepages/38/d95739743/htdocs/4wsl.com/catalog/product_info.php on line 156

 

Warning: main(): Failed opening 'e808.html&page_index=1' for inclusion (include_path='.:/usr/local/lib/php') in /homepages/38/d95739743/htdocs/4wsl.com/catalog/product_info.php on line 156

 

 

can anyone help??

 

Thanks in advance

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...