Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Attribute Qty Product Info


Jack_mcs

Recommended Posts

Greetings,

 

I'm currently using this contribution and I think it's great. I am having an issue, however.

 

On items that only have one attribute 'type', the checkout process makes sense. Say I have a "Beverage" item and the only attribute type is "flavour". It makes sense that if I choose 3 Raspberry and 2 Pineapple, they show up in the cart as two separate items - 3 Beverages with the attribute "Raspberry" and 2 Beverages with the attribute "Pineapple".

 

This becomes a problem when an item has multiple configurations. For example, say I have an item called "Chicken Platter". This item has three different attribute types - "Fresh Bun", "Salad", and "Side". What I'd expect is that it would add one "Chicken Platter" item to the cart with the various attributes listed below with their quantity in braces or something similar. Like this;

 

Chicken Platter

Fresh Bun - White (4)

Fresh Bun - Brown (5)

Salad - Ceasar (3)

Side - French Fries (4)

Side - Potatoe (5)

 

What actually happens, as you're probably aware, is that it ends up adding separate entries for every single attribute, like below;

 

Chicken Platter (4)

Fresh Bun - White

 

Chicken Platter (5)

Fresh Bun - Brown

 

Chicken Platter (3)

Salad - Ceasar

 

etc.

 

This also becomes a problem for pricing. In the first scenario, having "Beverage" be $3 would still make sense in the checkout process. 3 Raspberry Beverages at $3 each would be $9. That is what you'd expect. For the second scenario, however, if the "Chicken Platter" itself was $20, that would mean that each and every item in the cart would multiply that price. This could obviously be solved by making the "Chicken Platter" $0.00 and then pricing each attribute by itself, but that is far from ideal as having an item listed on the menu as $0.00 is not only misleading, but appears kind of amateur.

 

Is there any way to modify this contribution so that it groups the attributes into one item? I realize this would make editing ones order after-the-fact difficult (maybe even impossible), but compared to the alternative it's something we're willing to deal with.

 

Anyone have any ideas or suggestions? Maybe another contribution I'm unaware of would suit my needs better? Any help would be appreciated.

 

-Age

Edited by Ageman20XX
Link to comment
Share on other sites

You are using the wrong contribution. WHat is happening is exactly what is supposed to happen. Its for people who's "main product" isnt a prpduct and the attributes are the acatual products..

 

Here is a good question for you..

 

Are you selling a "Chicken Dinner" that could feed 5 people, and then letting people pick as many sides as they want?? Or are you putting together a meal and they can pick one of any category of sides??

 

So you give them

CHICKEN DINNER

 

Vegetables

GREENBEANS

PEAS

CARROTS

Bread

WHITE BREAD

WHEAT BREAD

ITALIAN BREAD

Drink

SODA

MILK

JUICE

 

Then you let them pick ONE of each main category for their dinner, and once they do that they add the entire dinner to their cart. At that point, before the customer clicks ADD TO CART, you can add a quantity field there, so they built their dinner "Chicken Dinner with peas, wheat bread, and juice" and they can add as many of THOSE dinners as they want..

 

OR are you selling a "chicken dinner" that can feed 8 people so they can make as many combinations of sides as they want?? If that were the case, you would use checkboxes, but you are still dealing with attributes, which means that there will only be one of each added per CHICKEN DINNER..

 

I THINK that you will want to look into bundled products or custom product builder, or even PC Creator.. That will let you create a MAIN product "chicken dinner" and then add sub products which are separate from the main, but they are put together to make up the main.. Then the customer can pick which ones and how many they want to build their dinner.. THAT will be the most comprehensive way to do it.. They are complicated, but it will work best for you

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

You are using the wrong contribution [...] They are complicated, but it will work best for you

 

Hey, thanks for that. The "Custom Product Builder" is actually exactly what I needed. I'm having some issues with it (that I posted in the support thread for it) but as soon as I get the issue fixed it looks like it's gonna be the perfect solution for what we need. :)

 

Thanks again,

-Age

Link to comment
Share on other sites

  • 2 weeks later...
I personally had NO issues with this addon. I was trying to help the others.. but i am glad to hear that the price of .001 works, but it would be noce for someone to rework the mod to show $0.00 attributes..although i am pretty sure its a small fix and VERY easy, personally i do not have time.. but anyone around who is willing, go for it..

 

Is this what you're trying to do:

 

mm.jpg

Link to comment
Share on other sites

Oops, I shouldn't have pressed that button...

 

Anyway, to have products with a price of $0.00 and attributes (free products with attributes), show up, do the following:

 

Open productinfo.php

 

Around line 150 find and delete:

 

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

 

Note: Do not delete the { at the end of the line.

 

 

This will automatically show products priced at $0.00 without the workaround of using a value price of 0.001

Link to comment
Share on other sites

  • 1 month later...

Hi everybody,

 

I've installed the mod and work smoothly. Thankyou!

 

But I have a similar question with Adrian; I'm a wholesale T-shirt store, so I installed the minimum order quantity mod. For my cutomer, I force them to buy a T-shirt minimum 6 nos. and may choose different color.

So, the problem is the 'Attribute Qty' break the different attribute in seperated item...

 

For Example:

 

My Store

________________________________

T-shirt (MOQ=6 nos.)

Yellow (option)

Green (option)

Red (option)

Blue (option)

 

 

 

Customer Wishes :

T-shirt (MOQ=6 nos.)

2 X Yellow

1 X Green

1 X Red

2 X Blue

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

6 nos.

 

 

##################### Attribute Qty Mod ##############################

 

T-shirt (MOQ=6 nos.)

2 X Yellow <-- Failed

 

T-shirt (MOQ=6 nos.)

1 X Green <-- Failed

 

T-shirt (MOQ=6 nos.)

1 X Red <-- Failed

 

T-shirt (MOQ=6 nos.)

2 X Blue <-- Failed

 

(ALL DOES NOT MEET THE MINIMUM REQUIREMENT)

 

###############################################################

 

 

Does anyone have any idea? or please show me the direction? I am a graphic designer and know just a very very little php code...

Hope Jack or Linsay or anyone could help!

 

Sorry for my bad english, hope the diagram may helpful...

 

 

Jason,

Link to comment
Share on other sites

I can't follow your example but if you are saying this contribution doesn't work with another, that may be the case. A number of attributes contributions are not compatible. They can be made to work together but it isn't something that can be handled in a support thread.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I can't follow your example but if you are saying this contribution doesn't work with another, that may be the case. A number of attributes contributions are not compatible. They can be made to work together but it isn't something that can be handled in a support thread.

 

Jack

 

Hi jack,

 

Thanks for your prompt reply.

This contribution are great and very useful. I just wondering if I can do some modify here...add all the attribute into their own product item intead of seperated order items.

 

For example:

Original in the shopping cart like this

 

image0.jpg

 

Jack, do you think it's possible we could modify to

 

image1.jpg

 

 

Thanks for you Jack notice my suggestion....

 

 

Jason,

Link to comment
Share on other sites

Oops, I shouldn't have pressed that button...

 

Anyway, to have products with a price of $0.00 and attributes (free products with attributes), show up, do the following:

 

Open productinfo.php

 

Around line 150 find and delete:

 

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

 

Note: Do not delete the { at the end of the line.

 

 

This will automatically show products priced at $0.00 without the workaround of using a value price of 0.001

 

To have products with a price of $0.00 and attributes (free products with attributes), show up...

that's the alternative

 

Open product_info.php

change:

 

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

 

to:

 

if ($products_options['options_values_price'] >= '0') {

Edited by ezbiker
Link to comment
Share on other sites

Hey Jack,

 

I got an idea...

 

Open application_top.php

 

Change:

			            $c = array((int)$HTTP_POST_VARS['b'][$x] => (int)$value);		

		            if (is_array($HTTP_POST_VARS['quantity'])){
		              $qty = (int)$HTTP_POST_VARS['quantity'][$x];			       
			        $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], ($c)))+($qty),($c));

 

To:

 

			         // $c = array((int)$HTTP_POST_VARS['b'][$x] => (int)$value);		

		            if (is_array($HTTP_POST_VARS['quantity'])){
		              $qty = (int)$HTTP_POST_VARS['quantity'][$x];			       
			        $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['products_id']))+($qty), $HTTP_POST_VARS['products_id']);

 

It can join all the attribute quantity to one order item quantity and has price total. But the attribute doesn't shown...I think it should be do something on the product_info.php.

What do you think, Jack?

 

Jason,

Link to comment
Share on other sites

Hi jack,

 

Thanks for your prompt reply.

This contribution are great and very useful. I just wondering if I can do some modify here...add all the attribute into their own product item intead of seperated order items.

 

For example:

Original in the shopping cart like this

 

 

Jack, do you think it's possible we could modify to

 

 

Thanks for you Jack notice my suggestion....

 

Jason,

That's not what this contribution is for. You are looking to change the quantity on the shopping cart page. There is a different contribution for that. I don't recall the name though. Maybe something like "Add quantity box."

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

That's not what this contribution is for. You are looking to change the quantity on the shopping cart page. There is a different contribution for that. I don't recall the name though. Maybe something like "Add quantity box."

 

Jack

 

Thanks Jack..I'll search for it

 

Jason,

Link to comment
Share on other sites

  • 2 weeks later...

Hello Jack,

 

I was wondering if there is any ways to make a dropdown instead of quantity case where u need to manually type quantity

 

where this dropdown would only show the max quantity available for an attribute or another. (alright i've a mod for attribute quantity installed)

 

ie:

 

i got 10 in stock for attribut 1....dropdown show up to 10 max

 

got 5 for attribut 2....dropdown show 5 max and so on..

 

even if i got a stock check on my cart shop, and i should not have any problem with product bought wich aren't in stock..

 

i thought it would be way nicer to have dropdown with max quantity on my product info..

 

any ways to do this changing the tep "function" on the quantity line?

 

it's here i guess

 

<?php echo tep_draw_input_field('quantity[]',$value = '0',"size=2");?></td>

 

Thank you for ur time !

 

Fabien.

 

PS: Btw just thinking to that, dropdown would need to have 0 or -- as default instead of 1 quantity...so it don't end up adding all attribut with 1 quantity since this contrib add every quantity typed in table with 1 add to cart click

Edited by Lgn.Magic
Link to comment
Share on other sites

I'm working on a version to allow dropdowns with the quantity boxes but that won't be affected by stock level. That is already handled well by the QTPro contribution and wouldn't be worth the time to try to improve on that.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

ok if dropdown affected with stock level is not worth it and is too much work i can understand perfectly :D

 

Good to hear you're working on a version to add a dropdown selection even if not affected by stock level.

 

then i can use QT pro function to show my stock stock level (i've got it installed)

 

but i need to add the row "stock level" wich normally display with qtpro option "display table with stock information"

 

into the table from this contribution since i don't want to show 2 table.

 

 

i added heading row already using this

 

<td class="main" align="center"><?php echo STOCK_LIST_IN_PI_TEXT_HEADING; ?></td>

 

taking the define command from qt pro found in includes/languages/english/product_info.php

 

But i can't figure out how to write command to show stock level

 

such as

<td class="main" align="center"><?php echo $products_options_name['products_options_name']; ?></td>

is displaying the attribut name

 

Can you help me out with the php echo command to display my stock level???

 

i tried few things already such as this for exemple

 

<td class="main" align="center"><?php echo $products_stock_values['products_stock_quantity']; ?></td>

 

but it seems all i tried wasn't the good command....im looking into includes/modules/qtpro_stock_table.php

but can't figure out wich one is the good one..

 

Can't you help me out?

 

Thank you so much for your time !!

Fabien

Edited by Lgn.Magic
Link to comment
Share on other sites

ok thanks anyways.

 

I've been installing qt pro b4 i add it again, and the little things thats wasn't really good on this contrib are still there (i just forgot about them)

i'll have to restore without QT pro i think....too bad it takes ages to merge this contrib on a modified store :(

 

i've been trying different attribut quantity contributions including this one

 

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

 

on last one, it would do the job for me but there as "several" bug wich is not what im looking for.

alright any mod can't be bug free for sure.

 

But would you have any attribut quantity contribution to suggest me

 

i'm almost done changing all this things standard osc attribut doesn't do itself...i've sort order, reference for each attributs now table to show...eveything exactly as i wanted.

BTW thank you for updating this contribution, you rox :D looking forward next version with dropdown :D

 

my last step is attribut quantity, and i cannot get it to work properly :(...almost a month im working to make attributs works correctly

 

Regards, Fabien.

Edited by Lgn.Magic
Link to comment
Share on other sites

Ok, if interested about adding row in stock...i finally found out.

 

i installed again contrib for attributs quantity

 

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

 

Seems it's the best for me at the moment. i was able to fix most problem i had with that contrib. Even if i still have some, i believe ill fix it soon...

 

Anyways, about adding in stock raw into ur contribution here code i added

 

catalog/product_info.php

 

on fist "<tr></tr>" wich drawing table title

 

<td class="main" align="center"><?php echo TEXT_PRODUCT_INSTOCK; ?></td>

 

and on the second wich display attributes info

 

<td class="main" align="center"><?php echo $products_qty = $products_options['options_quantity']; ?></td>

 

then in catalog/includes/languages/english/product_info.php (and in any languages used)

 

define('TEXT_PRODUCT_INSTOCK', 'In Stock');

 

Although i don't know if such code works with other attribute quantity such as qtpro or other there can be.

 

It does with this contribution and that one i mentioned at beginning of post

Edited by Lgn.Magic
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

hello Jack,

 

Im gone with my previous problem and i've got it fixed now.

 

I noticed 2 things in this contribution u may want to be aware of:

 

If adding a product to special, to offer promotion, table in product info will not display promotion price but default price. altough when u add to the cart disounted price is selected and all is ok so no bug from there. but i thought it may be be good to have price change in table of product attribut to promotion price.

 

Also another thing with attribut display in table (prod_info)

let's say there is 5 stock for A attribut..when a customer buy all the stock, it goes down to 0.

but Option still in the table, the code to check out stock level in shopping cart (or wherever we add code for stock check, i don't remember exactly the page) is doing is job, and even if trying to add a quantity of an out of stock attribut, u can't checkout for it. but i thought it may be good to have attribut dispear from table when stock goes down to 0.

 

Let me know if you can propose any solution to this 2 things

 

Thank you for your time!!

 

PS: I forgot to say thanx for your answers in Header Tag contrib theard. so thx :)

Edited by Lgn.Magic
Link to comment
Share on other sites

Niether have to do with this contribution that I can see. The first sounds like it may be something wrong with your code or maybe a contribution installed incorrectly. The second is how oscommerce works. You need to install the QTPro contribution if you want to track attribute stock.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Actually i have my top page product price commented since i don't wanna show

 

I mean the top page one

 

<td valign="top"><h1><?php echo $products_name; ?></h1></td>

<td align="right" valign="top"><h1><?php echo $products_price; ?></h1></td>

 

if i uncomment, my price show correctly the special price

 

specialprice.jpg

 

but not in table, so i thought it was coming from this contrib code lines

 

my price code in prod_info is as follow

 

	if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
  $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
} else {
  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}

 

and the code part for price from ur contrib is

 

 if ($products_options['options_values_price'] != '0') {
		$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
if ($products_options['price_prefix'] == '+') {
	   $price_with_attribute = ($product_info['products_price'] + $products_options['options_values_price']);
} else {
   $price_with_attribute = ($product_info['products_price'] - $products_options['options_values_price']);

 

So normally, if i understand youe last post, u say your contrib should be calling, the special price if any in the table aswell?

Link to comment
Share on other sites

  • 3 weeks later...

Jack,

 

i've tried to add this contribution on a fresh install of oscommerce, and special price is not working in attribut table. It just show the standard price, not special.

 

in

 

if ($products_options['options_values_price'] != '0') {
		$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
if ($products_options['price_prefix'] == '+') {
	   $price_with_attribute = ($product_info['products_price'] + $products_options['options_values_price']);
} else {
   $price_with_attribute = ($product_info['products_price'] - $products_options['options_values_price']);

 

Nothing call any special price like the standard new price call you can find in default prod info

 

	if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
  $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
} else {
  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}

 

so when u call the echo in table

 

<?php echo $currencies->display_price($price_with_attribute, tep_get_tax_rate($product_info['products_tax_class_id'])); ?>

 

it's normal to me that no special price is shown, since there is nothing in the code that do it.

 

could you have a look at it? i've tried several things, but can't get it to work right wich each attribut.

 

i can get it to show special price, but it show same special price for any attributs, im missing something somewhere.

 

thank you, Fabien

Link to comment
Share on other sites

Jack,

 

i've tried to add this contribution on a fresh install of oscommerce, and special price is not working in attribut table. It just show the standard price, not special.

I just tested it and you are correct. Funny that no one has noticed that before. I don't have a quick fix for it though but I will add it the list for the changes to the next update.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

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