Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Option Types v2


Zappo

Recommended Posts

@@ShaGGy

 

You have a link to your shop where you experience this?

On my test shop I have absolutely no problems at all. I can have multiple options no matter if input field or radio buttons, checkboxes or dropdowns and I can anytime update it, remove it or remove all items at once or set the qty to zero. 

I cannot replicate your issue in my test shop.

Link to comment
Share on other sites

@@LeeFoster

 

To be honest I don't know how to implement the Option Types addon with Kymation's Modular Product Page addon.

I had a look at it and he uses some sort of array to call the options.

Plus you try to add the Option Images extension which makes it more complicate.

 

As far I know The Option Types BS addon is not compatible with the Modular Product Page addon nor is it compatible with the Option Images extension.

I hope Jim finds time one day to look at it because I won't do it. It simply is beyond my skill level.

 

So you'll have to make up your mind either you install only the Option Types BS addon or you install Kymations Modular Product Page + Option Images extension.

Edited by Tsimi
Link to comment
Share on other sites

It's all compatible, you just need to merge the two. I'll take a look at it and see what I can do. I'll need some help testing since I don't have a lot of time here.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@jlous

 

Hi Jennifer

 

Do you have the following code inside the catalog/includes/functions/general.php file?

  function tep_decode_specialchars($string){
    $string=str_replace('>', '>', $string);
    $string=str_replace('<', '<', $string);
    $string=str_replace(''', "'", $string);
    $string=str_replace('"', "\"", $string);
    $string=str_replace('&', '&', $string);

    return $string;
  }

Did you use some special characters inside the text fields?

the fields have a default INPUT and ID. When you go to your admin area -> Products Attributes -> under Option Values you should have/see ID 0 / CUSTOMER-INPUT that is the default and should be not deleted from the database. If that is deleted it won't work.

 

Hi, 

 

Thanks for the response. I fixed the missing tep_decode_specialchars, but I am still getting the errors when the shopping cart is displayed. This is only happening if both fields are left blank or if spaces with no other text are entered. I compared my shopping_cart.php to the one that came with the contribution. They are both identical. The ID 0 / CUSTOMER-INPUT has not been deleted. Also the invoice, packing slip, and checkout confirmation pages all display with out the errors. No other contributions have been added. I did notice that the IDs for the two text fields are 3 and 5 and the the errors mention 'txt_3' and 'txt_5'. No idea if that is related, but I noticed so I am mentioning it. 

Link to comment
Share on other sites

@@jlous

 

What version of oscommerce are you using and which version of Option Types did you install?

 

You upgraded or are in the process of upgrading your shop?

Can you once compare the html_output.php file of your current shop with the one from a fresh package using winmerge or any other comparison tool. In particular the tep_draw_input_field stuff.

Edited by Tsimi
Link to comment
Share on other sites

  • 2 weeks later...

@@LeeFoster @@Tsimi and anybody else who is interested: I have a test version of Option Types merged with Modular Product Page. This should be considered Alpha code. Do not use it on a live store. I will not be responsible if it fails to work, attacks other software, or sets fire to the server.

 

You can get the software here. It assumes that you have already installed Modular Product Page and Option Types V2.

 

Please let me know what it does or does not do.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi,

 

I installed this contribution (BS version) and really like it. Everything works fine except for text / text area fields. They work at the entry point but by the time the order is placed in the text is replaced by the words CUSTOMER-INPUT.

 

Also if customer was not signed in the message gets truncated at the time of signing in.

 

The following are screen prints to show it. PLEASE HELP! Thanks.

 

https://snag.gy/v9tKls.jpg

https://snag.gy/ZUYT2V.jpg

 

Customer was not signed in, and signed in after adding item to the cart:

https://snag.gy/Ouej8H.jpg

 

Customer was signed in:

https://snag.gy/wntL7X.jpg

 

Final result in the admin:

https://snag.gy/MXrnl0.jpg

Edited by Lary_an
Link to comment
Share on other sites

@@kymation

 

Thanks for taking the time to look into it Jim.

Well it seems Larry here got far better results than I did.

I have a test shop in my local server (XAMPP) with Option Types installed. I installed your Modular Products Page addon and after that I used your files from the alpha package.

 

I guess that I have to remove the previous options module from your MPP addon right?

If I leave it as is I get an error message in the amdin area as soon I try to access the content modules.

If I remove the old options module file set and use your alpha version only I get this error when accessing the product info page

 

Fatal error: Cannot use object of type product_info as array in C:\xampp\htdocs\demo3\includes\modules\option_types.php on line 19

 

I think you told me once that I just need to change/rename the product_info part since it cannot be used in 2 places at the same time.

 

Another PITA is the products_attributes file in the admin area. Your changes are based on a clean, stock products_attributes file adding your code changes into a option types modified product attributes file is very challenging.

 

Thus far I cannot give more feedback then the above since I cannot get it to run properly.

 

My current setup is

 

- vanilla osC EDGE

- Option Types BS

- Modular Products Page

- Alpha package

- Fire extinguisher (just in case my pc goes up in flames)  :D

Edited by Tsimi
Link to comment
Share on other sites

It appears that I tried to simplify this a bit too much. Oh well. I'll fix the bugs you mentioned and try again. Keep that fire extinguisher handy....

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I managed to get past the issue @@Tsimi was having by changing all occurances of $product_info to $products_info in the option_types.php file and the product page now loads. The issue I'm seeing now is that although the page loads and shows all options if you try to use multiple type (text & select) it shows all as select.

 

I've also managed to merge the product_attributes.php pages.

 

I'm going to go though and check I haven't missed anything.

Link to comment
Share on other sites

Hi Jim,

 

Please help!

 

I installed BS version of this contribution in my live shop and really like it. Everything works fine except for text / text area fields. They work at the entry point but by the time the order is placed in the text is replaced by the words CUSTOMER-INPUT.

 

Also if customer was not signed in the message gets truncated at the time of signing in.

 

The following are screen prints to show it. PLEASE HELP! Thanks.

 

https://snag.gy/v9tKls.jpg

https://snag.gy/ZUYT2V.jpg

 

Customer was not signed in, and signed in after adding item to the cart:

https://snag.gy/Ouej8H.jpg

 

Customer was signed in:

https://snag.gy/wntL7X.jpg

 

Final result in the admin:

https://snag.gy/MXrnl0.jpg

Link to comment
Share on other sites

@@Lary_an

 

You just installed the Option Types BS addon? Without the Modular Products Page addon from Jim?

If yes then that would explain why you could at least get as far as you did.

 

Did you apply all the code changes to the files, admin and catalog side, that are explained in both install manuals?

Did you also run the SQL query?

 

Double check all the files again you might be missing something.

I just tested it in a 1 week old osC EDGE shop and I cannot recreate the same error that you have.

Link to comment
Share on other sites

@@Tsimi,

Thank you for your reply. Actually i installed it a little while ago, and just started noticing the problem, because some of the customer comments are not coming through. It is really weird. I get all 3 versions - complete, truncated, or CUSTOMER-INPUT. So i started checking and was able to recreate CUSTOMER-INPUT, in fact it is the only one i was able to recreate. Well, i do see that if it is a guest, it gets truncated before it gets confirmed. I checked and triple checked everything, but can't find the issue. Maybe i am missing something, but then i need a direction on where to look. 

 

I upgraded to BS version couple of months ago - i did a clean start + addons, then converted DB

I used this addon in my previous setup with no problems, and for some reason i didn't pay attention to CUSTOMER-INPUT in the comments right away, only when i got a customer telling me that she sent a message. I did notice truncation before, just didn't get around to really look at it - this one i got today - https://snag.gy/UVPgf2.jpg.

 

Is it possible that this is device / browser sensitive? just a thought.

 

Thanks again, your help is greatly appreciated.

Edited by Lary_an
Link to comment
Share on other sites

@@Lary_an

 

Hi Larry

I finally could recreate your problem. You are right the text gets truncated if you add a product into the cart and then login to proceed to the checkout.
The shopping cart page, checkout confirmation page and the order in the admin area show that truncated text.
To fix that you'll have to edit the following 2 fields by accessing your database via phpMyAdmin or a similar tool.

Table: customers_basket_attributes
Field: products_options_value_text

set it to varchar(500) *if you have a large text field that uses 500 otherwise adjust the number to your needed value.

Table: orders_products_attributes
Field: products_options_values

set it to varchar(500) *if you have a large text field that uses 500 otherwise adjust the number to your needed value.

This should fix it for now. Depending on your MySQL version varchar 500 might not work for more info read here. If that is the case use TEXT instead.

 

I have no idea why it works if you login first and add the text to the product and then add it to the cart and proceed to the checkout.
Need to do more research on this but the above fix should patch it for now.
Keep in mind if you don't need 500 letters you can either adjust it accordingly or you can keep it at 500 just in case, it won't matter if the text field is set to 300 or anything smaller then 500 it still works the same.

Edited by Tsimi
Link to comment
Share on other sites

@@Lary_an

 

Did you try varchar 500 only or did you also try to use TEXT instead? What MySQL version does your host use?

 

If it's OK with you can I create a test account at your shop? I see that you also use the PWA addon (Purchase Without Account) if I try to place an order through there but don't go through the whole checkout process the customer record will be left until you delete it.

Link to comment
Share on other sites

@@Tsimi,

 

my host is using MySQL version 5.1.68. I only tried varchar 500, not text. I looked into at the content in the DB and it is not truncated in the 

Table: customers_basket_attributes
Field: products_options_value_text

 

Really weird. You are absolutely welcome to create an account, or do anything else on my site - whatever helps. I really appreciate your help.

Link to comment
Share on other sites

There seems to be a tiny problem with this addon when using text input fields as options and the PayPal Standard payment module.

The problem is, you insert a text inside those option text fields then go to checkout and reach the PayPal address the text disappears and gets replaced with CUSTOMER_INPUT instead.

Meaning the text inserted by the customer is gone.

To fix that open the following file

 

catalog/includes/modules/payment/paypal_standard.php

 

Search for this following piece of code

'products_options_values' => $attributes_values['products_options_values_name'],

and replace that with this

// Fix for Option Types addon to show the text field values     
// 'products_options_values' => $attributes_values['products_options_values_name'],
'products_options_values' => $order->products[$i]['attributes'][$j]['value'],

I know it is not ideal to change core code especially inside payment modules but this seems to fix that bug and has no conflict with any other function of the shop or payment module.

Like I said this happens only with PayPal Standard so if you use PP Express or any other PayPal module you should be fine and don't need to apply this fix.

 

 

Additional to the above fix you will most likely want to apply the database field changes to avoid the text being truncated.

To fix that you'll have to edit the following 2 fields by accessing your database via phpMyAdmin or a similar tool.

Table: customers_basket_attributes -> Field: products_options_value_text

set it to varchar(500) *if you have a large text field that uses 500 characters otherwise adjust the number to your needed value.

Table: orders_products_attributes -> Field: products_options_values

set it to varchar(500) *if you have a large text field that uses 500 characters otherwise adjust the number to your needed value.

Depending on your MySQL version varchar 500 might not work. If that is the case use TEXT instead.

 

Thanks to @@Lary_an for pointing out those bugs.

Edited by Tsimi
Link to comment
Share on other sites

@@kymation

 

Did you manage to get any further with this?

 

I managed to get it installed and partially working. If I use a textbox on it's own it works, if I use a textbox with a drop down both show as a drop down, if I use a radio button or check box nothing shows up.

 

I'll carry on looking in to this but I think it's beyond me.

Link to comment
Share on other sites

No, I've had too many distractions. I was hoping that you had gotten it working.

 

Send me your code and I'll take a look as soon as I can. My email is nospam at my username.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Other than changing product_info to products_info in the option_types.php to fix the below error 

 

Fatal error: Cannot use object of type product_info as array in C:\xampp\htdocs\demo3\includes\modules\option_types.php on line 19

 

And merging the admin/product_attributes.php file the rest of the work is yours.

 

Edit: Now I think about it, that's probably what's caused the issue.

Edited by LeeFoster
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...