Jump to content
Sign in to follow this  
ArtcoInc

Phoenix, display category image on category page

Recommended Posts

Unless I'm missing something, which is quite possible ...

There is no provision to display the Category Image on a Categories page. I did a quick hack to add code to display the image in the /includes/modules/content/index_nested/templates/tpl_cm_in_title.php file, although in retrospect I should (and probably will) make a new module just to display the image.

M


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites
50 minutes ago, ArtcoInc said:

Unless I'm missing something, which is quite possible ...

There is no provision to display the Category Image on a Categories page. I did a quick hack to add code to display the image in the /includes/modules/content/index_nested/templates/tpl_cm_in_title.php file, although in retrospect I should (and probably will) make a new module just to display the image.

M

So far as I recall, this functionality has never been available in osCommerce...

As you say...as we're now modular...it needs a module.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites
1 hour ago, burt said:

There is no provision to display the Category Image on a Categories page.

In RC2a this was standard. I make use of this feature as well on my current frozen site.

Share this post


Link to post
Share on other sites
On 8/13/2019 at 7:43 PM, René H4 said:

In RC2a this was standard. I make use of this feature as well on my current frozen site.

It's a long time since I saw a RC2A, but I am 99.9 certain that the functionality never existed in the 2.3 series.

It only takes a module!  Maybe someone can make it for Core?


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites

@burt

I seem to remember it being in the Community Edition from v2.3.3.4 all the way through Frozen.

Anyway, I backed out my hack, and wrote up two content modules (one for index_nested and one for index_products).

M


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites
On 8/13/2019 at 5:00 PM, ArtcoInc said:

There is no provision to display the Category Image on a Categories page.

It is already in the title function, you just need to add $cm_image to the template file to display both cat images and manufacturing images. layout is upto you and your page design. This was done just with a simple image output.

<?php echo tep_image('images/' . $cm_image, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'itemprop="image"'); ?>

 

image.thumb.png.c8bc8e0ba18194ceb993f4792f383cdd.png

 function execute() {
      global $oscTemplate, $current_category_id, $OSCOM_category;
      
      $content_width = MODULE_CONTENT_IP_TITLE_CONTENT_WIDTH;
     
      if (isset($_GET['manufacturers_id']) && !empty($_GET['manufacturers_id'])) {
        $manufacturer_query = tep_db_query("select manufacturers_image, manufacturers_name from manufacturers where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'");
        $manufacturer = tep_db_fetch_array($manufacturer_query);

        $cm_name  = $manufacturer['manufacturers_name'];
        $cm_image = $manufacturer['manufacturers_image'];
      } else {
        $cm_name  = $OSCOM_category->getData($current_category_id, 'name');
        $cm_image = $OSCOM_category->getData($current_category_id, 'image');

 


 

Share this post


Link to post
Share on other sites

Now you mention it I do (vaguely) recall writing a post explaining how to (fairly) easily add a category image to the Title Module, which was then taken further in the codebase ready for people to start using...

https://github.com/gburton/CE-Phoenix/blob/master/includes/modules/content/index_nested/cm_in_title.php#L41

I don't remember a core-code separate category image Module though...I could very well be mistaken on that though.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×