Author Topic: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5  (Read 658716 times)

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1095 on: July 02, 2012, 11:49:24 am »
ps_product_custom_type.php
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

leorobles

  • Beginner
  • *
  • Posts: 14
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1096 on: July 02, 2012, 21:09:50 pm »
thanks, in this code?

....
      a = a.replace(/Á|Â|Ã|Ä|Å/g,'A')
      a = a.replace(/\u00E5|á|â|ã|ä|å|\a134/g,'a')
      a = a.replace(/\u0163|t/g,'t')
      a = a.replace(/ò|ó|ô|õ|ö|ø/g,'o')
      document.addtocart.".$field['attr_pagevar'].".value = a
      return true
      }

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1097 on: July 02, 2012, 21:48:21 pm »
yes
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

leorobles

  • Beginner
  • *
  • Posts: 14
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1098 on: July 03, 2012, 02:25:17 am »
It seems to me correct, the code has the "ã" but still making trouble.
Example: requeij�o correct would be "requijão" but when I use uppercase "Ã" works. Okay I will use capital letters.
Thanks.

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1099 on: July 03, 2012, 11:00:32 am »
you need to play with code (and character codes to use) until you will find a satisfactory result. It's a bit of woodoo...
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

leorobles

  • Beginner
  • *
  • Posts: 14
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1100 on: July 04, 2012, 07:48:01 am »
this is old code:

"<script type=\"text/javascript\">
      function fixtext()
      {
      if(document.addtocart.".$field['attr_pagevar'].".value)
         a = document.addtocart.".$field['attr_pagevar'].".value
      else
         return true
      a = a.replace(/Á|Â|Ã|Ä|Å/g,'A')
      a = a.replace(/\u00E5|á|â|ã|ä|å|\a134/g,'a')
      a = a.replace(/\u0163|t/g,'t')
      a = a.replace(/ò|ó|ô|õ|ö|ø/g,'o')
      document.addtocart.".$field['attr_pagevar'].".value = a
      return true
      }

      </script>";

this is new code (v 3.0O your hack)

"<script type=\"text/javascript\">
      function ".$field['attr_pagevar']."_fixtext(field,limit)
      {
      if(!field.value)
         return true
      field.value = field.value.replace(/\u00E5|a/g,'a')
      field.value = field.value.replace(/\u0163|t/g,'t')
      field.value = field.value.replace(/\u2014|-/g,'-')
      
      if(limit > 0) {
         if(field.value.length>limit) {
            alert ('You have exceeded the allowed limit of '+limit+' characters.Your imput will be truncated to the allowed limit.')
         }
         field.value = field.value.substring(0,limit)
      }
      return true
      }

      </script>";

I searched for a solution but it is complete. With all versions of "a" but do not know why it does not work, I end up using the uppercase letter "a".

Thanks for the help.


timkolm

  • Beginner
  • *
  • Posts: 40
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1101 on: July 05, 2012, 21:04:53 pm »
It seems that the problem is not within the hack, it's more global Virtuemart problem, of how it deals with the special letters. I tried Virtuemart without the hack, and as soon as a certain non-English letter occurs in the attributes, it behaves strangely.

leorobles

  • Beginner
  • *
  • Posts: 14
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1102 on: July 06, 2012, 19:25:12 pm »
Yes, but in normal attributes works only in custom attributes is that it does "á" but that's okay I'll use upper case

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1103 on: July 06, 2012, 19:47:43 pm »
The observation is correct: the problem comes from the core of VirtueMart. There are couple of accented characters misbehaving, you need to find them based on trial and error - at least I did not find ANY place where these misbehaving characters are listed. Note also, that there are variants: a given character, displayed as "å" for example can have behind several character codes, depending on your exact browsers used, language settings on your browser, operating systems and such.
There is no one size fits all solution there.
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

savvygroup

  • Beginner
  • *
  • Posts: 3
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1104 on: July 11, 2012, 18:19:33 pm »
Hello,

First off I'd like to thank you for the hack!

We are having an issue with the file upload, which our customers use to upload images for certain purchases. On the front-end, after you try to upload an image, and click "Add to Cart" the next page displays this error message: JFolder::create: Could not create directory

The site is http://bjjcoachmarketing.com and one of the products categories that need an image uploaded for purchases are Certificates.

If there is any other information we can provide you to help us reslove this issue, please let us know.

Thank you and regards,
-Brad

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1105 on: July 11, 2012, 18:24:44 pm »
Check if in the VirtueMart global configuration the tab for CAE hack is set correctly - including the phisycal path for file upload. You need to set up manually the directory - via FTP, for example - an make it writable  (CHMOD 644). The error message is clearly indicating, that is something wrong with this settings - VirtueMart tried to upload the file somewhere where has not enough rights to do it.
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

savvygroup

  • Beginner
  • *
  • Posts: 3
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1106 on: July 11, 2012, 18:43:41 pm »
Check if in the VirtueMart global configuration the tab for CAE hack is set correctly - including the phisycal path for file upload. You need to set up manually the directory - via FTP, for example - an make it writable  (CHMOD 644). The error message is clearly indicating, that is something wrong with this settings - VirtueMart tried to upload the file somewhere where has not enough rights to do it.

Thank you for such a fast reply,

I do have the CAE tab correctly configured and I created a directory under the web directory since our host does not give permissions to create any outside of the www. The directory created for the uploads has ( 0777 ) for permissions. Does it have to be 0644? or could our web directory be over riding our sub directory made for the uploads?

Thanks,
-Brad

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1107 on: July 11, 2012, 21:37:55 pm »
Hmm, might be... but I still suspect a configuration error. Maybe if you can grant access to the shop, I can find the problem.
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!

savvygroup

  • Beginner
  • *
  • Posts: 3
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1108 on: July 12, 2012, 01:35:14 am »
Hmm, might be... but I still suspect a configuration error. Maybe if you can grant access to the shop, I can find the problem.

Thank you for the offer, but I have since fixed the problem. I appreciate the help in the matter.

Thanks again,
-Brad

webgobe

  • Advanced
  • Full Member
  • *****
  • Posts: 535
  • Follow me on Twitter! http://twitter.com/webgobe
    • Internet craftsman carrying on the heritage of European manufacturing traditions through original Web designs.
Re: Converted Custom Attributes Extended Hack 2.1 for VM 1.1 + J1.5
« Reply #1109 on: July 12, 2012, 10:11:58 am »
Glad to hear that!
Have success with your project!
Like a fine wine... Good from the start and getting better over time.
Donations are welcome!