Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Option Type Feature v1.6 (for osc 2.2 MS2)


Guest

Recommended Posts

I have installed OTF3.0 and have experienced this problem when using the text attribute:

 

Our store offers a gift certificate to be purchased and the buyer can input the recipient's name in the text box. It works fine unless they go back through the catalog and purchase the same item with the same text attribute. Rather than showing that the recipient's name(Worrom) was entered twice it displays on the checkout_confirmation, and everywhere else as;

 

$100 Gift Certificate

- Recipient Worrom

- Recipient

 

Is there a way to show the value again or even restrict the buyer from entering the same text twice?

Link to comment
Share on other sites

  • Replies 799
  • Created
  • Last Reply

Top Posters In This Topic

Hi all...

 

Dont know if anyone else has come across this but i have just found an issue when using paypal and this contrib..

 

When using cheque or money order all is fine but when selecting paypal as the payment option the values entered into text fields wont be saved..

 

So basically if a user enters text values into the product options and uses cheque/money order the text values they enter will show in admin..

and if the use paypal or paypal ipn then the values wont make it into mysql hence not showing in admin..

 

I will have a scan through the code..

 

Anyone else having probs with this..

 

thanks

Link to comment
Share on other sites

  • 2 weeks later...

Hi all - installed v. 3.0 and a couple of the "fixes" posted on the contrib page...

 

My problem is that whenever I add a product with a text option, and then I add another of the same product (with different text in the option), instead of adding a wholly separate item to the cart (as it might if the option were a drop-down list), it overwrites the text of the first product and adds one to the quantity.

 

My goal is to have it add the same product with different text entries as two wholly separate products (and not to aggregate the entered text either). I've tried adding a bogus hidden attribute to "force" it to be a separate product but that and even adding a legitimate select box only overwrites the first product (something to do with the way the option values are stored?)

 

Is there something I've missed perhaps, or does anyone know a way to work around this, ahem, feature?

** Please do not PM with personal support requests (even if offering "payment"). Thank you.

Link to comment
Share on other sites

  • 2 weeks later...

FIX FOR: Attributes being mixed up after create account or logout.

 

If you have a lot of attributes for a product, you will want to add this fix, so the attributes continue to stay in order after your customers create an account, or after they logout and then log back in.

 

I had a hard time finding an answer to this fix and had to go back to posts from 2004.

 

See the following posts for this fix or follow the instructions below:

http://www.oscommerce.com/forums/index.php?s=&...st&p=275529

http://www.oscommerce.com/forums/index.php?s=&...st&p=275539

http://www.oscommerce.com/forums/index.php?s=&...st&p=275586

 

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

 

INSTRUCTIONS:

 

Credit for this fix goes to matt (iiinetworks in the forum)

 

FILE: includes/classes/order.php

 

Find the following:

 

if ($products[$i]['attributes']) {

$subindex = 0;

reset($products[$i]['attributes']);

while (list($option, $value) = each($products[$i]['attributes'])) {

 

Replace with:

 

if ($products[$i]['attributes']) {

$subindex = 0;

ksort($products[$i]['attributes']);

reset($products[$i]['attributes']);

while (list($option, $value) = each($products[$i]['attributes'])) {

 

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

 

FILE: includes/classes/shopping_cart.php

 

Find the following:

 

if (isset($this->contents[$products_id]['attributes'])) {

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

 

Replace with:

 

if (isset($this->contents[$products_id]['attributes'])) {

ksort($this->contents[$products_id]['attributes']);

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

 

Find the following:

 

$attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");

 

Replace with:

 

$attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "' order by products_options_id");

 

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

 

NOTE: It is not clear whether all these changes are required or just one or two of them. I personally did all of them and works great on my new install.

Link to comment
Share on other sites

  • 2 weeks later...
Hi all...

 

Dont know if anyone else has come across this but i have just found an issue when using paypal and this contrib..

 

When using cheque or money order all is fine but when selecting paypal as the payment option the values entered into text fields wont be saved..

 

So basically if a user enters text values into the product options and uses cheque/money order the text values they enter will show in admin..

and if the use paypal or paypal ipn then the values wont make it into mysql hence not showing in admin..

 

I will have a scan through the code..

 

Anyone else having probs with this..

 

thanks

 

I'm having the same problem, did you find a fix for this - in the admin area it just shows the name of the text box i.e. text? thanks

Link to comment
Share on other sites

I am having problem with the Text area and special characters. Anyone have the same problem? Try for example to add a quote sign " or &.

 

Is this a know problem or is there already a fix for it? Could not find any fix.

 

1. When adding an attribute " it gives me "

2. When clicking on a product in the shoppingcart that contains special caracters it is supposed to direct me to the product with all the attributes filled in, but its blank.

3. When trying to delete a product in the card that contains a special character its not possible

 

Anyone expeirenced the same problem?

 

Br,

T.

Edited by tomislav_
Link to comment
Share on other sites

I am having problem with the Text area and special characters. Anyone have the same problem? Try for example to add a quote sign " or &.

 

Is this a know problem or is there already a fix for it? Could not find any fix.

 

1. When adding an attribute " it gives me "

2. When clicking on a product in the shoppingcart that contains special caracters it is supposed to direct me to the product with all the attributes filled in, but its blank.

3. When trying to delete a product in the card that contains a special character its not possible

 

Anyone expeirenced the same problem?

 

Br,

T.

 

 

Some fixes (i think):

 

1. special characters in text like & or "

 

add addslashes(html_entity_decode(...)) in shopping_cart.php

 

$products_name .= '<tr><td height="20" style="text-align:center;vertical-align:middle;"><small><i> - ' . addslashes(html_entity_decode($products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] )). '</i></small>';

 

2. link on product in cart

When someone has created a product with text that includes special characters such as +, & etc when clicking on the product in the card all the attributes are lost. The fix that helped me in shopping_cart.php:

 

add urlencode() to the string

 

 

<em><font size="2" color="9DB604"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . urlencode($products[$i]['id'])) . '">' . $products[$i]['name'] . '</a></font></em></td>

</tr>

 

 

 

3. a consequenst of 1 is that you will have problems when you want to remove a product in the cart that has a special character such as & or " in the text

this will have to be fixed in classes/shoppint_cart.php

 

add:

htmlspecialchars(stripslashes(...))

 

unset($this->contents[htmlspecialchars(stripslashes($products_id))]);

 

if (tep_session_is_registered('customer_id')) {

tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input(htmlspecialchars(stripslashes($products_id))) . "'");

tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input(htmlspecialchars(stripslashes($products_id))) . "'");

 

looks like it works for me now. need to do some more testing, if anyone else has the same problem and this fix worked...let me know...

 

this could be my very first fix/contribution :)

 

//t.

Edited by tomislav_
Link to comment
Share on other sites

  • 4 weeks later...

I had the same problem that Brock did on this forum. Once I added text features, the normal "radio" or "select" features would not show up in the shopping cart, yet showed up in the order and even in the packing slip,etc. Also, I would lose attributes when I logged in. I tried simon's fix and it did not seem to help me (Sorry simon - sounds like you grinded through this!). This is what worked - thank goodness I am lazy and it's really easy:

 

First, some background.

I am running oscommerce RC2a.

Also, I have manually installed V3.0 of Option Type Feature. I also installed the June 22, 2008 contrib fix to \classes\shopping_cart.php, and post 663 on this forum from dracono about application_top.php fix- the '+++', I also have the famous line 87 uncommented in \catalog\shopping_cart.php, but this doesn't seem to matter either way.

 

Simple fix to keep all attributes showing up

In \catalog\shopping_cart.php -

 

Find:

 

else {

 

$attr_value = $attributes_values['products_options_values_name'] .

tep_draw_hidden_field('id[' . $products[$i]['id'] . '+++' .

$i. '][' . $option . ']', $value);

$attr_name = $attributes_values['products_options_name'];

}

 

Replace with:

 

else {

 

$attributes_values = tep_db_fetch_array($attributes); // Add this line and it solved the attribute carry over problem.

$attr_value = $attributes_values['products_options_values_name'] .

tep_draw_hidden_field('id[' . $products[$i]['id'] . '+++' .

$i. '][' . $option . ']', $value);

$attr_name = $attributes_values['products_options_name'];

}

 

 

To solve the logon/cart carryover problem I used desrog/rory's post below - It worked for me!

 

FIX FOR: Attributes being mixed up after create account or logout.

 

If you have a lot of attributes for a product, you will want to add this fix, so the attributes continue to stay in order after your customers create an account, or after they logout and then log back in.

 

I had a hard time finding an answer to this fix and had to go back to posts from 2004.

 

See the following posts for this fix or follow the instructions below:

http://www.oscommerce.com/forums/index.php?s=&...st&p=275529

http://www.oscommerce.com/forums/index.php?s=&...st&p=275539

http://www.oscommerce.com/forums/index.php?s=&...st&p=275586

 

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

 

INSTRUCTIONS:

 

Credit for this fix goes to matt (iiinetworks in the forum)

 

FILE: includes/classes/order.php

 

Find the following:

 

if ($products[$i]['attributes']) {

$subindex = 0;

reset($products[$i]['attributes']);

while (list($option, $value) = each($products[$i]['attributes'])) {

 

Replace with:

 

if ($products[$i]['attributes']) {

$subindex = 0;

ksort($products[$i]['attributes']);

reset($products[$i]['attributes']);

while (list($option, $value) = each($products[$i]['attributes'])) {

 

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

 

FILE: includes/classes/shopping_cart.php

 

Find the following:

 

if (isset($this->contents[$products_id]['attributes'])) {

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

 

Replace with:

 

if (isset($this->contents[$products_id]['attributes'])) {

ksort($this->contents[$products_id]['attributes']);

reset($this->contents[$products_id]['attributes']);

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {

 

Find the following:

 

$attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");

 

Replace with:

 

$attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "' order by products_options_id");

 

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

 

I can honestly say this works and I have tested it fairly thoroughly using "COD" upon checkout. I also have many other mods installed and it all works seemlessly. Hope this helps everyone!

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

If it can help someone :

 

When admin is not under the same path, you have to specify full path to access includes's catalog path !

 

Modify /admin/products_attribute.php

 

require('includes/application_top.php');

 

// BOF : TYPE ATTRIBUTES

require(DIR_FS_CATALOG.'includes/local/configure.php');

// EOF : TYPE ATTRIBUTES

 

By !

Link to comment
Share on other sites

  • 4 weeks later...
Anybody have any luck integrating this with Ajax Attribute Manager?

 

 

I was looking into this myself but I don't know if they are compatible as managing attributes right now is a huge pain. Has anyone been able to successfully use these two contributions together?

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

  • 2 weeks later...

Does anyone else experience this problem:

 

If you add two or more of the same product to the shopping cart only the attributes of one of the products show up.

 

The attributes for the other products don't appear in the cart.. Please help!!

Link to comment
Share on other sites

  • 2 weeks later...
Hi!

 

Everything works fine, but when I submit the order the checkout_process.php return with an empty page.

 

What could be the cause? My server has php5 &mysql5.

 

Did you make sure that page was working prior to installing this contrib? If so, you messed up something on the checkout_process.php page, go back through the code...

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

  • 2 weeks later...

Hi..this is my first post and I am a newbie with OsCommerce so please be patient!

 

I installed this contribution so I could use the text boxes for personalization on my products. I had tested the site before adding ths changes for this contribution andeverything was working well. After I made the changes with the latest fixes I am having a issue with my session getting mixed up. When I add a product to my cart and it makes me login, after I log in it tells me my cart is empty. I will add the product again to my cart and try to check out and it thinks I am not logged in. A variety of session IDs are showing up in the URL.

 

Like I said, I had the whole checkout/login process working fine before adding this contribution. Does anyone know what I should try?

 

Please help!

Jessica

Link to comment
Share on other sites

Hello all,

 

I have OTF 1.6 installed on two sites operating on the same VPS.

 

Within the past week I have lost attributes being passed to the cart when a single product is added:

 

ex: Not Working Page

 

While on a page that contains multiple products being added the attributes come through fine??

 

ex: Working Page

 

Nothing has changed on the pages affected within the given time period.

 

Another note, I have an identical copy of this site that we use for developmental testing which has also been affected by these problems at the same time??

 

Could this be a server setting preventing this from working, if so what?

 

TIA

dubz

Link to comment
Share on other sites

OK well a little troubleshooting later and I have found when adding multiple products only the attributes for the first product do not come through correctly. So I am thinking it has something to do with the for loop in the shopping_cart.php file.

 

I can post the code if anyone out there thinks they can help.

 

Dubz

Link to comment
Share on other sites

jamesmartin

 

You just need to add something to the end of the query that will sort by the attribute id #, I'm not looking at the code currently but it should be fairly simple. One thing though you cannot reorder the order in which text radio etc display unless you swap there order in the code. If I remember correctly each type of attribute (text, radio, textbox, etc.) has a seperate query so you can order the options in each type but not the entire list of options if that makes sense?

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

Also since I added the radio buttons I now get truefalsefalsefalsefalse showing up above the Additional Options text. Now I'm sure this is just a missing comment or something but I'm getting balder by the hour trying to get rid of this. See image below.

Hi try searching for these two lines and delete them:

echo 'true';

echo 'false';

 

And try this for the sorting issue:

http://addons.oscommerce.com/info/1822

Edited by n3rdyguy
Link to comment
Share on other sites

  • 2 weeks later...

Hi all..

I have the option type feature installed and its an awesome contribution..

For me it works seemless and also works well with the attribute ajax manager..

 

Anyway, i have a bit of a technical question which im hoping someone can help me with..

 

Ok, when we use a select box the options it displays are in id sort order..

Now my question is that is it possible to sort this alpabetically.

 

Now ive scanned the code on the product_info page and believe this is the query..

 

$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)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.options_values_id");

 

As you will see this is soerted by options_values_id, now ive tried changing that id to name but no joy, and to be honest the query is well over my head..

 

So if anyone can shed any light i would be most gratefull..

 

Thanks all

Link to comment
Share on other sites

sussed it..

 

so basically if anybody wants the order of the select dropdown to be alphabetical instead of by id then you will need to change

 

order by pa.options_values_id

 

to

 

order by products_options_values_name

 

from in the above message code box, that code will be on your product_info page

 

Thanks

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