Jump to content
kazack

[Contribution]Product Image Verify

Recommended Posts

This thread is being started for support of the Product Image Verify contribution that I created for Osc 2.3.x.x.  I had a few e-mails about this as I thought it was straight forward and didn't think that it needed support, and also had some feature requests as well.  So now here it is, if you have problems, questions, feature requests or just want to talk about this contribution please feel free to post away. 

 

This contribution can be found at:  http://addons.oscommerce.com/info/8210

 

There is an update as I wrote this mode in 2011, didn't think it was that long ago, but walked through both a manual install and a drag n drop install on a new virgin install of OSC 2.3.4 and come to find out somehow when I packaged up the files I wasn't using the 2.3.x.x file, so the css and everything on the admin side got messed up and distorted.

 

A brief description of this contribution:

 

I run several OSC 2.2 sites (in the process of converting at the last minute to 2.3.x.x, seems like it will take forever as I have 100+ contributions installed) and most of the sites get a daily feed that is automatically imported into my different OSC sites.  Well most of us know that the feeds we sometimes get from providers do not contain all the proper information, and especially the images.  When you have a site with a few products no problem, but when you have hundreds to thousands of products it is almost impossible to go through each and every product to check if an image was downloaded or not.

 

What this contribution does for a virgin install is go through every product and selects the image if one is available and checks the file system to see if one actually exists.  If the database does not have an image associated with the product, or the image is not found in the file system then it will list the relevant information and tell you what the issue is with the image.  Now you can see at a glance if all your products have the expecting images in the database and in the file system.  If there are no issues with images then nothin will be displayed, as to why waste resources.

 

Being this is the first post I am also going to include a screenshot here for those of you that came across this thread but did not actually download the contribution package.

 

post-170843-0-98001600-1402211379_thumb.jpg

 

Thanks in advance for any posts about this contribution as all feedback is welcomed.

Shawn Mulligan

 

 

Share this post


Link to post
Share on other sites

It has come to my attention that not all users running php 5.x.x have access to the function: file_put_contents().  After doing some reading some hosting providers are blocking this function.  I uploaded an updated full package for 2.3.4 to reflect the fix for this.

 

The error message being seen is something similar to:  Fatal error: Call to undefined function: file_put_contents() in /home/domain/public_html/catalog/admin/image_verify.php on line 146

 

I corrected the issue by adding a new block of code the /catalog/admin/image_verify.php and this was the only file modified.  If you do not want to download the whole package again you can just add the following lines of code:

if(!function_exists('file_put_contents')) {
     function file_put_contents($filename, $data, $file_append = false) {
          $fp = fopen($filename, (!$file_append ? 'w+' : 'a+'));
	       if(!$fp) {
	           trigger_error('file_put_contents cannot write in file.', E_USER_ERROR);
                   return;
               }
          fputs($fp, $data);
          fclose($fp);
     }
}

Any questions or issues please feel free to ask.

 

Thanks,

Shawn Mulligan

Share this post


Link to post
Share on other sites

Hi kazack!

I installed this add-on on a osCommerce 2.3.4 install. I have tried the installation several times now and have the same results.

 

The first thing I notice was the icons were not showing on the admin page next to the products. This was fixed by changing the 

 

<?  on line 155 of image_verify.php to <?php

 

When I click on a product I never get the product name in the box on the right hand side with the edit and delete button as seen in the screenshot included with the Image Verifier package. Notice the Adoration product and the other 2 language versions that are highlighted.

post-333008-0-11024400-1418842261_thumb.png

 

I have tried both version of the  admin/image_verify.php script both with the same results.

 

What versions of PHP you have tried it with? My test server is running PHP 5.5.9

 

I am also wondering if you have tested it with multiple languages? We are running 3 languages. I notice that 3 items will get highlighted, one for each language, when I click on one product.

 

Any help you can give in getting this setup correctly would be appreciated!

 

Frederick

Share this post


Link to post
Share on other sites

I am trying to add the missing products_image filen ame to the image_verify.php page without having to click on then "edit" button to get the image I'm trying to add to the server.  I want to put the missing image name on the right sidebar, but I'm having problems figuring it out. Here is what I've done so for and maybe you can point me in the right direct.

                $contents[] = array('text' => '' . $verify['products_image']);
                $contents[] = array('text' => '' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '100%', 3));

I also don't have a problem adding the image name to the list of products in the center of the page.  You can do this by adding it to line 154:

                <td  class="dataTableContent"><?php echo $verify['products_image']; ?></td>

Thanks,

 

Scott

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

×