Show linked categories on catalog.php

Open to all! Ask other shopowners for help.
Omar_one
Senior Contributor
Posts: 679
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: Show linked categories on catalog.php

Post by Omar_one »

tessthepup wrote: Sun Nov 12, 2023 1:20 pm
@Omar_one
Still getting the same error :(
I am running php 8.0 if that makes any difference.

Could you check and see at your side?
here is screenshot from our live shop runs PHP 8.2 without errors
21213.JPG
You do not have the required permissions to view the files attached to this post.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 56 times
Been thanked: 62 times

Re: Show linked categories on catalog.php

Post by tessthepup »

Omar_one wrote: Sun Nov 12, 2023 1:29 pm
tessthepup wrote: Sun Nov 12, 2023 1:20 pm
@Omar_one
Still getting the same error :(
I am running php 8.0 if that makes any difference.

Could you check and see at your side?
here is screenshot from our live shop runs PHP 8.2 without errors
21213.JPG
@Omar_one
Thanks for the help although when I switch php versions up or down from version 8 the store breaks urgh
Omar_one
Senior Contributor
Posts: 679
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: Show linked categories on catalog.php

Post by Omar_one »

tessthepup wrote: Sun Nov 12, 2023 1:35 pm Thanks for the help although when I switch php versions up or down from version 8 the store breaks urgh
which phoenix versions you have?
User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 56 times
Been thanked: 62 times

Re: Show linked categories on catalog.php

Post by tessthepup »

Omar_one wrote: Sun Nov 12, 2023 1:54 pm
tessthepup wrote: Sun Nov 12, 2023 1:35 pm Thanks for the help although when I switch php versions up or down from version 8 the store breaks urgh
which phoenix versions you have?
@Omar_one
CE Phoenix v1.0.8.20
Omar_one
Senior Contributor
Posts: 679
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: Show linked categories on catalog.php

Post by Omar_one »

can you please post your code
User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 56 times
Been thanked: 62 times

Re: Show linked categories on catalog.php

Post by tessthepup »

Omar_one wrote: Sun Nov 12, 2023 2:04 pm can you please post your code
@Omar_one
It is a cut and paste of your code

Code: Select all

<?php
class hook_admin_catalog_categories{
   function listen_infoBox($parameters) {
     global $product;
     if  (isset($product && ($product Instanceof Product)) $parameters['contents'][] = ['class' => 'style', 'text' => Categories::draw_breadcrumbs($product->get('categories'))];
  }
}
Omar_one
Senior Contributor
Posts: 679
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: Show linked categories on catalog.php

Post by Omar_one »

tessthepup wrote: Sun Nov 12, 2023 2:12 pm
Omar_one wrote: Sun Nov 12, 2023 2:04 pm can you please post your code
@Omar_one
It is a cut and paste of your code

Code: Select all

<?php
class hook_admin_catalog_categories{
   function listen_infoBox($parameters) {
     global $product;
     if  (isset($product && ($product Instanceof Product)) $parameters['contents'][] = ['class' => 'style', 'text' => Categories::draw_breadcrumbs($product->get('categories'))];
  }
}

I was edit my post .. this should work

Code: Select all

class hook_admin_catalog_categories{
   public function listen_infoBox($parameters) {
     global $product;
	     if (isset($product) && ($product Instanceof Product)) $parameters['contents'][] = ['class' => 'style', 'text' => Categories::draw_breadcrumbs($product->get('categories'))];
}
}

User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 56 times
Been thanked: 62 times

Re: Show linked categories on catalog.php

Post by tessthepup »

Omar_one wrote: Sun Nov 12, 2023 2:18 pm
tessthepup wrote: Sun Nov 12, 2023 2:12 pm
Omar_one wrote: Sun Nov 12, 2023 2:04 pm can you please post your code
@Omar_one
It is a cut and paste of your code

Code: Select all

<?php
class hook_admin_catalog_categories{
   function listen_infoBox($parameters) {
     global $product;
     if  (isset($product && ($product Instanceof Product)) $parameters['contents'][] = ['class' => 'style', 'text' => Categories::draw_breadcrumbs($product->get('categories'))];
  }
}

I was edit my post .. this should work

Code: Select all

class hook_admin_catalog_categories{
   public function listen_infoBox($parameters) {
     global $product;
	     if (isset($product) && ($product Instanceof Product)) $parameters['contents'][] = ['class' => 'style', 'text' => Categories::draw_breadcrumbs($product->get('categories'))];
}
}

@Omar_one
Perfect :D

Thank you and @Kofod95 for this


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