s02e06 - Product Terms SUPPORT/QUESTIONS

Open to all! Ask other shopowners for help.
Post Reply
Dnj1964
Member
Posts: 54
Joined: Fri Nov 06, 2020 8:27 pm
Phoenix Version:
Has thanked: 8 times

Product Terms

Post by Dnj1964 »

CE Phoenix v1.0.8.12 and using S02e06 -> 1.0.8.5 - Product Terms

Adding a term doesn't allow html to be used. Shows as one long document.

Not sure why it doesn't work same as privacy, conditions or other info pages.

Any way to get product terms to use html.

Thanks

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: s02e06 - Product Terms

Post by ecartz »

Dnj1964 wrote: Wed Mar 30, 2022 3:00 am Any way to get product terms to use html.
If you want HTML in the product terms, you will have to change in admin/includes/actions/ insert.php and save.php the Text::input to Text::prepare for any column you want to have HTML. E.g. the name and description.
Dnj1964
Member
Posts: 54
Joined: Fri Nov 06, 2020 8:27 pm
Phoenix Version:
Has thanked: 8 times

Re: s02e06 - Product Terms

Post by Dnj1964 »

Thanks again.

Worked perfectly.
ecartz wrote: Wed Mar 30, 2022 4:29 am
Dnj1964 wrote: Wed Mar 30, 2022 3:00 am Any way to get product terms to use html.
If you want HTML in the product terms, you will have to change in admin/includes/actions/ insert.php and save.php the Text::input to Text::prepare for any column you want to have HTML. E.g. the name and description.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: s02e06 - Product Terms

Post by heatherbell »

Found a couple of issues.
1. On admin/terms.php, Action icon does not change when clicked as expected.
Possibly issue is on Line 43 which is:

Code: Select all

return (isset($row['info']->id) && ($row['info']->id === $row['terms_id']))
2. On admin/terms.php, click Delete and then Delete confirm on first item in list gives notice and associated error:
Undefined index: tID - /includes/actions/terms/delete_confirm.php on line 12
However, possibly issue is in admin/includes/actions/terms/infoboxes/default.php Line 13 which is:

Code: Select all

$link = $GLOBALS['Admin']->link()->retain_query_except();
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: s02e06 - Product Terms

Post by ecartz »

heatherbell wrote: Wed Sep 21, 2022 12:50 pm Found a couple of issues.
TY. I updated the zip in the previous post.
Denzel
Member
Posts: 87
Joined: Sat Oct 31, 2020 7:22 pm
Phoenix Version:
Has thanked: 9 times
Been thanked: 15 times

Re: s02e06 - Product Terms

Post by Denzel »

Found an other issue in admin/includes/actions/terms/infoboxes/delete.php causing error 500 on confirm delete.
Line 13 should be :

Code: Select all

  $link =   $link = $GLOBALS['Admin']->link()->retain_query_except(['action'])->set_parameter('tID', (int)$table_definition['info']->terms_id);
and Line 15 should be:

Code: Select all

  $contents = ['form' => new Form('terms', (clone $link)->set_parameter('action', 'delete_confirm'))];
to work.
User avatar
Pierre_P
Contributor
Posts: 144
Joined: Fri Mar 12, 2021 5:06 am
Phoenix Version: v1.1.0.6
Has thanked: 21 times
Been thanked: 11 times

Re: s02e06 - Product Terms

Post by Pierre_P »

In admin if you assigned terms to products it will only count the number of products using that term.
If you have many products assigned to that term and you have long forgot what products it was i added a simple output to show you what products are assigned to that term.

Added change in admin/includes/actions/terms/infoboxes/default.php
below

Code: Select all

$contents[] = ['text' => '<b>' . $table_definition['info']->products_count . '</b> Products is using this Term'];
add:

Code: Select all

    $terms_query =  $GLOBALS['db']->query("SELECT pb.terms_id, pb.products_id, p.products_id, pd.products_name, pd.language_id FROM products p LEFT JOIN products_to_terms pb ON (pb.products_id=p.products_id) LEFT JOIN products_description pd ON (pd.products_id=pb.products_id) WHERE  pd.language_id = '1' AND terms_id = " . (int)$table_definition['info']->terms_id);
    if (mysqli_num_rows($terms_query) < 1) {
        $contents[] = ['text' => '<b>Congratulations!</b> There are no products assigned to this Term'];
    } else {
        while ($terms = $terms_query->fetch_assoc());
        foreach ($terms_query as $option => $value) {
            $contents[] = ['text' => 'Products Name: ' . $value['products_name'] . ' pID: ' . $value['products_id']];
        }
    }
Hth.
User avatar
Cary
Member
Posts: 34
Joined: Fri Mar 12, 2021 9:36 pm
Phoenix Version: v1.0.9.1
Has thanked: 3 times
Been thanked: 3 times

Re: s02e06 - Product Terms

Post by Cary »

Anyone using this with 1.0.9.1+? Just wondering before I add since this handy feature I have running on an older 1.0.8.5 site.

Thanks!
- Cary


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply