X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Include PHP files and Include INC and TXT files not working. (https://forum.x-cart.com/showthread.php?t=4409)

MiguelS 09-19-2003 12:41 PM

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?

funkydunk 09-19-2003 11:22 PM

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}

MiguelS 09-20-2003 01:00 PM

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

funkydunk 09-21-2003 12:13 AM

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.


All times are GMT -8. The time now is 02:48 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.