Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Option Types v2


Zappo

Recommended Posts

Hi zappo,

 

first many thanks for this greatful contrib!!

 

Sorry for my bad english, i hope you (or somebody else) can help me.

 

I integrate the contrib in my modified shop.

 

On the shopping-card, i can see the value from the customers he put in a text-option

 

look here:

 

shopping_cart.JPG

 

But on the checkout_confirmation (and account_history, order-mail) not the value ist displayed,

only i can see is "CUSTOMER-INPUT"

 

Here a screen from the checkout_confirmation:

 

checkout_confirmation.JPG

 

 

I check the implementation more and more, but i can`t find my bug.

 

I have a look in the "customer_basket_attributes-Table", i think it´s corrct

 

sqldmp_customers_basket_attributes.JPG

 

But in the "orders_products_attributes-Table" i think it´s not correct

 

sqldmp_orders_products_attributes.JPG

 

 

Please can you help me!

 

I need the feature

- checkbox

- text

- text-area

for the christmas-time urgently.

 

Thank you very much

 

Anja from Germany

Link to comment
Share on other sites

Hi zappo (or anyone else that could help me),

 

First off thank you very much. I could not use Oscommerce if this contrib wasn't around.

 

I REALLY need to be able to add weight to my options so customers can get real time quotes via FEDEX/USPS.

 

I tried merging this with add-weight-to-product-attributes v0.2 and when I got to the products_attributes.php page I couldnt figure out how to complete the merge. Can anyone help me with merging these two contirbs? I REALLY need to be able to add weights to attributes. I also use the Ajax AttribManager...

 

Thanks for any insight,

Link to comment
Share on other sites

I was working on (and am going to use myself) a contribution (Linked Products) with a "Products as Options" option, but that's currently not working and "On Pause", but I will eventually pick that contribution up when I have the time.

(As I said, I'll be needing it myself)

 

I would like to help make this work. I have not spent a whole lot of time understanding the attributeManager code, nor do I have lots of free time, but I would be willing to follow through on whatever todo lists you have to resolve the issues reported in the Linked Products support thread.

 

The first thing that stands out to me is missing column 'type_show_product_as' reported there. How is that intended to be used in the product_types table?

 

Please contact me via email at: my first name at first initial last name .net

 

My name is Ian Freeman.

 

ie [email protected]

 

Thanks.

Link to comment
Share on other sites

Hi friends.

 

I get the following error when I try to add an item to my cart from the Product page (the "Add to Cart" button):

Warning: opendir(images/temp/) [function.opendir]: failed to open dir: No such file or directory in /[www path]/public_html/catalog/includes/application_top.php on line 371

Could not open images/temp/

 

I checked my folder structure and the the directory does exist. Anyone know what the issue is?

 

Thanks!

Link to comment
Share on other sites

Hi friends.

 

I get the following error when I try to add an item to my cart from the Product page (the "Add to Cart" button):

Warning: opendir(images/temp/) [function.opendir]: failed to open dir: No such file or directory in /[www path]/public_html/catalog/includes/application_top.php on line 371

Could not open images/temp/

 

I checked my folder structure and the the directory does exist. Anyone know what the issue is?

 

Thanks!

I believe that should be a complete path, e.g. /[www path]/public_html/catalog/images/temp/

Also, check if the folder is writeable

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

I believe that should be a complete path, e.g. /[www path]/public_html/catalog/images/temp/

Also, check if the folder is writeable

 

Ugh. Spoke too soon when I said "the directory is there". When I went to investigate the permissions like you said, I found the folder missing. FTPed it back up and tried again and it worked!

 

Thanks much!

Link to comment
Share on other sites

Hi zappo,

 

first many thanks for this greatful contrib!!

 

Sorry for my bad english, i hope you (or somebody else) can help me.

 

I integrate the contrib in my modified shop.

 

On the shopping-card, i can see the value from the customers he put in a text-option

 

look here:

 

shopping_cart.JPG

 

But on the checkout_confirmation (and account_history, order-mail) not the value ist displayed,

only i can see is "CUSTOMER-INPUT"

 

Here a screen from the checkout_confirmation:

 

checkout_confirmation.JPG

 

 

I check the implementation more and more, but i can`t find my bug.

 

I have a look in the "customer_basket_attributes-Table", i think it´s corrct

 

sqldmp_customers_basket_attributes.JPG

 

But in the "orders_products_attributes-Table" i think it´s not correct

 

sqldmp_orders_products_attributes.JPG

 

 

Please can you help me!

 

I need the feature

- checkbox

- text

- text-area

for the christmas-time urgently.

 

Thank you very much

 

Anja from Germany

 

OK i found my bug. It was a problem in the order.php.

 

Now i had a new problem.

 

I use the wishlist-contrib.

 

In the wishlist, the options are not displayed.

But when i put a article from the wishlist to the shopping-cart, the options are correct transmit to it.

 

I think, its only a display-problem in the wishlist, but i can´t find the bug.

 

Can somebody help me please?!

Link to comment
Share on other sites

Couldn't leave this hanging somehow...

To help you on your way, I found a script (and tweaked it a little) to block entering anything but 0-9 and a-z

HOWEVER, it seems this isn't as simple as I thought: it seems validating what key was pressed by the customer, depends on his/her keyboard settings! We can only check what physical button was pressed, not what (special-)character.

I would imagine you'd want to let the user enter "." as well, which already gave me too much hassle to investigate further... ("." is key Code 190 on my keyboard)

Anyway, checkout the code I found: In product_info.php, BEFORE:

// EOF - Zappo - Option Types v2 - Added for Form Field Progress Bar 
//--></script>
</head>

ADD: (as you can see, I added some comments to help tweak the code)

function checkchars(e) {
 var key;
 var keychar;
 if (window.event) {
   key = window.event.keyCode;
 } else if (e) {
   key = e.which;
 } else {
   return true;
 }
 keychar = String.fromCharCode(key);
 //alert(key); // - Zappo - Un-comment to check what key Code is passed. Passed key can be added below to ALLOW
 if ((key==null) || (key==0) || (key==8) ||  (key==9) || (key==13) || (key==27) || (key==27) ) {
   return true;
 // - Zappo - You can modify ALLOWED characters here...
 } else if ((("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ").indexOf(keychar) > -1)) {
   return true;
 } else
   return false;
}

Then, in option_types.php, find the onKeyDown, onKeyUp and onFocus events of the OPTIONS_TYPE_TEXT option (around line 32), and add the following code to EACH EVENT:

return checkchars(event);

So the events look like this:

onKeyDown="return checkchars(event); textCounter(this,\'progressbar......

 

I added debugging code in the javascript to help you tweak the script a little to accept the correct characters (doesn't accept spacebar for example, (key=32)), so this should get you on your way...

 

Hi,

 

I'm also trying to do a form validation. I already added an onsubmit in the form that will call a function to validate the form fields. Ideally, some fields should not be empty. When I tried it it's not loading the alert box. It is still being added to the shopping cart.

 

Can you suggest some ways on how should I go about it? Thanks :)

Link to comment
Share on other sites

I'm also trying to do a form validation. I already added an onsubmit in the form that will call a function to validate the form fields. Ideally, some fields should not be empty. When I tried it it's not loading the alert box. It is still being added to the shopping cart.

 

Can you suggest some ways on how should I go about it? Thanks :)

Well, seems you've got the basics covered...

There must be some fault in your Javascript, as IT should show the alert, and prevent the form from being submitted.

Where and how did you add the onSubmit?

Also, let's see that validation function...

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

Is there anyone that can assist with an issue when I have more than 1 product option set to image all the attributes for both items show in the drop down together for any one product?

 

Thanks!

 

Still looking for help on this....can anyone help me out???

 

Thank You!

Link to comment
Share on other sites

Well, seems you've got the basics covered...

There must be some fault in your Javascript, as IT should show the alert, and prevent the form from being submitted.

Where and how did you add the onSubmit?

Also, let's see that validation function...

 

I figured out that it's a Javascript error :D

Link to comment
Share on other sites

So for the upload option...I thought it would email the uploaded file? Do I have something wrong or do you really have to go and retrieve files from the uploads folder? Also can people upload whatever files types?

 

Thanks,

 

I think yes, you need to take the file from the uploads folder.

 

File types are specified in file includes/classes/upload.php

Link to comment
Share on other sites

Not to be repetitive, but i've still not found a way to display my fields in the order chosen by the sort number. Instead my fields are displaying alphabetically. Can anyone who has had this issue before possibly share some insight as i'm sure it is something simple.

 

Zappo there are a couple places in the product_info.php file where the "order by" command is displayed, but I couldn't change anything by modifying the code...

Link to comment
Share on other sites

Actually, Yes, I have.

 

However, I use accounting software that's linked to osCommerce. (osFinancials)

Because of this, I have no use for QTPro. (I need to track real products for stock updating)

I'll actually be creating an entirely new contrib: Products as Options.

With that contrib, you'll be able to "group" products together as another product's Options:

For example: Main product = Shirt, Option products = Red Shirt, Blue Shirt, Green Shirt

When adding the product to the cart, it will use the selected Option Product as Main product...

 

The big difference: products attributes are no "real products", and have no stock-tracking (inside my accounting software)

Adding the Options as real products solves this problem...

Hi,

First thanks for this great contrib.

Have you gone thru your Products as Options project ?

 

For the moment, i'm using the last qtpro 4.6 and your last option types v2 together.

I don't know if I did it th right way, but what i just did is put a test on products_option_types, if it's equal to 0.

I use qtpro (since I only use it with this type of attributes) and for the other types I use your contrib.

Once again, i'm not sure that's the way to do it, but it's working good for me.

But I thought it could be interesting to explore this kind of solution until anything best is found.

Link to comment
Share on other sites

Ok so I'm having some issues with the textarea option type. I have put in 100 for it's value but only 32 characters show up in the shopping cart and consequently on the packing slip/invoice/orders.php on the admin side. I'm not sure if this is a setting I need to change somewhere or it's a setting in option types? Any suggestions? It's one of those things where I keep looking for it but just cannot see.

Link to comment
Share on other sites

I think yes, you need to take the file from the uploads folder.

 

File types are specified in file includes/classes/upload.php

Correct.

I mostly use the "preview" link (I only allow Image Uploads), to download the upload to my system.

Sending the file in the email is a good idea though... (Or maybe just a download link to the file's location)

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

Have you gone thru your Products as Options project ?

Actually, another forum member (Ian Freeman) was kind enough to pick the "Linked Products" project up.

A new release of "Linked Products" will include the Products as Options.

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

Ok so I'm having some issues with the textarea option type. I have put in 100 for it's value but only 32 characters show up in the shopping cart and consequently on the packing slip/invoice/orders.php on the admin side. I'm not sure if this is a setting I need to change somewhere or it's a setting in option types? Any suggestions? It's one of those things where I keep looking for it but just cannot see.

Don't know yet, but doesn't seem to be in the programming.

I'm guessing somewhere the database fields don't allow enough characters...

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

Does anyone have a base version of osCommerce 2.2 with this mod already "pre-installed"?

What for?!?!

Install osCommerce, copy all files from OptionTypes over installation, run SQL and you're done...

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

The install.txt file, I have to do an insane amount of file edits.

 

Or, am I going to feel really dumb here realizing that all the files, ARE the already edited files?

 

SQL query:

# Add products_options type, length (txt fields), and comment to options
ALTER TABLE products_options ADD products_options_type INT( 2 ) NOT NULL ,
ADD products_options_length INT( 2 ) DEFAULT '32' NOT NULL ,
ADD products_options_order VARCHAR( 32 ) DEFAULT '1' NOT NULL ,
ADD products_options_comment VARCHAR( 32 ) AFTER products_options_name;

MySQL said: Documentation
#1060 - Duplicate column name 'products_options_comment' 

I get that error when I import/run the .SQL

Edited by PStueck
Link to comment
Share on other sites

The install.txt file, I have to do an insane amount of file edits.

 

Or, am I going to feel really dumb here realizing that all the files, ARE the already edited files?

 

SQL query:

# Add products_options type, length (txt fields), and comment to options
ALTER TABLE products_options ADD products_options_type INT( 2 ) NOT NULL ,
ADD products_options_length INT( 2 ) DEFAULT '32' NOT NULL ,
ADD products_options_order VARCHAR( 32 ) DEFAULT '1' NOT NULL ,
ADD products_options_comment VARCHAR( 32 ) AFTER products_options_name;

MySQL said: Documentation
#1060 - Duplicate column name 'products_options_comment' 

I get that error when I import/run the .SQL

install.txt??? There's no install.txt...

 

Read the error!!!

Duplicate column. You already have a products_options_comment column. (already ran (part of) the SQL?)

Like Eek said... It never hurts to help!
----------------------------------------

Link to comment
Share on other sites

I've got this contribution installed and I've got an issue I'm trying to hammer out:

 

If I have only text-input fields on a product, the entered info does not carry over to the shopping cart... BUT... if I have text-input fields on a product that ALSO has a drop-down of any sort, then all the entered info carries over to the shopping cart correctly.

 

Any ideas where I'm getting hung up?

 

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...