Zen Cart Logo
Forums / General Questions / Strip Tags in Description

Strip Tags in Description

Locked

Views: 2,090

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
2 Apr 2008, 1:22 PM
#1
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Strip Tags in Description

With our new online store, we are using descriptions and data from our previous system. Unfortunately, we do not want to strip out all the code that we have in them but we would like to remove it on the fly. Where can I find the spot that I can insert the PHP strip_tags function to apply to the data from the database?

I want the short description limiting (to ~200 characters) to be done after the tags are removed of course.

2 Apr 2008, 2:09 PM
#2
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Re: Strip Tags in Description

Where does Zencart keep all its MySQL queries? For example, where is select * from products?? (where...)

2 Apr 2008, 2:10 PM
#3
chrome_orange avatar

chrome_orange

Totally Zenned

Join Date:
Jun 2004
Posts:
457
Plugin Contributions:
0

Re: Strip Tags in Description

benn600:

Where does Zencart keep all its MySQL queries? For example, where is select * from products?? (where...)

you need to look at the developers tool kit in the admin section of your site

2 Apr 2008, 2:19 PM
#4
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Re: Strip Tags in Description

I'm looking there. Where should I see queries? My issue is (maybe you can help solve it) that I need to run a php function on the "products_description" field for the main product text. It's a function I wrote to give all our descriptions a similar look (it finds and replaces some things). So if I can find where the queries are at and where they are run, I can just change it there so I don't have to change it on every page.

In looking through the Zencart files I'm having trouble finding a single query!

2 Apr 2008, 5:19 PM
#6
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Re: Strip Tags in Description

main_template_vars worked PERFECTLY for fixing the product info display page. The SQL is in there and I was able to fix the result right there.

Now for the product listing on search results (category listing) I can't seem to find the same thing.

Where is the SQL statement that gets info for listing products on a product_listing page?

Your assistance is greatly appreciated. Thanks!

2 Apr 2008, 8:36 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Strip Tags in Description

benn600:

Where is the SQL statement that gets info for listing products on a product_listing page?As I said, the product listing is built in /includes/modules/product_listing.php via:```
zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)

3 Apr 2008, 3:58 PM
#8
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Re: Strip Tags in Description

Now I am clicking on a category and all the products that list is where I'm seeing the problem.

zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)

if I change this to
zen_trunc_string(zen_clean_html(stripslashes('TESTING' . zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)

it doesn't seem to change anything on the description list.

3 Apr 2008, 4:01 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Strip Tags in Description

There are two instances of that in the file ... one which fires if a manufacturer filter has been selected, and one where no filter is selected.
Which one did you alter?

3 Apr 2008, 4:17 PM
#10
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Re: Strip Tags in Description

Amazing! Thanks! There are two lines. I fixed both of them.

Now one final question. We have a secondary ID for all our products to link with another system. Where is the actual SQL that gets this data? I need to add a field for it to get.

Thank you!

3 Apr 2008, 6:02 PM
#11
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Re: Strip Tags in Description

I need to modify a SQL statement, specifically the one that gets item information for listing products after clicking on a category.

Where can I find this SQL statement? I know how to modify it to suit my needs but can't find it.

3 Apr 2008, 7:33 PM
#12
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Re: Strip Tags in Description

I solved the problem. It was in product_listing.php and then I made a new function to get my itemnum (that I created in the database).

3 Apr 2008, 7:34 PM
#13
damd avatar

damd

New Zenner

Join Date:
Feb 2008
Posts:
9
Plugin Contributions:
0

Re: Strip Tags in Description

Hi,

It's in "/includes/index_filters/default_filter.php" file.
About line 55, you have :

// show the products in a given category

Right after, there's the SQL statement that you were looking for.

Good luck !

3 Apr 2008, 8:24 PM
#14
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Re: Strip Tags in Description

I modified a file but cannot figure out what file I was editing. I have looked everywhere.

What file contains the line:
$sql = "select p.products_id," ...?
It is the one that actually gets and displays the product info for a specific product's page.

Thanks!

3 Apr 2008, 8:28 PM
#15
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Re: Strip Tags in Description

Looking back at one of your previous posts, it could be..

includes/index_filters/default_filter.php

4 Apr 2008, 5:26 PM
#16
damd avatar

damd

New Zenner

Join Date:
Feb 2008
Posts:
9
Plugin Contributions:
0

Re: Strip Tags in Description

Sorry, it seems the problem was solved before i replied, but when i replied i didn't see any answers to your question (maybe because of a forum cache or my browser cache).