Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Option Types v2


Zappo

Recommended Posts

I installed a clean osCommerce verion V2.2 RC2. I need the ability to include a text field attribute for some of y products so I wanted to install this contribution. I ran the SQL and then moved all of the files as instructed. When I attempt to view my admin page, I get:

 

Warning: require(includes/classes/navigation_history.php) [function.require]: failed to open stream: No such file or directory in /home/host/public_html/store/admin/includes/application_top.php on line 128

 

Warning: require(includes/classes/navigation_history.php) [function.require]: failed to open stream: No such file or directory in /home/host/public_html/store/admin/includes/application_top.php on line 128

 

Fatal error: require() [function.require]: Failed opening required 'includes/classes/navigation_history.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/host/public_html/store/admin/includes/application_top.php on line 128

Link to comment
Share on other sites

I installed a clean osCommerce verion V2.2 RC2.

 

Warning: require(includes/classes/navigation_history.php) [function.require]: failed to open stream: No such file or directory in /home/host/public_html/store/admin/includes/application_top.php on line 128

Don't know what you've done, but somehow you have placed the file /catalog/includes/application_top.php in the directory /catalog/admin/includes/application_top.php....

I advise you totally re-install, and make sure you place the files in the correct folders!!!

You could also re-copy all files, except the install folder and the configure.php files from the clean osCommerce, and the copy the files from the Option Types v2 Contribution...

That'll save you installing osCommerce, and running the extra SQL...

Edited by Zappo

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

Link to comment
Share on other sites

Don't know what you've done, but somehow you have placed the file /catalog/includes/application_top.php in the directory /catalog/admin/includes/application_top.php....

I advise you totally re-install, and make sure you place the files in the correct folders!!!

You could also re-copy all files, except the install folder and the configure.php files from the clean osCommerce, and the copy the files from the Option Types v2 Contribution...

That'll save you installing osCommerce, and running the extra SQL...

 

I re-did from scratch - and yes, you are correct. I must have erred in the copying of files. Just FYI, I also got the "error" that blossompark got. I also ran the SQL as my first step. Running the SQL again at the end fixed it for me as it did for blossompark. Thanks!

Link to comment
Share on other sites

I also got the "error" that blossompark got. I also ran the SQL as my first step.

Running the SQL again at the end fixed it for me as it did for blossompark. Thanks!

Thanks for mentioning it!

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

Link to comment
Share on other sites

Can someone tell me how to remove the progress bar from under the text field? Thanks

This is a standard setting:

In Admin --> Configuration --> Option Types --> Use Progress bars?

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

Link to comment
Share on other sites

Good evening,

 

I installed the latest module in date

I modify the files one by one.

everything is going relatively well,

 

But I have a display problem in the product info page.

all options are visible checkbox correctly except:

the title of the option is not visible

one checkbox is visible.

 

I try to put the product_info.php provided but always the same

 

where the error please?

 

Thank you

 

sorry for the google translation ;)

 

If you want Zappo , i can give a url (in PM) for show an exemple of products with 2 option with 2 choise (checkbox , radio)

Edited by Cruelo
Link to comment
Share on other sites

Hi i changed a code to includes\modules\option_types.php

 

case OPTIONS_TYPE_CHECKBOX:
			if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$ProdOpt_ID])) {
				$checked = true;
			} else {
				$checked = false;
			}
			$tmp_html = tep_draw_checkbox_field('id[' . $ProdOpt_ID . ']', $products_attribs_array['options_values_id'], $checked) . '   ';
			$tmp_html .= $ProdOpt_Comment;
			$tmp_html .= $tmp_html_price; ?>
			<tr>
				<td class="main"><?php echo $ProdOpt_Name . ' :'; ?></td>
				<td class="main"><?php echo $tmp_html;  ?></td>
			</tr> <?php
break;

 

to

 

case OPTIONS_TYPE_CHECKBOX:

			$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$product_info['products_id'] . "' and pa.options_id = '" . $ProdOpt_ID . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");
			while ($products_options_array = tep_db_fetch_array($products_options_query)) {
				if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$ProdOpt_ID]) && ($products_options_array['products_options_values_id'] == $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$ProdOpt_ID])) {
					$checked = false;
				} else {
					$checked = false;
				}
			$tmp_html .= '<tr><td class="main">';
			$tmp_html = tep_draw_checkbox_field('id[' . $ProdOpt_ID . ']', $products_options_array['products_options_values_id'], $checked);
			$tmp_html .= $products_options_array['products_options_values_name'];
			if ($products_options_array['options_values_price'] != '0') {
					$tmp_html .= ' (' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
				}

			}
			?>
			<tr>
				<td class="main"><?php echo $ProdOpt_Name . ' :<br><small>' . $ProdOpt_Comment . '</small>'; ?></td>
				<td class="main"><?php echo $tmp_html;  ?></td>
			</tr> <?php
break;

 

Now show the name of choice but only one (the last choice only)

Link to comment
Share on other sites

one checkbox is visible.

Hi there,

I actually designed the checkboxes to be a one-choice option (Example: you want giftwrapping? Yes/No)

As you can only select ONLY ONE Attribute per Option, Multiple checkboxes will not work!

(Color: Red, Blue, Green or Yellow ---> You CAN NOT select Red AND Green, just 1 at a time...)

I recommend you use Radio's instead....

Edited by Zappo

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

Link to comment
Share on other sites

Hi , i don't choose radio because it's for add many choice of option (ingredients for pizza)

 

base marguerita with tomatoes and cheese. custommers can add :

chicken +.50€

merguez +.50€

mozzarella +.50€

potatoes +.50€

 

one checkbox for one choice

 

option type feature in 2004 for creload 6.2 work correctly (i can show you my first website )

 

how modify script for see many checkbox

 

my code

case OPTIONS_TYPE_CHECKBOX:

			$products_options = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$product_info['products_id'] . "' and pa.options_id = '" . $ProdOpt_ID . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");
			while ($products_options_value = tep_db_fetch_array($products_options)) {
			$tmp_html = tep_draw_checkbox_field('id[' . $ProdOpt_ID . ']', $products_options_value['products_options_values_id']);
			$tmp_html .= $products_options_value['products_options_values_name'];
			if ($products_options_value['options_values_price'] != '0') {
					$tmp_html .= ' (' . $products_options_value['price_prefix'] . $currencies->display_price($products_options_value['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
				}
			}
			?>
			<tr>
				<td class="main"><?php echo $ProdOpt_Name . ' :<br><small>' . $ProdOpt_Comment . '</small>'; ?></td>
				<td class="main"><?php echo $tmp_html;  ?></td>
			</tr> <?php
break;

 

work correcty : show name of choice , comment and price , all add in shopping cart no problem but i see only the last choice

 

Thanks for read

Link to comment
Share on other sites

Hi , i don't choose radio because it's for add many choice of option (ingredients for pizza)

I'll say it again:

YOU CAN NOT ADD MORE ATTRIBUTES OF THE SAME OPTION AT THE SAME TIME!!!!

 

What you want, is only possible by making a lot of OPTIONS to each product:

Pepperoni --> yes/no

Cheese --> yes/no

Mushrooms --> yes/no

 

YOU CAN NOT do this: (if you want customers to be able to select multiple options...)

Toppings --> Pepperoni/Cheese/Mushrooms

 

That's just the way osCommerce works!!!

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

Link to comment
Share on other sites

ok it's not "CAN NOT"

but

It' s "you won't"

its nor truth !!

Ok.

Be an ignorant ass...

I'm not just typing stuff here to annoy you, and waste my precious time... :angry:

 

As you know so much better how this stuff works, I'll let you figure it out by yourself....

 

Geez... That's the thanks I get for my efforts... Being called a liar...

If I don't WANT to help you, I wouldn't reply, or I would just say so!

Edited by Zappo

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

Link to comment
Share on other sites

Ok sorry but i think that a new version will be better of the previous versions (2004).

 

You are a very good work for this contribution .

 

I will use it with :

 

Pepperoni --> yes/no

Cheese --> yes/no

Mushrooms --> yes/no

 

you have said "its not possible , That's just the way osCommerce works!!! " ggrrr

Link to comment
Share on other sites

Hey, I tired to install this twice

 

The problem I'm having is

when I add a new product I dont see products attributes opions under the price

but when I edit a product, it appears? can anyone tell me what I maybe doing wrong that's it's not showing up on the new product page?

 

thanks

Link to comment
Share on other sites

when I add a new product I dont see products attributes opions under the price

but when I edit a product, it appears? can anyone tell me what I maybe doing wrong that's it's not showing up on the new product page?

That's normal behaviour!

When you add a product (is not yet in Database) there's no product ID to link the attributes to!

When the product is saved (and a Product ID is available) the attributes can be added.

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

Link to comment
Share on other sites

That's normal behaviour!

When you add a product (is not yet in Database) there's no product ID to link the attributes to!

When the product is saved (and a Product ID is available) the attributes can be added.

 

Oh I see what you mean...

very cool, thanks for taking the time to make to contribution!~

Link to comment
Share on other sites

Sorry for the PM but I have a question

I looked at http://shop.crystalcopy.nl/heart-shape-6x6x3-p-682.html

And noticed you have drop down menu, and when selected, for example Arial, the image appears on the button of the drop down? how would I set this up on the contribute section to work with Option Type 2?

I've had that question PM'ed to me 3 times now!!!

I'll post this reply on the support forum too, so everybody knows...

 

That function is not included in Option Types v2, because it's horribly nasty, dirty and totally unconfigurable hard-coded into the site. It uses Javascript to switch the images, and I think I'll be adding it to the contribution soon, but at the moment....

It's just nasty...

 

I'll look into adding and releasing the first (probably basic) image switching functionality this week.

(Already have some ideas in mind ;) )

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

Link to comment
Share on other sites

I'll look into adding and releasing the first (probably basic) image switching functionality this week.

(Already have some ideas in mind ;) )

As promised....

 

I just released "Option Types v2.1.0"!!!

The download includes the full installation, and a guide for people who want to upgrade an already installed Option Types v2.

 

Setting the correct image names, and linking them to the Options is somewhat "hands on", but I think I described it pretty well in the ReadMe (included in the download)

 

* You have the ability to set the Images directory (for separating the Option Images from the rest (if you want to ;) ))

* You can also set the Images Prefix (also to see some separation between the Option Images and the other images)

* The images can be the same for all languages, or you can set things up to use another image for each language!

 

Have fun everyone!

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

Link to comment
Share on other sites

OOOPSSSssss!!!!

It just occurred to me, that I forgot to include the SQL Query in the installation guide for people Updating an already installed Option Types v2!!!

Here is the SQL to run:

INSERT INTO configuration VALUES ('', 'Option Type Image - Images Directory', 'OPTIONS_TYPE_IMAGEDIR', 'images/options/', 'What directory to look for Option Type Images.<br>This is where the Images should be stored.', (SELECT configuration_group_id FROM configuration_group WHERE configuration_group_title = 'Option Types'), '9', now(), now(), NULL, NULL),
							 ('', 'Option Type Image - Images Prefix', 'OPTIONS_TYPE_IMAGEPREFIX', 'Option_', 'What prefix to use when looking for Option Type Images.<br>This is what the Image\'s name should begin with.', (SELECT configuration_group_id FROM configuration_group WHERE configuration_group_title = 'Option Types'), '10', now(), now(), NULL, NULL),
							 ('', 'Option Type Image - Images Name', 'OPTIONS_TYPE_IMAGENAME', 'Name', 'What Option Value item to use as Name for the Option Type Images.<br>When set to "Name", the images should be named: "PREFIX"-"Option value name"-"LanguageID".jpg (Option_RedShirt_1.jpg)<br>When set to "ID", the images should be named: "PREFIX"-"Option value ID"-"LanguageID".jpg (Option_5_1.jpg)', (SELECT configuration_group_id FROM configuration_group WHERE configuration_group_title = 'Option Types'), '11', now(), now(), NULL, 'tep_cfg_select_option(array(\'Name\', \'ID\'),'),
							 ('', 'Option Type Image - Use Language ID', 'OPTIONS_TYPE_IMAGELANG', 'Yes', 'Use language ID in Option Type Images Names?<br>This is only needed if different images are used per Language (images with text for example).', (SELECT configuration_group_id FROM configuration_group WHERE configuration_group_title = 'Option Types'), '12', now(), now(), NULL, 'tep_cfg_select_option(array(\'Yes\', \'No\'),');

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

Link to comment
Share on other sites

OOOPSSSssss!!!!

It just occurred to me, that I forgot to include the SQL Query in the installation guide for people Updating an already installed Option Types v2!!!

That was not the only mistake I made... :blush:

That's why I immediately released Option Types v2.1.1 :lol:

Changes made: added SQL from the Post above, and the following:

 

In the file catalog/includes/modules/option_types.php FIND:

		$Image_Dropdown_ID = 'id_' . $product_info['products_id'] . '[' . $ProdOpt_ID . ']';

And REPLACE with:

		$Image_Dropdown_ID = 'id[' . $ProdOpt_ID . ']';

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

Link to comment
Share on other sites

Well so far I am loving this contribution! But I do have one problem and I wasn't sure if someone could explain why.... Now that I've installed the Option Types, my sorting order for all the items are screwed up. I had earlier installed a contrib called Attribute Sets Plus (http://addons.oscommerce.com/info/3610) but this mod rendered it useless... No problem but it seems the sorting orders I entered through that aren't sticking now with this new contribution.

 

However, when I go back into product_attributes.php in the admin panel, I cannot change the sorting orders for the Product Attributes.

 

So I tried to delete all the attributes and use the AJAX Manager but it doesnt' sort the attributes in the order that I add them.... In fact I can't even see a pattern for how it sorts it.

 

Any suggestions? I want a certain option's attribute to show up first as the "default" but can't seem to get it. Another strange thing is, not all of them have changed.

 

Thanks!

Link to comment
Share on other sites

Now that I've installed the Option Types, my sorting order for all the items are screwed up.

So I tried to delete all the attributes and use the AJAX Manager but it doesnt' sort the attributes in the order that I add them.... In fact I can't even see a pattern for how it sorts it.

This contribution uses it's own sorting method.

Sorting can be set through the Options (so not on a 'per-product' basis), in the products_attributes page.

So you can, for example, set the Text fields to always show on top, and the Text Area always on the bottom.

This way you can keep a catalog-wide, consistent order of showing options.

 

I can imagine, if merged with another contribution which sorts the Options, some unexpected results can occur...

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

Link to comment
Share on other sites

This contribution uses it's own sorting method.

Sorting can be set through the Options (so not on a 'per-product' basis), in the products_attributes page.

So you can, for example, set the Text fields to always show on top, and the Text Area always on the bottom.

This way you can keep a catalog-wide, consistent order of showing options.

 

I can imagine, if merged with another contribution which sorts the Options, some unexpected results can occur...

 

Thanks! Yeah it's probably somewhere conflicting. It's just strange that it varies between products what order each option's attributes are displayed in.

 

For example on one product option1's attributes are listed like this:

attribute1

attribute2

attribute3

 

Then on another one option1's attributes might be listed like:

attribute2

attribute1

attribute3

 

You'd think that the sort_order would be "universal" product to product...

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