Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Option Types v2


Zappo

Recommended Posts

OK I went through and compared the code to both and most of it sat in between the current code nicely, there was just one part with similar coding that I'm not sure how to approach.

 

In your code it has this....

 

             <td class="main"><?php echo $ProdOpt_Name . ':'; ?></td>
             <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $ProdOpt_ID . ']', $products_options_array, $selected_attribute) . '   ' . $ProdOpt_Comment;  ?></td>
           </tr><?php
  } // End if Default=true
//EOF - Zappo - Option Types v2 - Add extra Option Values to Query && Placed Options in new file: option_types.php

 

In the Plugin Code for removing the zero price it has this...

 

             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
           </tr>
<?php

 

And I'm not sure which parts I can add in or take out and still have both contributions working correctly?

Edited by thewebagency
Link to comment
Share on other sites

p.s I tried leaving those lines of code alone in the file and I managed to get the File uploader to show correctly though I dont know if it works as of yet, however the prices are still showing as (+0) on the dropdowns for the price attributes.

Link to comment
Share on other sites

No idea, but as it seems to involve products attributes, it'll probably have to be merged in some files.

 

 

Just to give a heads up. I tried to make an attempt at combining the Options Types v2 contribution with Easy Populate and Editor Order. I installed the NoAttribManager folder for Option Types v2. I tried testing out the ability to adjust or add options on the order.php (Editor Order page) in the admin. But whenever I tried to add a product from the Editor Order page, it didnt add the product to the order and there are "0"'s attached to every product item name when trying to add products to the current product order.

 

kenz

Edited by kenz
Link to comment
Share on other sites

First, I would like to thank you for this contribution, it is exactly what I needed for my site. Now I have it installed and working, there are just a few things I'm not clear on. Is there a way to configure the text box entry to add a price, say, by the letter? I wonder if this is possible to set as an option/value price, I couldn't figure out how to implement such a thing.

 

Thanks for your gracious work!

Link to comment
Share on other sites

Is there a way to configure the text box entry to add a price, say, by the letter?

That's currently not possible....

As the Prices for Attributes are set per Product/Option combination, it's also not very easy to implement...

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

Link to comment
Share on other sites

however the prices are still showing as (+0) on the dropdowns for the price attributes.

The code you posted is not where the problem is...

I have no idea what that "Hiding the Price" contribution does, but if the price is '0', it's automatically hidden by OptionTypes v2...

The contribution probably changes the way 'options_values_price' is handled or something...

 

You'll have to look at the lines in product_info.php and includes/modules/option_types.php where the prices are collected:

if ($products_options['options_values_price'] != '0')

AND

if ($products_attribs_array['options_values_price'] != '0')

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

Link to comment
Share on other sites

The code you posted is not where the problem is...

I have no idea what that "Hiding the Price" contribution does, but if the price is '0', it's automatically hidden by OptionTypes v2...

The contribution probably changes the way 'options_values_price' is handled or something...

 

You'll have to look at the lines in product_info.php and includes/modules/option_types.php where the prices are collected:

if ($products_options['options_values_price'] != '0')

AND

if ($products_attribs_array['options_values_price'] != '0')

 

OK Well I rebuilt the shop from scratch and installed STS along with option types v2 and left out the hide price contribution, all is working well now after a bit of light editing on one file, only now I have the prices showing again as £0.00! How do I set up option types v2 to hide this because like you said it doesnt appear to hide it automatically at all?

 

Thanks in advance.

Edited by thewebagency
Link to comment
Share on other sites

only now I have the prices showing again as £0.00! How do I set up option types v2 to hide this because as you say it doesnt appear to hide it automatically?

The lines I previously posted normally make sure the price is hidden: (IF 'options_values_price' IS NOT '0' --> Display price)

Something seems to be going wrong there...

As I do not know what changes are made by STS, I can't exactly say what the problem is...

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

Link to comment
Share on other sites

There where no other changes or overwritten files between STS and option types v2. The only thing I had to do was to add a few lines to the bottom of application_top.php to make STS work properly, code below.

 

// add the products model to the breadcrumb trail
 if (isset($HTTP_GET_VARS['products_id'])) {
   $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   if (tep_db_num_rows($model_query)) {
     $model = tep_db_fetch_array($model_query);
     $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
   }
 }

//BOF - Zappo - Option Types v2 - ONE LINE - message stack moved up from here...
 // START STS 4.5.8
 require (DIR_WS_CLASSES.'sts.php');
 $sts= new sts();
 $sts->start_capture();
 // END STS 4.5.8

Link to comment
Share on other sites

The only thing I had to do was to add a few lines to the bottom of application_top.php to make STS work properly, code below.

That doesn't help much. The following line:

require (DIR_WS_CLASSES.'sts.php');

means the file sts.php gets processed at that point... What that file actually does is the question...

 

This looks more like a problem with STS than with Option Types v2.

I suggest you look for help there, as Option Types v2 uses STANDARD osCommerce behavior when it comes to Attribute's prices...

Seems to me, STS is the "conflicting" contribution here...

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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)?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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')

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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,

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 ;)

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 :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)

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

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