Jump to content
Zappo

[Contribution] Option Types v2

Recommended Posts

Hi,

 

Maybe somebody know this , i found duplicate code in my products_attributes.php , can somebody tell me if this is correct please.

 

//BOF Option Types v2.3.1 - For TEXT and FILE option types, No need to add anything...
	// Let's Check for OptionType first...
	$optionType_query = tep_db_query("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$option_id . "' and language_id = '" . $languages_id . "'");
	$optionType = tep_db_fetch_array($optionType_query);
	switch ($optionType['products_options_type']) {
	  case OPTIONS_TYPE_TEXT:
	  case OPTIONS_TYPE_TEXTAREA:
	  case OPTIONS_TYPE_FILE:
		// Do Nothing...
	  break;
	  default:
//BOF Option Types v2.3.1 - For TEXT and FILE option types, No need to add anything...
	// Let's Check for OptionType first...
	$optionType_query = tep_db_query("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$option_id . "' and language_id = '" . $languages_id . "'");
	$optionType = tep_db_fetch_array($optionType_query);
	switch ($optionType['products_options_type']) {
	  case OPTIONS_TYPE_TEXT:
	  case OPTIONS_TYPE_TEXTAREA:
	  case OPTIONS_TYPE_FILE:
		// Do Nothing...
	  break;
	  default:

 

Gr, Rob

 

found out that if i comment one part out it breaks the code and i have some errors...

Edited by CrazyCarzCustoms

Share this post


Link to post
Share on other sites

found out that if i comment one part out it breaks the code and i have some errors...

 

I would say it's a copy/paste error.

With that code you are loading and checking twice the option type. To be more precise you do the second check only if the typeis NOT text, textarea or file. I would say unuseless.

Here my code (but I have issues with products_attribute and I'm using the AJAX add-on).

 

 

//BOF Option Types v2.3.1 - For TEXT and FILE option types, No need to add anything...

// Let's Check for OptionType first...

$optionType_query = tep_db_query("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$option_id . "' and language_id = '" . $languages_id . "'");

$optionType = tep_db_fetch_array($optionType_query);

switch ($optionType['products_options_type']) {

case OPTIONS_TYPE_TEXT:

case OPTIONS_TYPE_TEXTAREA:

case OPTIONS_TYPE_FILE:

// Do Nothing...

break;

default:

//EOF Option Types v2.3.1

 

What error do you have if you remove one part? Is it a } missing?

Share this post


Link to post
Share on other sites

SOLVED IT!

 

It was in fact a security trigger caused from the contribution "Security Pro".

 

I disabled it for now.. and it is working, so now I have to look at a way to exclude the files from this contribution.

 

I have the same problem, but I didn't install that contribution as far as I know. I'm using OSC 2.3.1, is it included there by default?

Anyway how did you remove it?

Many thanks

Share this post


Link to post
Share on other sites

Hi Davide ,

 

I think i found something thats not good, after the previous double bit that i had i found i had another double bit in there.

So i removed that too and that made a lot of the errors go away.

I am now stuck with a problem " ?> " at the last line.

 

BUT i have also found a lot more double bits of code , so i asume that they will going to give me problems further down the road.

I think that the best thing i can do now is try to take all double things out and see what happens or just try to build the file again , although i have no idea were all the double stuff comes from but i must have done something wrong.

 

Gr, Rob

 

Hi Davide,

 

Thanks for helping me!

 

The error that i get is :

Parse error: syntax error, unexpected T_CASE in /home/misascom/public_html/xxxxxxxxx/products_attributes.php on line 86

 

Wich , according to Dreamweaver , has to do with this little bit of code.

case 'add_product_attributes':

 

 

But this bit of code is highlited about 8 times and always it´s with the "case" in front but different things after that , like:

 

case 'update_option_name':[/b]
[b]case 'update_value':[/b]
[b]case 'update_product_attribute':[/b]
[b]case 'delete_option':[/b]
[b]case 'delete_value':[/b]
[b]case 'delete_attribute':[/b]
[b]and a " } " that is left.
Edited by CrazyCarzCustoms

Share this post


Link to post
Share on other sites

Hi,

 

Just reverted to the drop-on-top file from the options-type contribution , at least it should be correct now ;-)

 

Now i just need to find why it´s not talking anymore to the database!!!

 

Rob

Share this post


Link to post
Share on other sites

It seems that DreamWeaver is adding stuff to your file, try with a normal text editor (ultraedit? or something like that)

Share this post


Link to post
Share on other sites

Hahahahaa , well , to be honnest i think it´s more my unexperience with this stuf that makes strange things happen , but i am getting the hang of it!!!!

Share this post


Link to post
Share on other sites

hi , somebody can tell me the URL that download the intall.txt for Option Types. I'm not find in the packge. thank you very much!! :mellow:

 

in the package should be 2 html files that explain the installation , if not in there you might want to download : http://addons.oscommerce.com/info/6818 and choose the one with install text

Share this post


Link to post
Share on other sites

Hi,

 

Please could someone help with an error I have? I have just installed this add-on and receive this message on the product_info page.

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/wwwmysite/public_html/includes/functions/database.php on line 103

 

Any help would be greatly appreciated.

Kerry

Share this post


Link to post
Share on other sites

in the package should be 2 html files that explain the installation , if not in there you might want to download : http://addons.oscommerce.com/info/6818 and choose the one with install text

 

Think you very much, But this URL can't download this file. then mywebsite have installed template before . now i want intalled this add-on , I receive error mesaage on the index page

Fatal error: Call to undefined function tep_get_sub_categories() in C:\APMServ5.2.6\www\htdocs\29test\includes\modules\product_specials.php on line 27

 

can you help me ? greatly appreciated! have easy way to installed this add-one?

Share this post


Link to post
Share on other sites

@@fuchuangxin

 

this error has nothing to do with the option types addon. It comes from a module (product_specials.php) that is not standard osCommerce, possibly an addon or part of the template you have.

 

However, it is looking to find a function (tep_get_sub_categories()) that is missing from your installation. I suggest you to seek help for this error either at the addon topic or the template seller, or open a new topic in the forum

Share this post


Link to post
Share on other sites

I've dropped in the files from Option Types 2.3.1 into stock osC 2.3.1, uploaded and installed. I then ran "OptionTypes v2 SQL.sql" in phpmyadmin.

 

As far as I know, this should complete the installation but I'm getting a php error when I click "Add to cart" from a product page.

 

Warning: opendir(images/temp/) [function.opendir]: failed to open dir: No such file or directory in [...]/public_html/catalog/includes/application_top.php on line 346

Could not open images/temp/

 

Have I left out some step of the Option Types install?

Share this post


Link to post
Share on other sites

@@adam71o Did you create a folder named /temp/ within the /images/ folder? If yes, what are the folder permissions?

 

You'll also need to create the folders /images/uploades/ and /images/options/

Share this post


Link to post
Share on other sites

@@hazard1988

 

For sure what you did was more than a "quick download and upload", the site would not work on the new server just like this.

 

List your steps one by one, somewhere in there is the mistake you did

Share this post


Link to post
Share on other sites

@@multimixer

 

Adding a temp directory fixed my immediate issue. Where did you find this information? I did not find instructions on creating extra folders in the install.txt included in optiontypes231.zip.

 

It sounds like I have not completed installation yet. Where can one find full install instructions?

 

Thanks a lot for your input.

Edited by adam71o

Share this post


Link to post
Share on other sites

Where did you find this information? I did not find instructions on creating extra folders in the install.txt included in optiontypes231.zip.

 

I have no idea how the instructions look like an what is included in the package

 

I can just repeat the suggestion to use the "old" original upload by zappo as a reference and for comparison purposes (in particular for file includes/classes/hopping_cart.php, several users had problems with that file before)

Share this post


Link to post
Share on other sites

Hi,

 

I have a problem with a combination with contribution Ultimate HTML E-mails.

When customer recieves e-mail with order confirmation TEXT or TEXT AREA attributes are not listed; there is only CUSTOMER-INPUT text (see picture).

 

Maybe I should somehow change checkout_process file from Ultimate HTML E-mails contribution - I attached it (The path is \includes\modules\UHtmlEmails\Green\checkout_process.php).

 

I would appreciate if someone can solve this for me.

 

Andrej

checkout_process.php

post-310084-0-69512800-1348489348_thumb.jpg

Share this post


Link to post
Share on other sites

You need to apply the same modifications done to catalog/checkout+process.php to the files of the email addon you use

 

Thanks a lot George, I applied only one modification of two, and now it works.

 

In case that somebody else will use both Option Types and Ultimate HTML E-mails contributions - here's the applied change:

 

In file

 

\includes\modules\UHtmlEmails\Green\checkout_process.php

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

Find:

$HTML_Email_product_attributes[$i] .= '<br /><em style="font-size:12px;">   -'. $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] .'</em>';

 

Change with:

$HTML_Email_product_attributes[$i] .= '<br /><em style="font-size:12px;">   -'. $attributes_values['products_options_name'] . ': ' . tep_decode_specialchars($order->products[$i]['attributes'][$j]['value']) .'</em>';

 

Regards,

Andrej

Share this post


Link to post
Share on other sites

This may be of some help to others where they have no administrative control over their production MYSQL server and it is running in 'STRICT' mode...I was having a problem where I was getting a stop error in 'admin/product_attributes.php' when I tried to access 'Catalog|Product Attributes' through the admin pages.:

 

The offending code (around line 29):

tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . OPTIONS_VALUES_TEXT_ID . "', '" . (int)$languages[$i]['id'] . "', '" . TEXT_UPLOAD_NAME . "')");

 

It was solved with the following change (simply typecast the OPTIONS_VALUES_TEXT_ID value as an integer):

tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int)OPTIONS_VALUES_TEXT_ID . "', '" . (int)$languages[$i]['id'] . "', '" . TEXT_UPLOAD_NAME . "')");

 

Cheers, Blaise

Edited by Blaise

Share this post


Link to post
Share on other sites

Hello community from BORDEAUX France,

Forgive my bad english,

 

We have a website since 2005, which offers its customers a personalized items with text and pictures.

It is satisfying with MS2.2 file_upload + .7 + 1.5 + Option_Type_Feature OrderCheck_v2.5.1. and I enjoyed to improve this site.

 

The transition to php 5.3, brings a radical change by our host.

I try to update osc version 2.2 with php 5.3, but it is very heavy and errors occur with contributions.

 

I decided to start with the new config osc 2.3.1 (via the forum France) and option_type_2.3.1.

I install virgin and brings the contents of drop-on-top files

I have a problem behavior in the admin here are the images of defects that I can not be corrected, I do not understand, in addition to the 1st test, the basket does not fill these problems are already raised on beginning of this forum, but after a few corrections, it still does not

my knowledge of php are starting to experience and I'm stuck ......

what could I forget??

Thank you for your tracks and your experiences

I can provide the address of the website during test application

cordially

Samuel


site 1 ---> MS 2.3.3 + AJAX Attribute Manager + Option Types v2 + Header Tags SEO + E transaction

site 2 ---> MS 2.3.4 en cours d'essais

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

×