0

I’m implementing a PERL upload on the product page of Magento, with a progressbar, in AJAX with instant upload on the product page. This upload replaces the standard “file” custom option.

My upload is fine, but I’m facing a problem with the required attribute of the option.

The upload is done directly on the product page, and when it starts, the value of the input file seems to be empty. I’ve managed to disable the client-side validation when the file is uploaded, but I can’t find where to edit the server-side verification of the custom-options form in the product page.

I’m storing upload data in the session and my aim is to check if the current required custom option is already linked to a file uploaded via PERL upload. If yes, get rid of the validation of this file option.

  • I think you can set product attributes as requires or not-required through admin side.. This probably solve your issue. select the attribute of which you want to remove 'required'through catalog -> manage attributes and make it as not required. – Rajeev K Tomy Mar 19 '14 at 2:02
  • Sorry I was talking about the required custom options. Sorry. – guillaume_shm Mar 19 '14 at 8:21
  • @programmer_rkt too :-) You can set custom options to be required or not. – Fabian Blechschmidt Mar 19 '14 at 12:43
  • @FabianBlechschmidt : ya thats right :) – Rajeev K Tomy Mar 19 '14 at 14:30
0

No I was not searching for the "not required" option.

My aim was to make a required option but, with some defined condition, allow some custom option to be empty at cart validation.

I made it by rewriting Mage_Catalog_Model_Product_Option_Type_File and function _validateUploadedFile in my case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.