Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2008
    Posts
    138
    Plugin Contributions
    0

    Default category_id when linked products

    Hello

    I have searched and searched, I can't find the answer, so sorry if this has been covered before..

    I have recently added a new category, called "discontinued". All the products that are in here, are linked from the other categories.

    In my product_info_display.php I have used
    (zen_get_products_category_id($_GET['products_id']) == 34

    to say that all products that are in category number 34 shall have some extra text, saying that this product is discontinued.

    Problem is that when I link products from one category to another, the original category is beeing used. So my extra -discontinued-text- won't show.

    I would really appreciate some help here..

    You can see what I mean here:
    Productinfo on product in discontinued-category:
    http://www.tilbryllupet.no/restekurv...stearinlys-bla
    (Notice the red text there)

    Productinfo on product in a normal category:
    http://www.tilbryllupet.no/bryllup-b...oer/vannperler

  2. #2
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Re: category_id when linked products

    This would fix your problem but requires a little reversing..

    Why dont you move all products to the discontinued category and then link them back to there original categories.

    This would make you php code true and no further modification is needed.
    User of zencart

  3. #3
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Re: category_id when linked products

    Just a thought..

    To make your original thought work you would need to check for all products that are linked to the discontinued category and then check the master category using mysql query to get you desired effect.
    User of zencart

  4. #4
    Join Date
    Aug 2008
    Posts
    138
    Plugin Contributions
    0

    Default Re: category_id when linked products

    Quote Originally Posted by batteryman View Post
    This would fix your problem but requires a little reversing..

    Why dont you move all products to the discontinued category and then link them back to there original categories.

    This would make you php code true and no further modification is needed.
    I would've thought so too.. but nope, that didn't work. The "old" category was the one beeing used when I did this... strange.. yes, true.. yes..

    Quote Originally Posted by batteryman View Post
    Just a thought..

    To make your original thought work you would need to check for all products that are linked to the discontinued category and then check the master category using mysql query to get you desired effect.
    YEP :) This DID work, I got a friend to establish the connection. Because of the classes, it was out of my league - but he made it. Now it works like a charm!

    You can have a look here..
    http://www.tilbryllupet.no/restekurv-tilbud

    We used the master_categories_id to check if the product was attached to it, if so: Show my message - if not: Show original..

    Thanks for your answers though! Maybe this will help a searcher in the future..

    If so, contact me, and I'd be glad to share the code :)

    PS. We also changed the code, so that when customers try to add more in the shopping cart then actually in stock, they get a warning-message..
    If the product is NOT in the discontinued category, they don't get message, and they can order more than we have in stock..

    Very happy with it, and it has already made me money :)

  5. #5
    Join Date
    Jul 2004
    Location
    Las Vegas
    Posts
    477
    Plugin Contributions
    0

    Default Re: category_id when linked products

    Glad to hear it. Looks great...

    I would look into a cross sell module to help you cross promote on each product page as well.
    User of zencart

 

 

Similar Threads

  1. v154 Images stretching when linked from manufacturers
    By faze3 in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 14 Oct 2015, 08:55 PM
  2. setting products sort order when linked to multiple categories
    By mslewis5 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 19 Oct 2010, 12:53 AM
  3. Stock control of Linked Categories and Linked Products
    By limelites in forum Setting Up Categories, Products, Attributes
    Replies: 10
    Last Post: 7 Apr 2009, 09:45 AM
  4. Linked product goes to master category when clicked
    By bigbadbob in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 18 Jul 2008, 01:51 PM
  5. Check category_id to parent_id
    By numinix in forum Contribution-Writing Guidelines
    Replies: 5
    Last Post: 9 Jul 2007, 07:47 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