Fixed the model and control for the product page presentation.
Product page template file needs to be edited something like (example based on default schema):
More work is coming to deploy texts to category listings page, search results page and so on...
File deleted
Product page template file needs to be edited something like (example based on default schema):
Code: Select all
<?php if ($thumb || $images) { ?>
<div class="left">
<?php if ($thumb) { ?>
<div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="colorbox" rel="colorbox"><img src="<?php echo $thumb; ?>" title="<?php echo $image_title_text; ?>" alt="<?php echo $image_alt_text; ?>" id="image" /></a></div>
<?php } ?>
<?php if ($images) { ?>
<div class="image-additional">
<?php foreach ($images as $image) { ?>
<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="colorbox" rel="colorbox"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $image['image_title_text']; ?>" alt="<?php echo $image['image_alt_text']; ?>" /></a>
<?php } ?>
</div>
<?php } ?>
</div>
<?php } ?>
File deleted
Last edited by cosmo on Thu Feb 21, 2013 12:15 am, edited 1 time in total.
It doesn't really seem to work for me..
what do I put in the catalog/controller/product/product.php?
I had this:
And I also tried changing them to 'image_alt_text' and 'image_title_text', but it gives me the error undefined variable... either way.
what do I put in the catalog/controller/product/product.php?
I had this:
Code: Select all
foreach ($results as $result) {
$this->data['images'][] = array(
'popup' => $this->model_tool_image->resize($result['image'].........,
'thumb' => $this->model_tool_image->resize($result['image']........,
'alt_text' => $result['alt_text'],
'title_text' => $result['title_text']
);
}
That's because it needs to get the image text out of the image array..
Code: Select all
foreach ($results as $result) {
$this->data['images'][] = array(
'popup' => $this->model_tool_image->resize($result['image'].........,
'thumb' => $this->model_tool_image->resize($result['image']........,
'alt_text' => $result['image']['image_alt_text'],
'title_text' => $result['image']['image_title_text']
);
}
AWESOME! That worked! Thank you so much.
I do have one problem still (had this problem since I uploaded the 5 xml files).. all of my product links on the category pages don't work. When I look at the URL in the address bar it leaves the product id blank like this:
/index.php?route=product/product&path=59&product_id=
and then opens a page that says:
Again, thank you so much for taking the time to get back to me. I really appreciate your help!
I do have one problem still (had this problem since I uploaded the 5 xml files).. all of my product links on the category pages don't work. When I look at the URL in the address bar it leaves the product id blank like this:
/index.php?route=product/product&path=59&product_id=
and then opens a page that says:
Do you know what I can do about that??Product not found!
Again, thank you so much for taking the time to get back to me. I really appreciate your help!
Found the issue, ambigous column names in the image text table and the product table. Both are named 'product_id'.
I will write a migration script for the db-table and update the vqmod-xmls accordingly.
So, today I learned to always specifically prefix your custom database tables!
I will write a migration script for the db-table and update the vqmod-xmls accordingly.
So, today I learned to always specifically prefix your custom database tables!
Ok, new version.
If previous version installled:
1. Replace all old xmls.
2. Run the migrate_product_image_text.sql (simply renames the product_id column in the custom table).
Keep posting any issues.
If previous version installled:
1. Replace all old xmls.
2. Run the migrate_product_image_text.sql (simply renames the product_id column in the custom table).
Keep posting any issues.
Attachments
PERFECT!!! Everthing works now..
when I ran the migrate_product_image_text.sql is gave me the following:
THANK you so much.
when I ran the migrate_product_image_text.sql is gave me the following:
But everything seems to be alright.MySQL returned an empty result set (i.e. zero rows). (Query took 0.0072 sec)
THANK you so much.
Aaaaand another version where I've added custom alt and title text to all product presentations
If previously installed just replace the image_alt_and_title_text_catalog_controller.xml with the one in this package.
- category page
- search page
- manufaturer page
- compare page
- bestseller module
- featured module
- latest module
- special module
If previously installed just replace the image_alt_and_title_text_catalog_controller.xml with the one in this package.
Attachments
Wow, you have just saved me an age of work.
I have created a similar system so you can customise the product and category Page Titles.
My customer asked for this as apparently this is good for SEO...
If anyone is interested I can pull it together as a mod and contribute it.
Tim
I have created a similar system so you can customise the product and category Page Titles.
My customer asked for this as apparently this is good for SEO...

If anyone is interested I can pull it together as a mod and contribute it.
Tim
tim@pointreddesign.co.uk | http://www.pointreddesign.co.uk
Can you make it work with 1.5.5.1..... I tried to install but it dosen't work.....
i get this error #1054 - Unknown column 'product_id' in 'product_image_text' when i rum Migrate product image text and the store stops responding...... but then i later figured out that i need to rename Proudct_image_text to oc_product_image_text....
i get this error #1054 - Unknown column 'product_id' in 'product_image_text' when i rum Migrate product image text and the store stops responding...... but then i later figured out that i need to rename Proudct_image_text to oc_product_image_text....
This seems to work like a charm using a highly customized theme on OC version 1.5.5.1 so long as you follow the directions and make sure to make the necessary changes to the Product Template and Product Controller File, as well as the database, including the prefix.
One thing we had to make sure of was that the Alt Tags correspond with the correct pictures in your store, as they may display on the wrong images depending on which you consider the main and which is the additional image. Our theme has a hover effect that changes the popup image, so we have to make sure that the popup image is always considered the main image in the product template file and adjust the alt to reflect that.
While I must commend @Cosmos and all the others on their effort, I have one silly question. If you check out this page of our Developmental Site http://dev.newtress.com/index.php?route ... duct_id=42 site, you will realize that the products all have closing brackets after them. This doesn't appear on other products on the site that do not have Alt Text. Why does this appear now?
Best,
NewTress
One thing we had to make sure of was that the Alt Tags correspond with the correct pictures in your store, as they may display on the wrong images depending on which you consider the main and which is the additional image. Our theme has a hover effect that changes the popup image, so we have to make sure that the popup image is always considered the main image in the product template file and adjust the alt to reflect that.
While I must commend @Cosmos and all the others on their effort, I have one silly question. If you check out this page of our Developmental Site http://dev.newtress.com/index.php?route ... duct_id=42 site, you will realize that the products all have closing brackets after them. This doesn't appear on other products on the site that do not have Alt Text. Why does this appear now?
Best,
NewTress
Hey Cosmos,
Turns out it was a spacing issue. When I copied the code the closing tag for the image was too close to the closing tags for the image_alt_text output, so by adding that extra space it fixed everything. Otherwise, great plugin and we will be implementing it on our main hair extensions site http://www.newtress.com today.
Amazing work to this point Cosmos. Why not just bundle the package into an extension on the OpenCart Extensions or do you prefer the intimacy and close knit nature of the forum?
Turns out it was a spacing issue. When I copied the code the closing tag for the image was too close to the closing tags for the image_alt_text output, so by adding that extra space it fixed everything. Otherwise, great plugin and we will be implementing it on our main hair extensions site http://www.newtress.com today.
Amazing work to this point Cosmos. Why not just bundle the package into an extension on the OpenCart Extensions or do you prefer the intimacy and close knit nature of the forum?
Who is online
Users browsing this forum: No registered users and 17 guests