Jump to content
Latest News: (loading..)
Zappo

[Contribution] Option Types v2

Recommended Posts

@@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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Strangely I can now only see one attribute unless I have 3 or more, then I have the same problem as mentioned previously. 

 

Also check boxes and radio buttons don't show at all.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

@@Tsimi

 

Thank you very much for taking your time to help me,

 

i had the 500 length for the

Table: orders_products_attributes
Field: products_options_values

 

but not the other one. Made the change, but it still truncates the value.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Hi,

 

I solved the problem. The server was running PHP version 5.2. I had it updated 5.3 and that seemed to fix the problem. 

 

Thanks for you help.

 

Jennifer

Share this post


Link to post
Share on other sites

Hi guys!

I want to type the option - file, allows users to upload files: RAR, ZIP?
Now it lets you upload images only.
What changes should I make to the code?

Thank you!


No outside url's in signatures allowed - thanks

Share this post


Link to post
Share on other sites

I want to add a link to an image, the administrator can download the uploaded image.
Reference should be only when the option type - Image.
To do this, create a condition if.
I can not understand for what variable to catch.
Can you help me create the condition?

 

admin/orders.php

//BOF - Zappo - Option Types v2 - Removed <nobr>, because Text options can be very long
// burt 2.3.3.4
             echo '<br /><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
             if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
             ///////////// A link to download the file, if that type of option - file
             if (???????????????????? == 'Image') {
              echo '<br /> <a href="' . (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . '/images/uploads/' . $order->products[$i]['attributes'][$j]['value'] . '" target="_blank">' . TEXT_TYPE_OPTION_FILE_DOWNLOAD . '</a>';
             }
             //////////////////
             echo '</i></small>';
//EOF - Zappo - Option Types v2 - Removed <nobr>, because Text options can be very long

Thank you very much for your help!

Edited by spidometrs

No outside url's in signatures allowed - thanks

Share this post


Link to post
Share on other sites

@@spidometrs

 

Hi Sergey

Sorry but I have no clue. I tried for a few hours but didn't get anything useful.

The shopping_cart.php has a link to the image but any attempt to copy that feature failed.

It would be nice to be able to click on a link to download the image or have a small thumbnail to right click on it and save it.

This is beyond my skills, sorry. I hope someone can and will shed some light in this matter.

 

I know Burt did created a very nice, commercial image upload and handling feature for one of his customers in the past.

Here the link to the introduction page

 

http://www.clubosc.com/interesting-project-file-uploads.html

Share this post


Link to post
Share on other sites

@@spidometrs

 

Here is one more upload feature (commercial as well): http://multimixer.gr/08/03/2012/fileupload-for-oscommerce/

 

Its also possible to have a special file download page in admin for any images (or other files) uploaded using option types

Share this post


Link to post
Share on other sites

Thank you for your answers!

I have another question: how to delete a file?
Deleting the file in time - is not working.
The administrative part, I set: Delete Uploads older than = -1 days, but the files are not deleted.
Have you checked the file deletion? You have it work?

Thank you!


No outside url's in signatures allowed - thanks

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

×