Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    red flag Custom Content Display

    I have a category which contains products inside sub categories.

    Each product has some custom content at the bottom of the page. Every product has the same custom content, apart from one.

    I am using this PHP to display the custom content:

    PHP Code:
    <?php if ($_GET['cPath'] == 172) { ?>My Custom Content<?php ?>
    This works fine, apart from it displays the wrong content on the product where it should be different content to the rest of the category.

    How would I change this so that displays the right content? I was thinking target the product id rather than cPath

    Something like:

    PHP Code:
    <?php if ($_GET['cPath'] == 172) { ?>My Custom Content
    <?php } elseif ($_GET['products_id'] == 9006) { ?>
    My Product Custom Content<?php ?>
    But that doesn't work
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  2. #2
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,688
    Plugin Contributions
    9

    Default Re: Custom Content Display

    try reversing it:

    PHP Code:
    <?php 
        
    if ($_GET['products_id'] == 9006) { 
            
    ?>
            My Product Custom Content
            <?php 
        
    } elseif ($_GET['cPath'] == 172) { 
            
    ?>
            My Custom Content
            <?php 
        
    }
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #3
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Custom Content Display

    Thanks Carl, that worked :-)
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,684
    Plugin Contributions
    123

    Default Re: Custom Content Display

    > Every product has the same custom content ...

    Be sure you have defined the content once in a file or a configuration setting so you can update it in one place and get the results everywhere.

    You might be able to use my boilerplate tip

    https://www.thatsoftwareguy.com/zenc...scription.html

    or perhaps Define Page Anywhere:
    https://www.thatsoftwareguy.com/zenc..._anywhere.html
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Custom Content Display

    Quote Originally Posted by swguy View Post
    > Every product has the same custom content ...

    Be sure you have defined the content once in a file or a configuration setting so you can update it in one place and get the results everywhere.

    You might be able to use my boilerplate tip

    https://www.thatsoftwareguy.com/zenc...scription.html

    or perhaps Define Page Anywhere:
    https://www.thatsoftwareguy.com/zenc..._anywhere.html

    Thanks, I don't think I need that though. The solution I was given easily works for me.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

 

 

Similar Threads

  1. Custom Category/ Products content?
    By timhersh in forum General Questions
    Replies: 3
    Last Post: 26 Jul 2012, 04:15 PM
  2. Custom index page content
    By joshgesler in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 16 Nov 2009, 11:42 AM
  3. Module within custom content
    By nomad73 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 31 May 2009, 03:09 PM
  4. Custom Sidebox Content
    By jwitt98 in forum Basic Configuration
    Replies: 10
    Last Post: 25 Feb 2009, 11:28 PM
  5. Custom Category Content
    By spretswell in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 18 Aug 2006, 03:09 AM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR