Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Include PHP files and Include INC and TXT files not working.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-19-2003, 12:41 PM
 
MiguelS MiguelS is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 36
 

Default Include PHP files and Include INC and TXT files not working.

I want to add to all of my product descriptions a little html table i made, but it won't parse my virtual include tags or my php include tags.

I want to put this inside the product description of all of my products withought having to put the html code in every single product description. How can i work around this?
Reply With Quote
  #2  
Old 09-19-2003, 11:22 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

are you putting the include in the template? or the database?

it wont parse if you do it in the database.

in the template

something like:

{include_php file="/path/to/load_nav.php"}

ideally the file to load in will be named so as to easily recall it such as being named after the sku.

then you could do:

{assign var="sku" value = $product.productcode}
{assign var="file" value = "$sku.php"}
{include_php file=$file}
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 09-20-2003, 01:00 PM
 
MiguelS MiguelS is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 36
 

Default

Yeah i was able to incorporate it in the template field which is great, but it's not the way i'd like it to be. See because the php file i'm including is product specific.

What can I do to have certain templates work for certaing product categories. For instance. I have a custom table that creates a pop-up window when clicked on for product description.

But no all my products have these specific tables.

The websit i'm working on is a photography store.

One part of the store has pictures that are for sale, the other part of the store has cameras for sale.

The area that has photos has a little table that has a pop of several product descriptions, however the Camera products won't have this table, but because the table is embedded in the product template it will appear for all products.

What can I do to work around this?

I think I can work around this if i could grab the current category value, but i don't know how to do that. What snippet of code can i use to do this say I want:

if category=Action Photos
literal
include ("table.php")
/literal

else
regular display.

I just need to know what variable the current main category is stored in so i can check it against a constant. Then I think i can solve my problem. Many thanks in advance.

P.S. the site that we bought the license for is trevinosphoto.com
Reply With Quote
  #4  
Old 09-21-2003, 12:13 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Quote:
Originally Posted by MiguelS
if category=Action Photos
literal
include ("table.php")
/literal

else
regular display.

Code:
{if $cat eq "123"} {assign var="sku" value = $product.productcode} {assign var="file" value = "$sku.php"} {include_php file=$file} {else} do normal stuff {/if}
Where 123 is the category id of the category and the included file is named the same as the sku.
__________________
ex x-cart guru
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:52 AM.

   

 
X-Cart forums © 2001-2020