Jump to content
Sign in to follow this  
Chandra

[Contribution] Option Type Feature v1.4 (for osc 2.2 ms1)

Recommended Posts

Greetings All!

 

I've got the product options contribution set up in two environments on my site... test and live. I had thought everything was working properly. But a customer placed an order today and when I went into Admin to look at the order... the product's options that should have been filled in with data from the user just said "TEXT" on the invoice!

 

I checked the orders_products_attributes table and sure enough, that's how those options are listed in the database... each as the actual word "TEXT"!

 

Now, I then attempted to place a fake order in my "live" environment. The checkout_confirmation.php file shows the CORRECT product option data.

 

Here's where things get odd. If I choose to pay via credit card, the options get written to the database properly. However, if I choose to pay via PayPal, even though the checkout_confirmation.php file shows the correct info on the next page... once I click "confirm order"... well, I check the database and the product options have all been written as TEXT!

 

So, the key here appears to be PayPal, specifically the checkout_paypalipn.php file, I'm thinking.

 

I'm wondering what exactly I should look for in this file? Is there some common code changes that I forgot to do for this module?

 

Thanks!

 

-= Dave =-

Share this post


Link to post
Share on other sites

Figured it out.

 

I just took the checkout_paypalipn.php file and lined it up line-by-line with the checkout_process.php file that I modified for this product options contribution.

 

Added in the array changes and the email-generation code from checkout_process to checkout_paypalipn. Works like a charm!

 

Thanks! And sorry for the trouble / post.

Share this post


Link to post
Share on other sites

for some reason after checkout, my quantity of the product that has this text option is set to -1

 

i go in the admin and set Quantity to 100.

i then go to my shopping cart and add one of these to my basket...

i can checkout smoothly, but when i go back to the admin section, the product is at -1 for it's quantity...

 

where would i look to try and figure this out?

what file updates the product inventory at checkout?

Share this post


Link to post
Share on other sites
Greetings All!

 

I've got the product options contribution set up in two environments on my site... test and live. I had thought everything was working properly. But a customer placed an order today and when I went into Admin to look at the order... the product's options that should have been filled in with data from the user just said "TEXT" on the invoice!

 

I checked the orders_products_attributes table and sure enough, that's how those options are listed in the database... each as the actual word "TEXT"!

 

Now, I then attempted to place a fake order in my "live" environment. The checkout_confirmation.php file shows the CORRECT product option data.

 

Here's where things get odd. If I choose to pay via credit card, the options get written to the database properly. However, if I choose to pay via PayPal, even though the checkout_confirmation.php file shows the correct info on the next page... once I click "confirm order"... well, I check the database and the product options have all been written as TEXT!

 

So, the key here appears to be PayPal, specifically the checkout_paypalipn.php file, I'm thinking.

 

I'm wondering what exactly I should look for in this file? Is there some common code changes that I forgot to do for this module?

 

Thanks!

 

-= Dave =-

 

I have the exact same problem. I thought I had this installed correctly - on the user side it displays fine but on the ADMIN side it does not.

 

I'm not using any extra paypal things or other add-ons like you Dave. The only two contributions I'm using are header tags and this one. I'm using the standard a.net payment module. My version is 2.2 MS 1.

 

Anyone know what the problem might be? Thanks.

Share this post


Link to post
Share on other sites
for some reason after checkout, my quantity of the product that has this text option is set to -1

 

i go in the admin and set Quantity to 100.

i then go to my shopping cart and add one of these to my basket...  

i can checkout smoothly, but when i go back to the admin section, the product is at -1 for it's quantity...  

 

where would i look to try and figure this out?

what file updates the product inventory at checkout?

P.S. I am using the PayPalIPN for my checkout processing in Ians Loaded 5 Snapshot....

 

any help?

Share this post


Link to post
Share on other sites

I would very much like to see the solution with checkboxes finalized, did anyone have the time to do this? :wink:

Share this post


Link to post
Share on other sites

Also, I have modified the $products_options_name_query to this:

 

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "' order by popt.products_options_id");

 

in order to get the attributes in order of the entry id on the products_info.php page, this works.

 

However, did anyone solve the problem of getting the attributes in the same order, or wanted order, on the order.php, invoice.php or packing_list.php pages, how to do this in the best way?

Share this post


Link to post
Share on other sites

I'm trying to use this contribution but i have the following problem :

The attributes can be settled up fine but when the user choose them inside the shopping cart the "attribute" will not be show...if the additional text name option is LASTNAME, inside the cart i will only see the "tsfdjfksd" inside the text box and not the "LASTNAME= tsfertc".The text added will not either be mailed...in the order i can't see the additional text.Any help with this?

I'm using MS1 an easy populate contribution+lynda attribute sorter and copier

Regards

Fabrizio


Advice on forum are Free, Email or Pm to fix your site is work...which I charge for :)

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

Share this post


Link to post
Share on other sites

Hmm...

 

I'm also having probs with this contribution. I've installed it carefully (pretty sure I got all the changes) and it *mostly* works. It's clunky and difficult to use and has a few odd bugs (such as option-value links disappearing occasionally), but it almost sorta does what I need.

 

The big bug that I'm experiencing has to do with the names of options. In product_info.php I see several places (in the option type case statement) where the name of the option is set to "id[]". This can't be right, can it? What happens is that all the options have the same name, so multiple groups of radio boxes and checkboxes affect each other (e.g., click color and size is deselected).

 

I've tried to alter this to a variable that would be unique to the specific option, but then the option value is not added to the shopping cart.

 

Anyone figure this out?

 

THANKS in advance for your replies.

Share this post


Link to post
Share on other sites

*** bump! ***

 

No one got this working correctly? Or everyone but me? Any suggestions or ideas before I start pulling it apart on my own?

Share this post


Link to post
Share on other sites

I'm sorry but i can't understand why people create contributions if they don't want to support them :(

I have trouble setting this aswell and will prolly find an alternate way, this post is dead from a long time :/


Advice on forum are Free, Email or Pm to fix your site is work...which I charge for :)

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

Share this post


Link to post
Share on other sites

I'm gonna make this ConteZero attribute modification thing work today, dammit.

 

The first thing I notice is that there's a problem with the attributes not being given unique names in product_info.php (they're all just named "id[]"). Obviously this won't work, since radio buttons and checkboxes affect each other, etc. So let's change it.

 

First thing I did was replace all the "id[]" names with the following:

 

name ="id[' . $products_options_name_values['products_options_id'] . ']"

 

(Don't just find and replace all instances. Find each "id[]" and replace it if appropriate. This code is kinda messy.)

 

But then I realized that this doesn't work for checkboxes, since each of those needs it's own individual name (since you can choose more than one). So for checkboxes I used this:

 

$name_checkbox = 'id[{' . $products_options_name_values['products_options_id'] . '}' . $products_options_values['products_options_values_id'] . $linked_attrib . ']';

 

(Replace existing code with this.)

 

This seems to be working and does add the options to the shopping cart as it should.

 

NOTE: My site doesn't have any text or multiple select fields, so I haven't tested them. I'm pretty sure that the text fields just plain don't work, but if you mess with their name and value code I'm sure they could be made to work. I have no idea why they use tep_draw_hidden_field instead of tep_draw_input_field either, but that's the first thing to change.

 

Personally, I think this is too messy and complicated to be made to work properly. At least I don't fully understand it, and some of the code is clearly broken. So I'm just going to remove everything I'm not using and see if I can combine this with Linda's attribute sorter/copier into a more sane and stable system for my client.

 

I strongly suggest that the core team make fixing osC's attribute system a high priority. There should be a way to group and organize attributes of various types and add/remove those groups from the product page of the admin tool. This is too fundamental a component to be left out of the official osC releases, imho, and it's standard with other eCommerce packages.

Share this post


Link to post
Share on other sites
I'm sorry but i can't understand why people create contributions if they don't want to support them :(
Because they don't want to support them. By contributing it, they get additional support from others that they would not get if they left it as a local mod. Plus the possibility that it might get integrated into the main project, in which case they are guaranteed support.

 

A better question is why so many people are willing to support their contributions, even though they don't get anything for it and people are amazingly ungracious when they try to help.

 

--Matt

Share this post


Link to post
Share on other sites
Because they don't want to support them. By contributing it, they get additional support from others that they would not get if they left it as a local mod. Plus the possibility that it might get integrated into the main project, in which case they are guaranteed support.

 

A better question is why so many people are willing to support their contributions, even though they don't get anything for it and people are amazingly ungracious when they try to help.

 

You're right, of course. People who make contributions have no obligation to support them. We should just be thankful that they invest their time and effort into creating something that will hopefully be useful to the rest of of and that they share it.

 

I think that Freeman is just frustrated that there hasn't been any published solution to this issue yet. If people in the community or the contribution author were responding to the problems that have been posted, I'll bet he would feel differently. Although the community support and contribution systems generally work very well, when they fail you can certainly understand why someone would feel as if they've been left hanging.

 

If advanced option management is not going to be added to the main code any time soon, it would be fantastic if one of our star contributors could merge Linda's attribute sorter and some multiple option type mod together and package them as a contribution for the new milestone (Linda? :wink: ). I would do it if I felt qualified to do so, but this is my first osC installation and I'm still learning the ropes.

Share this post


Link to post
Share on other sites

Well,

Obviusly i'm getting frustrated :)

I just think that both of you are right, having a useful contribution in my hand and not the key to use it is like to have a ferrari but not the keys to start it :D

(it would be easier to solve the ferrari prob hehe)

Open source is this, and it's nice also to help out other peoples, just wish to know if someone want to team up and try to solve this contribution out.

I'm studing php atm but i'm at basic level and this project is really big, i'm here if someone want to try fixing this togheter

Cya

Fabrizio


Advice on forum are Free, Email or Pm to fix your site is work...which I charge for :)

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

Share this post


Link to post
Share on other sites

Yes, it is a pain. I got it working for the three types I need (drop-down menus, checkboxes, and radio buttons), but I didn't even try to make the text or other fields work. I also have not integrated Linda's sorter/copier into my site because I realized that it wouldn't be quick or simple and I needed to move on to other things (and it is working now, albeit in a way that I find unnecessarily complicated).

 

I'd be happy to send you my files or give you tips on how to make changes. I don't think I should post what I've done here, though, since my files are so heavily modified that it would probably just confuse others. The main trick to fixing this contribution is in the posts I made a few days ago.

 

My impression is that everyone is holding their breath for the next milestone and trying to put off new contributions or modifications until it is released. That makes sense, of course, since it will be the new standard installation, but it kinda leaves those of us with previous versions in the lurch. I hope that for the next milestone there will be a perfect contribution that makes this struggle unnecessary for the next folks.

Share this post


Link to post
Share on other sites

Well, i'm going on with my php study :)

I can handle the checkbox thing, to be honest i'm interested into the "text" feature.I have an online shop running at www.rugbysport.com/catalog/default.php

I put a lot of efforts into modding and hacking it to make it fit my needs, when the next milestone will be out i will test it before making any mod since it's a live shop :)

Btw let's keep in touch to sort things out, i've seen lot of post with contribution left to half....i think many people just try a contribution, ask for help and if they fix it they just don't share the tip.....it happened also to some posts i saw regarding style sheets and i think it's not the right mood to make this work.I appreciate OSC and the community, like great people as Lynda, which put lots of efforts for the community, obviusly she's a top programmer btw if there is something on my site of any interest i will make it avaible, just drop me a note!

Cya soon

Fabrizio


Advice on forum are Free, Email or Pm to fix your site is work...which I charge for :)

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

Share this post


Link to post
Share on other sites

Hello.

I have just installed lindas sec1_0b.

And i am trying to install this module with it.

 

I was hoping for one or both of the following:

1) a site that demonstrates this contribution

-so i know if i have done it correctly.

2) some1 that added this contrib with linda's sec1_0b

-maybe they'ed share ?

 

Thanks.

 

Lucy.

Share this post


Link to post
Share on other sites

Hi Freeman,

i have the same Problem as you and I am working on it. It may last perhaps two days but i am sure to solve it because I need this feature too.

 

its not a big problem, it is caused by a missing databaseentry. If you make this entry manually everything works fine.

I kow its not possible to enter all entries manually, all i wanted to say is that the output is correct, there is just a databaseentry missing.

 

Anything else i am going to find out.

 

kind regards

 

Kobold

Share this post


Link to post
Share on other sites
I'm sorry but i can't understand why people create contributions if they don't want to support them

 

Some times support for contributions is not possible, due to lack of time or other circumstances (e.g. relocation, new job ...)

 

But I'm willing to help as sone as my internetlink at home is working properly.

 

So far

Dominik


Maintainer German Banktransfer 0.92

The answer to the great question of life, the universe and everything is 42 (Douglas Adams)

Share this post


Link to post
Share on other sites

Hi

i found a solutions which is working with my OSCommerce version.

The Problem was caused by four SQL-SELECT_QUERIES which did not return any values.

One of these Querries are in the catalog/shopping_cart.php

 

Step 0 : Backup!!!!!!!

_____________________________________________________________

 

Statemen1 No 1

 

$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix

from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa

where pa.products_id = '" . $products[$i]['id'] . "'

and pa.options_id = '" . $option . "'

and pa.options_id = popt.products_options_id

and pa.options_values_id = '" . $value . "'

and pa.options_values_id = poval.products_options_values_id

and popt.language_id = '" . $languages_id . "'

and poval.language_id = '" . $languages_id . "'");

 

 

remove this line -> and pa.options_values_id = poval.products_options_values_id

_____________________________________________________________

 

 

Next one is in the catalog/includes/classes/order.php

 

Statement No. 2

 

$attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name,

pa.options_values_price,

pa.price_prefix

from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa

where pa.products_id = '" . $products[$i]['id'] . "'

and pa.options_id = '" . $option . "'

and pa.options_id = popt.products_options_id

and pa.options_values_id = '" . $value . "'

and pa.options_values_id = poval.products_options_values_id

and popt.language_id = '" . $languages_id . "'

and poval.language_id = '" . $languages_id . "'");

 

remove this line ->and pa.options_values_id = poval.products_options_values_id

 

_____________________________________________________________

 

Two Statements to go in the checkout_process.php

 

 

$attributes_query = "select popt.products_options_name, poval.products_options_values_name,

pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays,

pad.products_attributes_maxcount ,

pad.products_attributes_filename

from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa

left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad

on pa.products_attributes_id=pad.products_attributes_id

where pa.products_id = '" . $order->products[$i]['id'] . "'

and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'

and pa.options_id = popt.products_options_id

and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'

and pa.options_values_id = poval.products_options_values_id

and popt.language_id = '" . $languages_id . "'

and poval.language_id = '" . $languages_id . "'";

 

remove this line -> and pa.options_values_id = poval.products_options_values_id

 

 

 

last one:

 

$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name,

pa.options_values_price, pa.price_prefix

from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa

where pa.products_id = '" . $order->products[$i]['id'] . "'

and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'

and pa.options_id = popt.products_options_id

and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'

and pa.options_values_id = poval.products_options_values_id

and popt.language_id = '" . $languages_id . "'

and poval.language_id = '" . $languages_id . "'");

 

remove this line -> and pa.options_values_id = poval.products_options_values_id

 

 

Now it is important that the products_options_value table in your database is never empty.

To ensure this please create a select product option + product option value.

 

 

This worked with my onlineshop. I can t give any warrenty if that will work with your shop.

 

CU

 

Kobold

Share this post


Link to post
Share on other sites

Great that you got this working, Kobold.

 

Question: By "working", do you mean that it works with all option types, or just with text fields? The reason I ask is that there is a fundamental difference between how the other option fields work (with a set value in the database) and how text field options work (where the user enters the value). It seemed to me as if this contribution was not designed to work properly with text fields, since it always references just the option value's id number (not the actual value).

 

I don't have any text fields in my site, so I just removed that part of the code (and I haven't tried your fix), but a lot of people specifically want text fields. So if your fix works only for text fields (but breaks for radio buttons, checkboxes, etc.), I think a lot of people will be very pleased anyway. But if all those things continue to work also, then you've got yerself a gold star for the month.

Share this post


Link to post
Share on other sites

Hello to all:

 

I appear, I am new in this forum and with osCommerse. This week I installed the version MS2 that is the available one for download, and I was forming it without problems.

 

My problem arose when installing this contribution, since I need to place text attributes in my products (the majority is personalizables).

 

I have realized that lamentably is not compatible with version MS2. If somebody knows like forming it, that modifications can be done to him or if another version is being prepared very I am thanked for them.

 

Greetings to all. :D

Share this post


Link to post
Share on other sites

Welcome to osC!

 

As I understand it (someone correct me if I'm wrong), there are two different contributions that allow you to choose different option types: Chandra's and ConteZero's.

 

The text fields in ConteZero contribution do not work as you would expect (or probably want them to). Instead of allowing a user to enter some text (an inscription, etc.) and then passing that text to the order details, it simply adds a set value as a hidden field to the order. Kobold seems to have modified it to work for him (see thread above), so maybe you can, too.

 

The Chandra contribution is supposed to have text fields that work as you expect them to, but I haven't tried it myself.

 

I installed the ConteZero contribution on a fairly recent CVS snapshot (from sometime in June), and it worked for me after some fiddling (that didn't have anything to do with the snapshot). I don't know if your problem is that the latest snapshot (almost but not quite MS2) is really incompatible with these contributions, or if you're just running into the issues that others have had with them also. I'm sure that you could get any of the older contributions to work on the latest snapshot, but it might take a bit of investigation and effort.

 

It will probably be a little while before there are new contributions out for MS2, since it hasn't even been officially released yet, but keep checking to find out. I'm still hoping that someone will write the Mother of All Options contributions for the new milestone combining Linda's Sorter/Copier and an option type mod. Cross yer fingers and you might get lucky.

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
Sign in to follow this  

×