Author Topic: Custom Attributes Extended [Hack]  (Read 178753 times)

bjraines

  • Jr. Member
  • **
  • Posts: 54
    • Net Entropy
Re: Custom Attributes Extended [Easy Hack]
« Reply #15 on: August 15, 2006, 08:07:21 am »
I dont feel very comfortable changing the code but I can't wait to see this in the real version. VM is so easy compared to other carts! great job

barnett

  • Jr. Member
  • **
  • Posts: 92
    • Contemplate Design
Re: Custom Attributes Extended [Easy Hack]
« Reply #16 on: August 15, 2006, 14:47:38 pm »
Hey everyone thanks for the feedback, it's very helpful.

Considering the great improvements you all have posted and my own thoughts on improvements to this hack I'm going to work on posting a Custom Attributes Extended 2.0 [Hack].  Hopefully I'll be able to get it up in a week or two.

I want to keep the hack fairly simple still, but add the following features that have been suggested:

Planned Improvements List:

  • allow custom fields to be optional -DONE
  • allow for descriptions to be added to each field using the Overlib in Joomla
  • allow for vertical or horizontal radio and checkboxes
  • editable list of allowed file types for file upload
  • add images into the attributes
  • easier addition of custom fields in the administrator end (no more one long line of code)
  • allow file upload to work alone without other custom attributes defined

This is what I hope to accomplish but all of it may not be doable.  Please give me feedback on more things you'd like to see in this list.  Thanks.
-barnett

beldendavid

  • Beginner
  • *
  • Posts: 30
Re: Custom Attributes Extended [Easy Hack]
« Reply #17 on: August 17, 2006, 18:05:43 pm »
barnett,

I think this all sounds great! At the moment I'm building two versions of my store, one in VM, and the other using ECJoomCommerce (a fork of osCommerce). Only one will remain standing in the end. The main reason I'd stick with VM is your hack, since that's the area for me where VM falls short. Even so, osCommerce's handling of attributes is really kludgy, I think, so keep up the great work... I definitely look forward to seeing the continued improvements!

Oh, one thing I like in osCommerce is that you can assign a downloadable file to more than one attribute in a product listing, so you could conceivably have, say, 5 download files for a single product. Maybe you can do that already with your hack, I haven't really tried that.

Dave

baisan

  • Beginner
  • *
  • Posts: 11
Re: Custom Attributes Extended [Easy Hack]
« Reply #18 on: August 28, 2006, 11:16:10 am »
is there other way for upload attributes to be standalone? and a link from the admin to see the uploaded custom file
of the customer? based from their orders?

spignataro

  • Beginner
  • *
  • Posts: 33
Re: Custom Attributes Extended [Easy Hack]
« Reply #19 on: August 30, 2006, 21:08:38 pm »
http://virtuemart.net/index.php?do=details&task_id=926&option=com_flyspray&Itemid=91

I have made a request here with some ideas that are not yet within your ulitmate package. Please referance the above ticket I have created.

barnett

  • Jr. Member
  • **
  • Posts: 92
    • Contemplate Design
Re: Custom Attributes Extended [Easy Hack]
« Reply #20 on: August 31, 2006, 00:44:03 am »
http://virtuemart.net/index.php?do=details&task_id=926&option=com_flyspray&Itemid=91

I have made a request here with some ideas that are not yet within your ulitmate package. Please referance the above ticket I have created.

Your request is what I was already thinking.  To use javascript to make a +(add) button to add as many attributes as a person wants.  Haven't had time to work on this in the last week but will work on it soon.

-barnett

patvb2003

  • Beginner
  • *
  • Posts: 5
Re: Custom Attributes Extended [Easy Hack]
« Reply #21 on: September 06, 2006, 23:33:04 pm »
I’ve been trying to install your hack of the Custom Attriubutes for Virtuemart, and I’m stuck.  There is a piece of code for the File Upload which fails.  I can’t insert it in the code because I get a Forbidden screen within Joomla when I try to add it there.  And I’ve tried to change permissions on the files, and it still isn’t working.  I’ve isolated it to the following code:


Code: [Select]
// create directory if doesn't exist
if(!is_dir( $uploaddir ) && !is_file( $uploaddir )) {
require_once( 'administrator/includes/admin.php' );
mosMakePath( $uploaddir );
$fp = fopen( $uploaddir . "/index.html", "w" );
fwrite( $fp, "<html>\n<body bgcolor=\"#FFFFFF\">\n</body>\n</html>" );
fclose( $fp );
mosChmod( $uploaddir."/index.html" );
$refresh_dirs = true;
}

if( !file_exists( $uploaddir ) ) {
$vmLogger->err( $VM_LANG->_PHPSHOP_FILES_PATH_ERROR );
return false;
}

if( substr( $uploaddir, strlen($uploaddir)-1, 1) != '/') {
$uploaddir .= '/';
}

    $noMatch = 0;

foreach( $allowable as $ext ) {
if ( strcasecmp( $format, $ext ) == 0 ) {
$noMatch = 1;
}
}

    if(!$noMatch){
$vmLogger->err( "File Type is not Supported" );
return false;
    }


Without this code the file upload doesn’t work.  Says the move_uploaded_file failed to open in ps_product_attribute.php.

When I try to add this piece of code in the ps_product_attribute.php file, Joomla fails and I get the following error screen:

FORBIDDEN

You don’t have permission to access /main/administrator/index2.php on this server.


 

I really want to get this file upload working.  Your hack is EXACTLY what I’ve needed, but I’m stuck.  I am willing to pay you to help me with this, please please!  Perhaps it is a simple permissions error, but I’ve done a CHMOD to 777 on the files I could that seem to be involved to 777 and it still gives me this error.  Is there a way to specify or hard code the upload directory?

Thanks in advance for your help and your huge contribution to Virtuemart.

Pat Vanden Bosche
Executive Director
Perry County Chamber of Commerce
113 Factory St., Suite 1
P.O. Box 177
Linden, TN 37096
www.perrycountytennessee.com

(931) 589-2453 office
(901) 826-7118 cell

 

barnett

  • Jr. Member
  • **
  • Posts: 92
    • Contemplate Design
Re: Custom Attributes Extended [Easy Hack]
« Reply #22 on: September 07, 2006, 00:00:25 am »
Without this code the file upload doesn’t work.  Says the move_uploaded_file failed to open in ps_product_attribute.php.

When I try to add this piece of code in the ps_product_attribute.php file, Joomla fails and I get the following error screen:

FORBIDDEN

You don’t have permission to access /main/administrator/index2.php on this server.



@patvb2003

    Not sure if you're saying "when you add the code Joomla fails" OR "when you add the code and then try to upload a file in the frontend Joomla fails."

    Sounds like a permission error either way.

   First off can you list what version of Joomla and Virtuemart you're using.

    What are you writting in the custom attributes field on the product administration screen?

     For the file upload it should be something like this:  Artwork File(file)(images\new);

     And then to be safe make sure the directory exists and is set to 777, in this case the directory the files are uploaded to would be "images/new"

    Also I noticed that the error said "main" in the file path.  Is your joomla instal in a subdirectory?

a little more information always helps.
-barnett

patvb2003

  • Beginner
  • *
  • Posts: 5
Re: Custom Attributes Extended [Easy Hack]
« Reply #23 on: September 07, 2006, 00:37:59 am »
I feel like such a dunce.  I did not have the subdirectory specified in the attributes screen.  Once I added that, and made sure the subdirectory existed with 777 permissions, I no longer get the error on the VirtueMart screen on the website:
> move_uploaded_file failed to open in ps_product_attribute.php

However, I do not see the file in the subdirectory I created either.  I am sure this is because I can't get the code into the file!  When I am editing the ps_product_attribute.php file in JoomalXplorer, and add this section of the code, my Joomla screen goes to the Forbidden notice.  I am kicked out of Joomla's admin.  Any other changes I've made to this file have been saved and no problems.  It's just the piece of code where the file is uploaded:

Code: [Select]
// create directory if doesn't exist
if(!is_dir( $uploaddir ) && !is_file( $uploaddir )) {
require_once( 'administrator/includes/admin.php' );
mosMakePath( $uploaddir );
$fp = fopen( $uploaddir . "/index.html", "w" );
fwrite( $fp, "<html>\n<body bgcolor=\"#FFFFFF\">\n</body>\n</html>" );
fclose( $fp );
mosChmod( $uploaddir."/index.html" );
$refresh_dirs = true;
}
if( !file_exists( $uploaddir ) ) {
$vmLogger->err( $VM_LANG->_PHPSHOP_FILES_PATH_ERROR );
return false;
}
if( substr( $uploaddir, strlen($uploaddir)-1, 1) != '/') {
$uploaddir .= '/';
}
    $noMatch = 0;
foreach( $allowable as $ext ) {
if ( strcasecmp( $format, $ext ) == 0 ) {
$noMatch = 1;
}
}
    if(!$noMatch){
$vmLogger->err( "File Type is not Supported" );
return false;
    }

I am using Joomla 1.0.10 and Virtuemart 1.0.6.  My site is currently sitting in a subdirectory /main until I get it where I am ready for it to be published, www.buffaloriverreview.com/main is the current location, and I am trying to add the feature where a person wanting to buy advertising in the newspaper can upload an image file, etc.  Right now I only am working on it under the classified ads product only.

Pat


barnett

  • Jr. Member
  • **
  • Posts: 92
    • Contemplate Design
Re: Custom Attributes Extended [Easy Hack]
« Reply #24 on: September 07, 2006, 03:17:45 am »
I feel like such a dunce.  I did not have the subdirectory specified in the attributes screen.  Once I added that, and made sure the subdirectory existed with 777 permissions, I no longer get the error on the VirtueMart screen on the website:
> move_uploaded_file failed to open in ps_product_attribute.php

we all make mistakes no worries.

However, I do not see the file in the subdirectory I created either.  I am sure this is because I can't get the code into the file!  When I am editing the ps_product_attribute.php file in JoomalXplorer, and add this section of the code, my Joomla screen goes to the Forbidden notice.  I am kicked out of Joomla's admin.  Any other changes I've made to this file have been saved and no problems.  It's just the piece of code where the file is uploaded:

I've had similar issues with Joomlaxplorer.  The best thing is to use the download feature on Joomlaxplorer to download the file and then edit it in wordpad and save it.  Then go back to Joomlaxplorer and upload the newly edited file over the old one on the server.

I upgraded to the newest Joomlaxplorer a few weeks ago and haven't had any problems since.

let me know how it works out.
-barnett

patvb2003

  • Beginner
  • *
  • Posts: 5
Re: Custom Attributes Extended [Easy Hack]
« Reply #25 on: September 07, 2006, 03:32:51 am »
I feel like I just climbed Mt. Everest!  I got it working!

Since I knew it was failing on the code that creates a directory, I just eliminated it.

Code: [Select]
// create directory if doesn't exist
if(!is_dir( $uploaddir ) && !is_file( $uploaddir ))
{
require_once( 'administrator/includes/admin.php' );
mosMakePath( $uploaddir );
$fp = fopen( $uploaddir . "/index.html", "w" );
fwrite( $fp, "<html>\n<body bgcolor=\"#FFFFFF\">\n</body>\n</html>" );
fclose( $fp );
mosChmod( $uploaddir."/index.html" );
$refresh_dirs = true;
}

Having already created the subdirectory for the files to be uploaded to, and having made sure permissions were 777, I tested it, and it worked!  Thank you for making me look so brilliant with the folks at the newspaper!

Now I'm headed over to see what's up with JoomlaXplorer.  Thanks for the tip on how to get around JoomlaXplorer.  At least I know I can sleep tonite.

Pat

baisan

  • Beginner
  • *
  • Posts: 11
Re: Custom Attributes Extended [Easy Hack]
« Reply #26 on: September 07, 2006, 12:19:28 pm »
hi!

Just wondering if you still launch your new version for custom atrributes extended.
For Uploads,  - hope it will work standalone
                   - hope we can upload more than 1 file
                   - hope there's an admin configuration for uploads, 1. choose upload folder 2. create multiple folder 3. hope there's an upload
                     limit. 4. Add extension

One thing is.. if there's a child item of the product and you choose one.. the upload attributes is lost  :(

Hope there's a solution for this.

Thanks!

patvb2003

  • Beginner
  • *
  • Posts: 5
Re: Custom Attributes Extended [Easy Hack]
« Reply #27 on: September 07, 2006, 15:04:39 pm »
Re: File Upload -
One more request... not all customers have a file to upload, and they see an error message after clicking "Add to Cart" button.  I tried adding a file of type "   " and it did not work, still got an error message.  Any suggestions on a quick fix for this? 

Thanks!
Pat

barnett

  • Jr. Member
  • **
  • Posts: 92
    • Contemplate Design
Re: Custom Attributes Extended [Easy Hack]
« Reply #28 on: September 07, 2006, 15:49:04 pm »
hi!

Just wondering if you still launch your new version for custom atrributes extended.
For Uploads,  - hope it will work standalone
                   - hope we can upload more than 1 file
                   - hope there's an admin configuration for uploads, 1. choose upload folder 2. create multiple folder 3. hope there's an upload
                     limit. 4. Add extension

One thing is.. if there's a child item of the product and you choose one.. the upload attributes is lost  :(

Hope there's a solution for this.

Thanks!

Thanks baisan for the requests.   Yes I'm still in the planning phase currently and would be further along if my real job hadn't been so busy lately.  To be safe I'll shoot for the next release date to be in about a month, hopefully before october though.

@patvb2003
I'll look into a quick fix.  But you may have to wait for the next release.

-barnett

Forsh

  • Jr. Member
  • **
  • Posts: 96
    • Donate Car Denver
Re: Custom Attributes Extended [Easy Hack]
« Reply #29 on: September 09, 2006, 11:49:48 am »
I downloaded your files and thought things were functioning ok, untill I tried to add to cart I get the following error:

Warning: fopen(public_html/images\stories/index.html): failed to open stream: No such file or directory in /public_html/administrator/components/com_virtuemart/classes/ps_product_attribute.php on line 565

Warning: fwrite(): supplied argument is not a valid stream resource in public_html/administrator/components/com_virtuemart/classes/ps_product_attribute.php on line 566

Warning: fclose(): supplied argument is not a valid stream resource in public_html/administrator/components/com_virtuemart/classes/ps_product_attribute.php on line 567

Any idea?
https://www.denverdonate.com
Donate a vehicle to charity, donate my car online, how to donate a vehicle to charity, donate car denver, donate car colorado, where to donate my car online, how to

donate my car to charity, donating a car to charity, online charity Denver, donating in Denver, charity programs in Denver