Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    920
    Plugin Contributions
    1

    Default Is there any fast way to update text alignment for ALL product descriptions???

    I used to have all of my product descriptions centered, but now I'm upgrading, and the product info page has a different layout. I like the new layout better, but it doesn't look good with the centered text. I want to change them to justified, but I have over 500 products and it will take forever! Is there any kind of query I could execute in the database to do this?

    TIA!
    Danielle

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,655
    Plugin Contributions
    25

    Default Re: Is there any fast way to update text alignment for ALL product descriptions???

    Danielle

    Are you using version 1.3.0.2 or 1.3.5?

    Do you have an over-ride file for your tpl_product_info_display.php file?

    These questions are because you have a div with inline CSS that isn't usually present that is forcing your text to be centrally aligned. If we can track down the source and replace the inline CSS with a class, then you can control the alignment through your stylesheet.

    (I'm just hoping that the div isn't a part of every one of your database entries - though even then a quick script could strip them all out)
    See and test drive Zen Cart's free templates at zencarttemplates.info

    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Oct 2004
    Posts
    920
    Plugin Contributions
    1

    Default Re: Is there any fast way to update text alignment for ALL product descriptions???

    Hi, I am using 1.3.5. I do have an override for that file, but only because I added the cross-sell mod. Unfortunately I've been setting the alignment to centered for each product as I've been adding it

    What you said about a quick script that could strip that out is exactly what I'm looking for! I'm just not sure how to do it
    Danielle

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,655
    Plugin Contributions
    25

    Default Re: Is there any fast way to update text alignment for ALL product descriptions???

    I started to think about how to construct a script and realised that there is a much easier way to correct this.

    Step 1: Do a complete backup of your database by your normal method

    Step 2: use phpMyAdmin to export your product_description table only to a file, making sure that you tick the "add drop table" and "add of not exists" boxes

    Step 3: open the resulting file in a text editor and use the editor's search & replace facility to replace all instances of <div style="text-align: center;"> with <div class="description">

    Step 4: re-import the table via phpMyAdmin

    Step 5: add .description {text-align:left} to your stylesheet
    See and test drive Zen Cart's free templates at zencarttemplates.info

    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Oct 2004
    Posts
    920
    Plugin Contributions
    1

    Default Re: Is there any fast way to update text alignment for ALL product descriptions???

    GENIUS! You are a genius! It worked beautifully, thank you!

    Danielle

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,655
    Plugin Contributions
    25

    Default Re: Is there any fast way to update text alignment for ALL product descriptions???

    I'm glad that worked for you. However this was the quick and dirty fix which still leaves you having to add <div class="description"> and a </div> to the product description for each new product.

    Now that you've gotten the hang of this approach, you might wish to consider stripping these tags out of your database completely as you can easily attach the CSS styling you want for the description to the #productDescription ID that Zen Cart already inserts for you.

    I didn't suggest this originally because of the added complication of also striping out the </div> tags but upon reflection I don't think that would be any more difficult than what you've already done and I should have suggested it before.
    See and test drive Zen Cart's free templates at zencarttemplates.info

    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 

Bookmarks

Posting Permissions

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