Jump to content



Photo
* * * * * 2 votes

[Contribution] Option Types v2


  • Please log in to reply
935 replies to this topic

#61   smailliwnosaj

smailliwnosaj
  • Members
  • 5 posts
  • Real Name:Jason Williams

Posted 14 July 2009 - 20:39

Thanks for this contribution. It does everything I need except one little detail that I can't for the life of me figure out.

MY STORY:
I tried to upgrade an existing OsCommerce store with the Option Types V2. I kept getting errors and it was rounding product prices up to whole dollar amounts in the shopping cart. I chased my tail fixing the errors for a couple of days.

I decided to install a fresh OsCommerce 2.2a, which I did. After getting the store back online, I uploaded the Option Types V2. This time, I am happy to say there are no error messages, save one little problem....

PROBLEM:
The shopping cart is still rounding product prices off to whole dollar amounts and the shopping cart is showing the Sub-Total as 0.

Has anyone else had this happen. I can't for the life of me figure out how to fix it or hack it to get me my two decimal points back.

Please..... drowning here.

#62   Zappo

Zappo
  • Members
  • 201 posts
  • Real Name:Albert van Osch
  • Gender:Male
  • Location:the Netherlands, Asten

Posted 14 July 2009 - 21:50

The shopping cart is still rounding product prices off to whole dollar amounts and the shopping cart is showing the Sub-Total as 0.

Are you sure you used a clean, standard installation of version 2.2rc2(a) ?!??
I have a separate test store running, and can't get that behavior....
Also can't imagine how it happens.
Try echo'ing the price like this:
FIND in product_info.php:
if ($products_options['options_values_price'] != '0') {
AND ADD BEFORE THAT:
echo "Testing Option Price = ".$products_options['options_values_price']."<br>";

And check if the prices are requested correctly...

(*Maybe you could also try it with the newly released version?)

Edited by Zappo, 14 July 2009 - 22:05.

Check out my website! shop.crystalcopy.nl


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

#63   Zappo

Zappo
  • Members
  • 201 posts
  • Real Name:Albert van Osch
  • Gender:Male
  • Location:the Netherlands, Asten

Posted 14 July 2009 - 22:02

I just released Option Types v2.0.1:
- Previous Uploads List was not correct when using Multiple Upload fields
- Couple of Bugs fixed for multiple fields
- Separated Attribute Manager from installation (Easier to just Add it if needed)
- Added Attribute Manager installation guide
- Fixed some bugs in Attribute Manager
- Prepared Attribute Manager for "Products as Options"
- Added Comments for changes made in Attribute Manager
- Found some small mistakes in the Admin Language files
- Updated (and renamed) the ReadMe

Edited by Zappo, 14 July 2009 - 22:03.

Check out my website! shop.crystalcopy.nl


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

#64   ossum

ossum
  • Members
  • 8 posts
  • Real Name:Jacob Schmid
  • Gender:Male
  • Location:Oregon, USA

Posted 15 July 2009 - 02:03

Thanks Zappo,

It appears that there is a capability for adding a font option to the product options with this contribution. Is this correct? Is there any documentation for how to utilize the template menu for the options(the dropdown menu)?

#65   smailliwnosaj

smailliwnosaj
  • Members
  • 5 posts
  • Real Name:Jason Williams

Posted 15 July 2009 - 03:15

Are you sure you used a clean, standard installation of version 2.2rc2(a) ?!??
I have a separate test store running, and can't get that behavior....
Also can't imagine how it happens.
Try echo'ing the price like this:
FIND in product_info.php:
if ($products_options['options_values_price'] != '0') {
AND ADD BEFORE THAT:
echo "Testing Option Price = ".$products_options['options_values_price']."<br>";

And check if the prices are requested correctly...

(*Maybe you could also try it with the newly released version?)


Squeaky clean install. Most current releases from today. In fact I ran a test install of it on another server before attempting to install it on my site. One server, I used the GoDaddy installer to install OsCommerce. My website server, I installed OsCommerce from a download from the OSC site. Both servers have the same result: The prices worked before the Option Types install. After the install, the product prices are rounded off to dollars in the shopping cart and in the amount posted to PayPal.

I also tried the no options managager version. Same results.

I tried your suggestion above. However, I couldn't find a page in my site that would echo the string.

Essentially, I get the same results on an older version of OsCommerce on a live site, on a brand new version of OsCommerce on my test server, and on a brand new version of OsCommerce on my live web server.

The only consistant factors in all three installs are my products database and a PayPal IPN Module. I don't think it is the PayPal module because the error takes place in the shopping cart well before the module is called. And the module consists of three non-OsCommerce files that upload clean without overwriting any existing files.

Could it be my database causing this? Maybe a setting in a config table for 0 decimal places instead of 2?

#66   Zappo

Zappo
  • Members
  • 201 posts
  • Real Name:Albert van Osch
  • Gender:Male
  • Location:the Netherlands, Asten

Posted 15 July 2009 - 20:48

It appears that there is a capability for adding a font option to the product options with this contribution. Is this correct? Is there any documentation for how to utilize the template menu for the options(the dropdown menu)?

No, there's no font option available.
If you are talking about the font option on shop.crystalcopy.nl, that one is hardcoded. VERY messy...
It is possible to add just about any option type (I'm working on Products at the moment) so adding fonts can certainly be done, but there are no manuals of how to do it.
The different Option Types are added in includes/modules/option_types.php (except the standard dropdown, that's (still) handled by product_info.php)
That's where new types can be added, and processed the way that's needed... (By adding a new 'case')
Check out my website! shop.crystalcopy.nl


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

#67   danta67

danta67
  • Members
  • 52 posts
  • Real Name:dan

Posted 15 July 2009 - 20:52

Hi there

try to install this great contri

but get an strange error
Fatal error: Cannot redeclare class tablebox in public_html/includes/classes/boxes.php on line 13
any idea

thanks
danta67
my mistake
solve
but now i have no images any more
i get error database

Edited by danta67, 15 July 2009 - 21:05.


#68   Zappo

Zappo
  • Members
  • 201 posts
  • Real Name:Albert van Osch
  • Gender:Male
  • Location:the Netherlands, Asten

Posted 15 July 2009 - 20:55

I don't think it is the PayPal module because the error takes place in the shopping cart well before the module is called.
Could it be my database causing this? Maybe a setting in a config table for 0 decimal places instead of 2?

It COULD be the PayPal module, as Option Types makes some minor changes to the standard PayPal module...
However... Come to think of it, that was for Text options...
It COULD be the database, exactly as you say. no decimal places.
You should check what values are inserted into the database.
When creating your database, be sure to use UTF8_general_ci Collation. That always works best for me...
Check out my website! shop.crystalcopy.nl


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

#69   Zappo

Zappo
  • Members
  • 201 posts
  • Real Name:Albert van Osch
  • Gender:Male
  • Location:the Netherlands, Asten

Posted 15 July 2009 - 21:00

Fatal error: Cannot redeclare class tablebox in public_html/includes/classes/boxes.php on line 13
any idea

You probably didn't merge application_top.php (-correctly)
the call to boxes.php should be moved up from below... (from about line 505 to about line 315)
So should the call to messagestack...
Check out my website! shop.crystalcopy.nl


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

#70   danta67

danta67
  • Members
  • 52 posts
  • Real Name:dan

Posted 15 July 2009 - 21:13

I solved the tablebox
but now i dont have any image

i get error database
any idea

#71   smailliwnosaj

smailliwnosaj
  • Members
  • 5 posts
  • Real Name:Jason Williams

Posted 16 July 2009 - 03:45

It COULD be the PayPal module, as Option Types makes some minor changes to the standard PayPal module...
However... Come to think of it, that was for Text options...
It COULD be the database, exactly as you say. no decimal places.
You should check what values are inserted into the database.
When creating your database, be sure to use UTF8_general_ci Collation. That always works best for me...


Though I am still mindboggled with the rounding off the product prices problem, you have inadvertently solved my problem #2. I was having issues with the PayPal IPN module not sending the values from my text fields to PayPal. I am assuming you ran into this problem with the default PayPal module and then corrected it.

So, now, all I have to do is find out how to make those changes to the PayPal IPN module.

Thanks for the bump,

#72   aj23

aj23
  • Members
  • 124 posts
  • Real Name:adrien

Posted 17 July 2009 - 06:35

I installed this contribution but now when I click a product, I get the error "Fatal error: Call to a member function add_current_page() on a non-object in /home/aj23/public_html/includes/application_top.php on line 312"

Does anyone know the problem and how I can fix this?

thanks

Take a look at the site, where you can clearly see many problems now.

www.genxgsm.com

Edited by aj23, 17 July 2009 - 06:46.


#73   Zappo

Zappo
  • Members
  • 201 posts
  • Real Name:Albert van Osch
  • Gender:Male
  • Location:the Netherlands, Asten

Posted 17 July 2009 - 10:57

Take a look at the site, where you can clearly see many problems now.

Yeah...
Many problems indeed, and Option Types has to do with just a tiny fraction of it...
Looks like quite a mess...
Check out my website! shop.crystalcopy.nl


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

#74   thewebagency

thewebagency
  • Members
  • 18 posts
  • Real Name:Dan
  • Gender:Male
  • Location:UK

Posted 17 July 2009 - 14:54

Simple question hopefully, I finally got things running how I want them too, the only thing I need to know now is, is there a way to have the image uploader accept other file formats such as word docs and PSD.'s?

Along with upping the upload file size limit.

Edited by thewebagency, 17 July 2009 - 14:55.


#75   Zappo

Zappo
  • Members
  • 201 posts
  • Real Name:Albert van Osch
  • Gender:Male
  • Location:the Netherlands, Asten

Posted 17 July 2009 - 15:03

Simple question hopefully, I finally got things running how I want them too, the only thing I need to know now is, is there a way to have the image uploader accept other file formats such as word docs and PSD.'s?

Along with upping the upload file size limit.

Simple question indeed /wink.gif' class='bbc_emoticon' alt=';)' />
open up includes/classes/upload.php and check out line 18.
Maybe this should be an admin setting, or at least a setting in local/configure.php...
Next release /laugh.gif' class='bbc_emoticon' alt=':lol:' />

I believe Upload file size limit is set by php.ini...
This could be override-able with a .htaccess in the root (php_value upload_max_filesize 10M)
Check out my website! shop.crystalcopy.nl


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

#76   smailliwnosaj

smailliwnosaj
  • Members
  • 5 posts
  • Real Name:Jason Williams

Posted 17 July 2009 - 15:07

Simple question hopefully, I finally got things running how I want them too, the only thing I need to know now is, is there a way to have the image uploader accept other file formats such as word docs and PSD.'s?

Along with upping the upload file size limit.


The upload file size limit is typically controlled by your web server. <2Mb is typically the default defined in your server variables. Some people have found ways around this if their server allows for a php.ini file to override their server variables. I believe you should Google UPLOAD_MAXFILESIZE . My memory could be failing here.

Suggestion on the file types question: You should be able to upload other file types with some edits to the code. You will have to write an if statement to first query the file extension. If .jpg - run the current code - if other - run a standard file upload script without the image resizing script.

Edited by smailliwnosaj, 17 July 2009 - 15:09.


#77   Zappo

Zappo
  • Members
  • 201 posts
  • Real Name:Albert van Osch
  • Gender:Male
  • Location:the Netherlands, Asten

Posted 17 July 2009 - 15:37

You will have to write an if statement to first query the file extension. If .jpg - run the current code - if other - run a standard file upload script without the image resizing script.

Good point!
Forgot about that! /blush.gif' class='bbc_emoticon' alt=':blush:' />
This only means this should REALLY be a configurable setting!

Edited by Zappo, 17 July 2009 - 15:38.

Check out my website! shop.crystalcopy.nl


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

#78   thewebagency

thewebagency
  • Members
  • 18 posts
  • Real Name:Dan
  • Gender:Male
  • Location:UK

Posted 17 July 2009 - 16:02

OK I can get the code for a standard file upload script as I built one before for a website before, but would you care to elaborate on how to write the "if" statement to run said script, as I am really bad with php syntax but slowly learning.

Edited by thewebagency, 17 July 2009 - 16:03.


#79   blossompark

blossompark
  • Members
  • 14 posts
  • Real Name:Rory O' Flynn

Posted 17 July 2009 - 17:39

Hi,
i've installed option type v2..

[img]http://www.blossompark.net/Product%20options.jpg[/img]

one problem, the option type column displays "Error" for each Option Name entry...when I click on the edit buttons in the Action colunn I get the following error
1054 - Unknown column 'products_options_comment' in 'field list'

select products_options_name, products_options_comment from products_options where products_options_id = '1' and language_id = '1'

[TEP STOP]

Any ideas on this ?
Thanks,
Rory

#80   aj23

aj23
  • Members
  • 124 posts
  • Real Name:adrien

Posted 17 July 2009 - 17:41

Yeah...
Many problems indeed, and Option Types has to do with just a tiny fraction of it...
Looks like quite a mess...


The site was working perfectly fine until I installed the contribution so it couldn't have been anything else. I followed the instructions exactly, so I have no idea how this all happened.

Does anyone know how to fix this?

Thanks

It has to do with the application_type file since that is the one giving an error on the product pages.