Jump to content
Parikesit

[Contribution] OPI: OsC Product Image Module

Recommended Posts

ok i have done it now.

 

Do i have to edit all the files in the edit diretctory????

 

Did you mean all files in "oscommerce-2.3.1-edited" folder?

 

Well, if you just installed oscommerce and never edit the theme/layout or add other addons, you safe to replace your oscommerce installation with those files inside "oscommerce-2.3.1-edited" folder.

 

But if you have change your layout/theme or add any addons that related to those file inside "oscommerce-2.3.1-edited" folder, you should compare those files with yours and edit your files manually.

 

Best,

@zaenal

Edited by Parikesit

Share this post


Link to post
Share on other sites

"Image Preview" only available for browser that support window.createObjectURL or window.webkitURL. Newest version of Chrome, Firefox and Safari support this javascript method. Unfortunately, none of IE version support this.

 

Here the list of browsers that are supported "local image preview":

  • Chrome (versione 8 or higher)
  • Firefox (version 4 or higher)
  • Safari/WebKit (nightly build version)

You can find the info about it here: https://developer.mo...createObjectURL. And complete tutorial on a new way to handling upload field (files) is here: https://developer.mo...eb_applications (pure ajax upload)

 

Regarding OPI addon, I decided to use iframe instead of pure ajax upload because IE and some old browser will suffer. So, for users that use IE or lower version... don't worry, you still able to upload image except you can not preview your image before uploading.

 

 

Cheers,

@zaenal

Edited by Parikesit

Share this post


Link to post
Share on other sites

Bug Fix: wrong CHMOD when creating folder on Linux.

 

So, now added new constant to opi_thumbnail.php:

 

define('OPI_FS_CHMOD', 0755); 
// some server required 0775 or 0777

 

IMPORTANT:

If you previously installed OPI, delete all files & folders inside "images/_thumbnail_". If you can not do this by FTP, try to login to your CPanel or login as root. Or, simply rename "_thumbnail_" to other name, and create a new one.

 

 

Instruction:

--------------

- Delete all files/folders inside "images/_thumbnail_".

- Download full package from previous release (OPI version 1.1).

- Download last opi_thumbnail.php (chmod error on linux)

 

http://addons.oscommerce.com/info/8139

 

Cheers,

Share this post


Link to post
Share on other sites

Hi

Now watermarked is OK

All is OK in admin and on customer side with

IE9

Opera11.5

Safari5.1

Firefox6.01

Chrome7.0.517.41

 

Congratulations and big thanks for this very good addon.

 

Francois

Share this post


Link to post
Share on other sites

Hi

Now watermarked is OK

All is OK in admin and on customer side with

IE9

Opera11.5

Safari5.1

Firefox6.01

Chrome7.0.517.41

 

Congratulations and big thanks for this very good addon.

 

Francois

 

 

Bonjur,

 

Glad to hear that, and thanks for the report.

 

Á la votre!

@zaenal

Share this post


Link to post
Share on other sites

Hi,

 

Everything seems to be working correctly. But I do not see the "Thumbnail: Configuration" settings in the database or admin>Configuration?

 

How can I add this manually or set the auto install to add it again?

The "OPI Configuration" settings have been added successfully into Configuration.

 

Great Contribution! :)

Edited by drhigham

Share this post


Link to post
Share on other sites

Hi,

 

Everything seems to be working correctly. But I do not see the "Thumbnail: Configuration" settings in the database or admin>Configuration?

 

How can I add this manually or set the auto install to add it again?

The "OPI Configuration" settings have been added successfully into Configuration.

 

Great Contribution! smile.png

 

Hi,

 

Thumbnail configuration could be set manually in opi_thumbnail.php file.

 

FYI, opi_thumbnail.php was a "stand alone" file. I decided to not include includes/application_top.php to avoid loading unnecessarily files and database queries when serving image-thumbnail, thus make it faster. As the backward, we should manually configure the setting of thumbnail, watermark, etc in this file.

 

Thanks,

@zaenal

Share this post


Link to post
Share on other sites

HI

There is some errors in the language file for FRENCH.

I put a good file.

 

Thanks,

 

<?php
/*
 $Id: attributeManager.php,v 1.0 21/02/06 Sam West$
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Released under the GNU General Public License

 French translation for AJAX Attribute Manager V2.7.1
 Fichier traduit par Zardhoz le 04/03/08
 http://www.oscommerce-fr.info/forum/
*/
//attributeManagerPrompts.inc.php
define('AM_AJAX_YES', 'Oui');
define('AM_AJAX_NO', 'Non');
define('AM_AJAX_UPDATE', 'Mettre à jour');
define('AM_AJAX_CANCEL', 'Annuler');
define('AM_AJAX_OK', 'OK');
define('AM_AJAX_SORT', 'Tri:');
define('AM_AJAX_TRACK_STOCK', 'Suivre le Stock?');
define('AM_AJAX_TRACK_STOCK_IMGALT', 'Suivre le Stock de cet attribut?');
define('AM_AJAX_ENTER_NEW_OPTION_NAME', 'Entrez le nom de la nouvelle option');
define('AM_AJAX_ENTER_NEW_OPTION_VALUE_NAME', 'Entrez le nom de la nouvelle valeur d\'option');
define('AM_AJAX_ENTER_NEW_OPTION_VALUE_NAME_TO_ADD_TO', 'Entrez le nom de la nouvelle valeur d\'option à ajouter à %s');
define('AM_AJAX_PROMPT_REMOVE_OPTION_AND_ALL_VALUES', 'Voulez vous vraiment supprimer l\'option %s ainsi que toutes les valeurs d\'options liées à ce produit?');
define('AM_AJAX_PROMPT_REMOVE_OPTION', 'Voulez vous vraiment supprimer la valeur d\'option %s de ce produit?');
define('AM_AJAX_PROMPT_STOCK_COMBINATION', 'Voulez vous vraiment supprimer cette combinaison de stock de ce produit?');
define('AM_AJAX_PROMPT_LOAD_TEMPLATE', 'Voulez vous vraiment charger le Modèle %s? <br>Ceci écrasera les options courantes de ce produit et ne peut être annulé.');
define('AM_AJAX_NEW_TEMPLATE_NAME_HEADER', 'Entrez le nom du nouveau Modèle ou');
define('AM_AJAX_NEW_NAME', 'Nouveau Nom:');
define('AM_AJAX_CHOOSE_EXISTING_TEMPLATE_TO_OVERWRITE', '<br>choisissez un Modèle existant à remplacer');
define('AM_AJAX_CHOOSE_EXISTING_TEMPLATE_TITLE', 'Modèles existants:');
define('AM_AJAX_RENAME_TEMPLATE_ENTER_NEW_NAME', 'Entrez le nouveau nom du Modèle %s');
define('AM_AJAX_PROMPT_DELETE_TEMPLATE', 'Voulez vous vraiment supprimer le Modèle %s?<br>Ceci ne peut être annulé!');
//attributeManager.php
define('AM_AJAX_ADDS_ATTRIBUTE_TO_OPTION', 'Ajouter la valeur d\'option sélectionnée à l\'option %s');
define('AM_AJAX_ADDS_NEW_VALUE_TO_OPTION', 'Ajouter une nouvelle valeur d\'option à l\'option %s');
define('AM_AJAX_PRODUCT_REMOVES_OPTION_AND_ITS_VALUES', 'Supprimer l\'option %1$s et les %2$d valeurs d\'options liées à ce produit');
define('AM_AJAX_CHANGES', 'Changements');
define('AM_AJAX_LOADS_SELECTED_TEMPLATE', 'Charger le Modèle sélectionné');
define('AM_AJAX_SAVES_ATTRIBUTES_AS_A_NEW_TEMPLATE', 'Sauvegarder les attributs courants dans un nouveau Modèle');
define('AM_AJAX_RENAMES_THE_SELECTED_TEMPLATE', 'Renommer le Modèle sélectionné');
define('AM_AJAX_DELETES_THE_SELECTED_TEMPLATE', 'Supprimer le Modèle sélectionné');
define('AM_AJAX_NAME', 'Nom');
define('AM_AJAX_ACTION', 'Action');
define('AM_AJAX_PRODUCT_REMOVES_VALUE_FROM_OPTION', 'Supprimer la valeur d\'option %1$s de l\'option %2$s de ce produit');
define('AM_AJAX_MOVES_VALUE_UP', 'Augmenter la valeur d\'option');
define('AM_AJAX_MOVES_VALUE_DOWN', 'Diminuer la valeur d\'option');
define('AM_AJAX_ADDS_NEW_OPTION', 'Ajouter une nouvelle option à la liste');
define('AM_AJAX_OPTION', 'Option:');
define('AM_AJAX_VALUE', 'Valeur:');
define('AM_AJAX_PREFIX', 'Préfixe:');
define('AM_AJAX_PRICE', 'Prix:');
define('AM_AJAX_SORT', 'Tri:');
define('AM_AJAX_ADDS_NEW_OPTION_VALUE', 'Ajouter une nouvelle valeur d\'option à la liste');
define('AM_AJAX_ADDS_ATTRIBUTE_TO_PRODUCT', 'Ajouter cet attribut au produit courant');
define('AM_AJAX_QUANTITY', 'Quantité');
define('AM_AJAX_PRODUCT_REMOVE_ATTRIBUTE_COMBINATION_AND_STOCK', 'Supprimer cette combinaison d\'attribut et stock de ce produit');
define('AM_AJAX_UPDATE_OR_INSERT_ATTRIBUTE_COMBINATIONBY_QUANTITY', 'Mettre à jour ou insérer une combinaison d\'attribut avec une quantité donnée');
//attributeManager.class.php
define('AM_AJAX_TEMPLATES', '-- Liste Modèles --');
//----------------------------
// Change: download attributes for AM
//
// author: mytool
//-----------------------------
define('AM_AJAX_FILENAME', 'Fichier');
define('AM_AJAX_FILE_DAYS', 'Jours');
define('AM_AJAX_FILE_COUNT', 'Max. téléchargement');
define('AM_AJAX_DOWLNOAD_EDIT', 'Editez les options de téléchargement');
define('AM_AJAX_DOWLNOAD_ADD_NEW', 'Ajoutez des options de téléchargement');
define('AM_AJAX_DOWLNOAD_DELETE', 'Effacez les options de téléchargement');
define('AM_AJAX_HEADER_DOWLNOAD_ADD_NEW', 'Ajoutez des options de téléchargement pour \"%s\"');
define('AM_AJAX_HEADER_DOWLNOAD_EDIT', 'Editez les options de téléchargement pour \"%s\"');
define('AM_AJAX_HEADER_DOWLNOAD_DELETE', 'Effacez les options de téléchargement pour \"%s\"');
define('AM_AJAX_FIRST_SAVE', 'Sauvegardez le produit avant d\'ajouter des options');
//----------------------------
// EOF Change: download attributes for AM
//-----------------------------
define('AM_AJAX_OPTION_NEW_PANEL','Nouvelle option:');
?>

Share this post


Link to post
Share on other sites

HI

There is some errors in the language file for FRENCH.

I put a good file.

 

Thanks,

 

<?php
/*
 $Id: attributeManager.php,v 1.0 21/02/06 Sam West$
 ...
?>

 

 

It's seem you post in the wrong thread. This is OPI addon not Ajax Attribute Options addon.

Share this post


Link to post
Share on other sites

It's seem you post in the wrong thread. This is OPI addon not Ajax Attribute Options addon.

 

Yes but i can't delete it. Sorry.

Share this post


Link to post
Share on other sites
Hi, Thumbnail configuration could be set manually in opi_thumbnail.php file. FYI, opi_thumbnail.php was a "stand alone" file. I decided to not include includes/application_top.php to avoid loading unnecessarily files and database queries when serving image-thumbnail, thus make it faster. As the backward, we should manually configure the setting of thumbnail, watermark, etc in this file. Thanks, @zaenal

 

Great. Makes sense. Thank you for your work and quick reply.

Share this post


Link to post
Share on other sites

Hi Parikesit,

Thank you very much for the OPI contribution, I have working quite well on my test apache server. I am however finding that it crashes chrome after doing a couple of image uploads. I'll try to post a bit more later as of when I narrow down exactly what is happening with this.

 

However I just found out that the server I'm being requested to install this contribution on is ISS7 crying.gif , which surprise surprise doesn't like mod_rewrite. I have tried to follow your instructions on working with the opi_thumbnail.php file, however I've had no luck in getting it to work. Would you mind posting your suggestion as to how i might configure this file to give me a workaround.

 

Many thanks.

 

Philip

Share this post


Link to post
Share on other sites

Thank you very much for the OPI contribution, I have working quite well on my test apache server. I am however finding that it crashes chrome after doing a couple of image uploads. I'll try to post a bit more later as of when I narrow down exactly what is happening with this.

 

Hi Philip,

 

I also experienced some crash on Chrome and try to find information about it, but no luck. This crash never happen when "image preview" for upload has been disabled. So, I guess it's related to "the new" javascript method: window.createObjectURL.

 

Then I update my Chrome and now that's rarely happen. Currently I'm using Chrome 13.0 build Beta (beta version is non standard for tester).

 

However I just found out that the server I'm being requested to install this contribution on is ISS7 , which surprise surprise doesn't like mod_rewrite. I have tried to follow your instructions on working with the opi_thumbnail.php file, however I've had no luck in getting it to work. Would you mind posting your suggestion as to how i might configure this file to give me a workaround.

 

Ahhh, that's my homework to create a specific Javascript Class (ext/jquery/plugins/jquery.oscProductImage.js) and readme (intallation instruction) for IIS. Hope I'll finish it this weekend.

 

 

Best,

@zaenal

Share this post


Link to post
Share on other sites

Hi,

 

I tried to do install manually because I have some other modules already installed on categories.php file. I have updated all files that needs to be.

 

When I do edit or create any product & click on upload image popup comes but it always showing progress loader bar nothing else. I am testing in Firefox Browser (6.0.2).

I read your earlier posts in this thread & I cross checked about the rewrite mod in ini file it also working fine.

 

At the very first when I try to edit the product , that product image is being copied to _thumbnail_/adminpreview & adminthumb. & I tries to delete that image its shows image is deleted, but after saving it. Still image is in that folder.

& When I came back to edit the product its does not showing images but it shows the box of the image. In which path is :

http://localhost/autotech//images/thumbs/def/adminthumb/TIK-AUC-23[1].jpg

 

So I think I missed some configuration kindly help me out.

 

One more point I want ask is why its copied only image of one product not all product in _thumbnail_.

 

Thanks & regards,

ROopak Jha

Share this post


Link to post
Share on other sites

At the very first when I try to edit the product , that product image is being copied to _thumbnail_/adminpreview & adminthumb. & I tries to delete that image its shows image is deleted, but after saving it. Still image is in that folder.

& When I came back to edit the product its does not showing images but it shows the box of the image. In which path is : localhost/autotech//images/thumbs/def/adminthumb/TIK-AUC-23

 

If I don't mistaken, the image did not show because there is trailling slash before image: "/autotech//images/thumbs/". Maybe that's the problem.

  • Can you try to access below image directly on your browser?
     
     
    localhost/autotech/images/thumbs/def/adminthumb/TIK-AUC-23[1].jpg
  • If you can access that url, try to "view source" and find:
     
     
    var oscProductImageHelper = {
     ...
     ajaxURL: ???,
     imageURL: ???,
     ...
    }
    


    What the value of imageURL? Is that "http: / / localhost/autotech//images/"?

 

One more point I want ask is why its copied only image of one product not all product in _thumbnail_.

 

_thumbnail_ is cache folder. Only images that previously loaded will exist in that folder.

 

 

Best,

Edited by Parikesit

Share this post


Link to post
Share on other sites

Hi Thanks for response,

 

 

If I don't mistaken, the image did not show because there is trailling slash before image: "/autotech//images/thumbs/". Maybe that's the problem.

  • Can you try to access below image directly on your browser?
     
     
     
    localhost/autotech/images/thumbs/def/adminthumb/TIK-AUC-23[1].jpg
  • If you can access that url, try to "view source" and find:
     
     
     
    var oscProductImageHelper = {
     ...
     ajaxURL: ???,
     imageURL: ???,
     ...
    }
    


    What the value of imageURL? Is that "http: / / localhost/autotech//images/"?

NO that trailing slash is not an issue, I tried removing that extra slash. Value of image url (in admin while editing the product) is the same that I provide you in my earlier post.

 

 

_thumbnail_ is cache folder. Only images that previously loaded will exist in that folder.

 

So What to do so that all images should come through _thumbnail_. Currently My system have 100 products which consist of one images each. And all that Images resides in localhost/autotech/images/.

 

Please help me out.

Share this post


Link to post
Share on other sites

Sorry, it was my mistake.

 

Images are showing. Only issue remains is while I click on upload image or browse server. Its showing popup with loading image, nothing after that.

Share this post


Link to post
Share on other sites

One more thing I noticed is, Now deleting on images delete from database, but that image resides in the "adminpreview" & "adminthumb" folders. You should add the code of deleting images also. M I right ?

Share this post


Link to post
Share on other sites

If you can access that url, try to "view source" and find:


  • What the value of imageURL? Is that "http: / / localhost/autotech//images/"?

imageURL: {path:'http://localhost/autotech/images/', relative:'', medium:'http://localhost/autotech/images/thumbs/def/adminpreview/', small:'http://localhost/autotech/images/thumbs/def/adminthumb/', transparent:'images/pixel_trans.gif'},

Share this post


Link to post
Share on other sites

Hi Parikesit,

 

Still waiting for your response :

Only issue remains is while I click on upload image or browse server. Its showing popup with loading image, nothing after that.

 

Now no extra "/" is there but then also its showing that loading image.

Share this post


Link to post
Share on other sites

Hi Parikesit,

 

Still waiting for your response :

Only issue remains is while I click on upload image or browse server. Its showing popup with loading image, nothing after that.

 

Now no extra "/" is there but then also its showing that loading image.

 

Hi,

 

Is there any javascript error message when loading "edit/new product" page?

 

If you use Firefox, try to add this addon https://addons.mozilla.org/en-US/firefox/addon/web-developer/ to verify javascript error.

 

Best,

Share this post


Link to post
Share on other sites

One more thing I noticed is, Now deleting on images delete from database, but that image resides in the "adminpreview" & "adminthumb" folders. You should add the code of deleting images also. M I right ?

 

Yes, you right. I'll add that to next release.

 

Thank you,

@zaenal

Share this post


Link to post
Share on other sites

Hello

I think you use IE in compatibility mode.

Try with firefox, if it is good, desable compatibility mode in IE.

Francois

Share this post


Link to post
Share on other sites

Hello

I installed OPI with no problems. But it doesn't work for me as it should. First of all my .htpasswd was off. When editing product I saw ajax circle icons. Next browse images ... OPI founds images but it couldn't show it ... rows of ajax icons loading ... .htpasswd is on now. OPI can't find any images. In both cases uploading image looks like endless uploading ...

.htaccess file is prepared according to manual.

Any help will be very useful.

Regards

Bartosz

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

×