Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Nov 2007
    Posts
    126
    Plugin Contributions
    0

    Default 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. #2
    Join Date
    Nov 2007
    Posts
    126
    Plugin Contributions
    0

    Default Where are the mysql queries

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

  3. #3
    Join Date
    Jun 2004
    Posts
    613
    Plugin Contributions
    0

    Default Re: Where are the mysql queries

    Quote Originally Posted by benn600 View Post
    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

  4. #4
    Join Date
    Nov 2007
    Posts
    126
    Plugin Contributions
    0

    Default Re: Where are the mysql queries

    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!

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Strip Tags in Description

    Reference: http://www.zen-cart.com/index.php?ma...roducts_id=378

    For the product page, you're probably needing to look at the /includes/modules/pages/product/main_template_vars.php or header_php.php

    For the product-listings, try /includes/modules/product_listing.php
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Nov 2007
    Posts
    126
    Plugin Contributions
    0

    Default 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!

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Strip Tags in Description

    Quote Originally Posted by benn600 View Post

    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:
    Code:
    zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)
    If you don't want to modify it there, then go change the zen_get_products_description() function in the functions folder instead.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Nov 2007
    Posts
    126
    Plugin Contributions
    0

    Default 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($listi ng->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.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default 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?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Nov 2007
    Posts
    126
    Plugin Contributions
    0

    Default 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!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 strip meta tag description
    By 100asa in forum General Questions
    Replies: 8
    Last Post: 14 Jul 2014, 11:00 PM
  2. SEO URLs - how to strip HTML tags from product names?
    By gregy1403 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 14 Sep 2010, 04:31 PM
  3. Meta Tags - Site Description
    By karenkte in forum General Questions
    Replies: 7
    Last Post: 28 May 2008, 11:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg