aRJayCee Posted June 6, 2014 Share Posted June 6, 2014 Hello, Can anyone help me how to get the category source image? I have this in my content.category.php <h2>{$category.cat_name}</h2> {if isset($category.image)} <div id="category_image"> <a href="{$category.image}" target="_blank"> <img src="{$category.image}" alt="{$category.cat_name}" id="preview" /> </a> </div> {/if} ... but this opens the image from the cache. I want to be able to display the source image. Please help. Thanks Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 6, 2014 Share Posted June 6, 2014 Welcome aRJayCee! Glad to see you made it to the forums. There are some places in the CubeCart code where you get an array of images that your skin can choose from, and some places in the code where you get no choices. The category image is not one where you have a choice - currently. So, we need to modify some code. In the file /classes/catalogue.class.php, near line 129 (for CC5211), edit: Was: $vars['category']['image'] = $this->imagePath($catData['cat_image'], 'category','url'); Now: $vars['category']['image'] = $this->imagePath($catData['cat_image'], 'source','url'); There will be a different solution if what you want is to display the appropriately sized image from the cache to fit the layout of your skin, then show the source image in a new window when clicked on the link you added. To do that, make this edit:Was: $vars['category']['image'] = $this->imagePath($catData['cat_image'], 'category','url'); Now: $vars['category']['image']['cat'] = $this->imagePath($catData['cat_image'], 'category','url'); $vars['category']['image']['source'] = $this->imagePath($catData['cat_image'], 'source','url'); Then, in your skin template:Was: <div id="category_image"><img src="{$category.image}" alt="{$category.cat_name}" /></div> Now: <a href="{$category.image.source}" target="_blank"><img src="{$category.image.cat}" alt="{$category.cat_name}" id="preview" /></a> Quote Link to comment Share on other sites More sharing options...
aRJayCee Posted June 6, 2014 Author Share Posted June 6, 2014 Thank you so much! It works perfect! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.