Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Option Types v2


Zappo

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
Link to comment
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?

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

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

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

Link to comment
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?

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

Link to comment
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?

Link to comment
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/

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

Link to comment
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
Link to comment
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)

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

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

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

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