Forums / All Other Contributions/Addons / Stock For Product With Different Attributes (OLD)

Stock For Product With Different Attributes (OLD)

Locked

Started by dafonz on 30 Nov 2005, 8:52 PM · Views: 80,867

Results 161 to 180 of 273
This thread is locked. New replies are disabled.
22 Feb 2006, 12:59 AM
#161
afx114 avatar

afx114

Zen Follower

Join Date:
Aug 2005
Posts:
144
Plugin Contributions:
0

Stock For Product With Different Attributes (OLD)

yo doods, i haven't forgot about this. i've been swamped with a new zen launch, but once i get some time i'll post the udpated package, and try to get grayson's changes in there.

22 Feb 2006, 7:33 AM
#162
grayson avatar

grayson

Totally Zenned

Join Date:
Oct 2005
Location:
Netherlands
Posts:
516
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

s_mack:

That's great, but is there a link to the package? The one in downloads isn't complete - there is no admin interface (must be missing file[s]).

  • Steven
    Steven, the second post in this thread (way on back there :) ) has a link -- I'm assuming that's still the most current version?
22 Feb 2006, 7:49 AM
#163
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Stock For Product With Different Attributes (OLD)

That's the one people are later complaining is missing a file... so I figured there was a newer one. Anyway, I can wait and it sounds like the author is going to roll in some of your much appreciated mods. I'll monitor and wait for that release.

I don't expect anyone here to write it for me, but how possible/easy do you think it would be to make it so I can define which products can go to checkout if out of stock and which ones can't? I like to keep track of stock for my own purposes, but some items I want customers to order regardless of if I have any in stock (because I can get stock within the hour) while others are gone when they're gone. I just finished writing an extremely complex and involved contrib that allows you to select a different "base currency" for each item so I'm sure I can do it - just wanted to hear your thoughts before I tackle it. in conjunction with this contrib is what i mean.

  • Steven
22 Feb 2006, 8:54 AM
#164
grayson avatar

grayson

Totally Zenned

Join Date:
Oct 2005
Location:
Netherlands
Posts:
516
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

Steven, I think there are a lot of people who would love it if you wrote that mod. It won't be the simplest of things to write, but I'm convinced you can do it :).

Will you write it only for products with attributes, or for all products? It would be useful for all products for many folks, I bet. So perhaps it's better as a standalone contrib than rolled into this one.

22 Feb 2006, 9:02 AM
#165
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Stock For Product With Different Attributes (OLD)

After thinking about it, I think it will be dead simple. I'll get to it asap. Might not make a pretty admin for it (but I might :) )

I wasn't thinking of only with attributes, but I do want it to do that too... that's where it might get tricky.

How's this mod work? If you have "don't allow checkout if out of stock" option enabled does it work with this mod? If so, then my mod should be pretty easy to work with this one too. If not, then it may not be easily compatible - I won't know till I get a little dirty.

  • Steven
22 Feb 2006, 1:10 PM
#166
ringy avatar

ringy

New Zenner

Join Date:
Dec 2005
Posts:
62
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

Steven,

For what it's worth....

I did a very simple (but also very basic) mod to that written by grayson for showing a string value against an attribute. To save you looking back a few pages I wanted to show whether an item could be dispatched from stock, or whether it would take a day or so before I could dispatch it (from supplier stock). Letting the customer decide at the product page would avoid disappointment at checkout ;) Thanks again to grayson ::tup

So, the customer doesn't see stock levels, just the dispatch time. This is triggered by Stock With Attributes being >0 or <=0, accordingly, so remains reasonably dynamic.

I have slightly enhanced this to ask the customer to "contact us" on certain attributes - in case the supplier is temporarily out of stock of that variant. All I do is set the attributes stock to -100. This does messes up any stock control through ZC, but I have another means for stock control anyway.

Would be happy to post the mod if anyone wants it :)

22 Feb 2006, 1:20 PM
#167
ringy avatar

ringy

New Zenner

Join Date:
Dec 2005
Posts:
62
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

Has anyone played around with formatting a radio list with this mod?

In my vertical list, each row has a radio button, Attribute variant and attribute/stock message (in my case dispatch time based on attribute stock level).

I am about to embark on a trawl through the code to insert the apporpriate <TD>s to format the list into tidy columns (the attribute/stock messages are all out of line since the attribute variants are different lengths). Seems that this will be a bit of a challenge :blink:

Still, I was wondering if anyone had done this already to save me the headaches ??? ;)

22 Feb 2006, 3:08 PM
#168
yahaira avatar

yahaira

New Zenner

Join Date:
Feb 2006
Posts:
77
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

you guys keep coming up with great solutions while I'm still breaking my code to get the stock to appear in the dropdown menu. :(

for some reason I can't find the right place where the text value for the dropdown is generated. any tips?

23 Feb 2006, 12:06 AM
#169
dreamstudio avatar

dreamstudio

Zen Follower

Join Date:
Jun 2005
Posts:
106
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

ringy

would love to see that addition as my client sells clothes and part of the problem is certain sizes the customer needs to contact them..

23 Feb 2006, 7:42 AM
#170
grayson avatar

grayson

Totally Zenned

Join Date:
Oct 2005
Location:
Netherlands
Posts:
516
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

yahaira:

you guys keep coming up with great solutions while I'm still breaking my code to get the stock to appear in the dropdown menu. :(

for some reason I can't find the right place where the text value for the dropdown is generated. any tips?
Yahaira, I couldn't find it right away either....I've got to translate today, but I'll try to take a look at in the next day or two.

23 Feb 2006, 8:39 AM
#171
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Stock For Product With Different Attributes (OLD)

I'm not sure exactly what it is you mean. But here's a shot in the dark (tell me if I totally misunderstood):

/includes/functions/html_output.php

function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false)

$values should, in most cases, be a two dimensional array with 'id' and 'text' pairs.

  • Steven
23 Feb 2006, 8:43 AM
#172
grayson avatar

grayson

Totally Zenned

Join Date:
Oct 2005
Location:
Netherlands
Posts:
516
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

s_mack:

I'm not sure exactly what it is you mean. But here's a shot in the dark (tell me if I totally misunderstood):

/includes/functions/html_output.php

function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false)

  • Steven
    Steven, I was actually referring to includes/modules/pages/product_info/main_template_vars_attributes.php. Yahaira wants to add the attributes stock text to the dropdown menu the way we added it to the radio buttons and checkboxes, but the dropdowns don't use the same variables in m_t_v_a.php that the other items use. I looked for a while last week and couldn't see right off where that text was set, so I left it as an exercise for Yahaira :lol: ;) (just kidding).
23 Feb 2006, 8:52 AM
#173
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Stock For Product With Different Attributes (OLD)

Ok, on that page... line 603 shows the drop down call... it is fed its ID and TEXT values from an array named products_options_array.

So searching for that array, we see it is generated up on line 107.

The values for 'text' are fed from a variable called products_options->fields['products_options_values_name'] which is grabbed from the database.

Again, I'm not certain I understand what it is you're trying to do. Does that help at all or should I just shut up now? :) lol

  • Steven
23 Feb 2006, 9:35 AM
#174
grayson avatar

grayson

Totally Zenned

Join Date:
Oct 2005
Location:
Netherlands
Posts:
516
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

s_mack:

Ok, on that page... line 603 shows the drop down call... it is fed its ID and TEXT values from an array named products_options_array.

So searching for that array, we see it is generated up on line 107.

The values for 'text' are fed from a variable called products_options->fields['products_options_values_name'] which is grabbed from the database.

Again, I'm not certain I understand what it is you're trying to do. Does that help at all or should I just shut up now? :) lol

  • Steven
    Definitely don't shut up :).

The original changes I made to display the individual attribute stock next to the attribute listing used the $product_details and $product_details_no_name variables (I may not have the names exactly right; I don't have them right in front of me) which are set near the top of the file. (Relatively speaking.)

The dropdown doesn't use those, apparently, so I'm guessing the changes made to those variables will have to also be added directly into the code at line 603.

Later today I'll get a chance to look at the code (hard to converse intelligibly on this without the files in front of me :) ), but by then you may have sorted it all out anyway :D.

23 Feb 2006, 3:01 PM
#175
audradh avatar

audradh

Zen Follower

Join Date:
Oct 2005
Location:
Eastern US
Posts:
429
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

mya:

Hi Audra! This is the link:

http://mangobajito.com/compras/index.php?m...1e9276fade413b2

Try ordering this item, not in stock:
Size: XS, Color: Amarillo = 0 items (people simply cannot go beyond the shopping cart, but they do not receive an "out of stock" message).

Items in stock:
Size: S, Color: Amarillo = 15 items
Size: M, Color: Amarillo = 10 items
Size: L, Color: Amarillo = 13 items

Id love that, when people try to buy by an specific attribute, that is out of stock, they would receive that error message.

Your site is a perfect example. When you try ordering that shirt in size small, it appears an error. But if you try ordering another size, theres no problem.

http://www.naturewearorganics.com/index.ph...a04377061646a0f

Thanks Audra!
Mya
Mya,
I'm sorry I've been MIA. I'm not sure what is up, but before suggesting you just reinstall the mod let's make sure you have all the steps taken care of.

  1. Install this mod.

  2. Define in Configuration->
    Check stock level true
    Subtract stock true
    Allow Checkout false
    Mark product out of stock (define text however you want)

  3. Configuration->MyStore/Check stock level: I have set this to true, but that is not necessary.

  4. Add products

  5. Configure Product Attributes

  6. In Catalog->Products with Attributes Stock add stock for each variant:

Click on Add Quantitiy for Product Variant
Choose the appropriate attribute combinations, specify the quantity, submit, submit.

Do this for each combination of attributes.

Whether you do not add a quantity for out of stock items or if you add a zero quantity does not seem to matter. Either way should give the out of stock message.

Short of creating an account on your site I could not fully see what is happening there.

For laughs, try changing
Configure->Stock->Show Sold Out Image in place of Add to Cart to off. That way you can compare how these items compare during the checkout process to out of stock attributes.

Audra

23 Feb 2006, 10:32 PM
#176
yahaira avatar

yahaira

New Zenner

Join Date:
Feb 2006
Posts:
77
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

lol ooops I feel like I let them team down. :)

I tried adding the new line but I must be leaving an extra space somewhere or just not following the correct syntax because I keep breaking it. I end up loosing the product info page and just getting this to show

<!Row sorry!
24 Feb 2006, 6:30 AM
#177
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Stock For Product With Different Attributes (OLD)

Just playing with this mod now... just starting. The author wasn't able to avoid core re-writes, which is fine... but people should be aware that they happen to be with files that have changed in the latest version (1.2.7d) so merge carefully.

Also, from what I can see the file /admin/includes/languages/english.php is completely unnecessary for this contrib. It is included and DOES have changes from the stock file, but they appear to be for some other mod(s). I could be wrong but the comments strongly suggest they are for a different contrib entirely.

  • Steven
24 Feb 2006, 8:02 AM
#178
grayson avatar

grayson

Totally Zenned

Join Date:
Oct 2005
Location:
Netherlands
Posts:
516
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

s_mack:

Also, from what I can see the file /admin/includes/languages/english.php is completely unnecessary for this contrib. It is included and DOES have changes from the stock file, but they appear to be for some other mod(s). I could be wrong but the comments strongly suggest they are for a different contrib entirely.
I generally prefer using an extra_definitions language file for mods (though it does get loaded for every page then, which is a drawback....it'd be nice if the search in includes/modules/extra_definitions.php for files in the extra_defintions folders restricted includes to the page_base as well, with a "common" directory for any extra defines that should be application-wide). Maybe the author could pull out whatever language defines are specific to this contrib and put them in a separate file to go in extra_definitions?

I also like to prepend any new constants with something related to the contrib, to avoid conflict with already-defined constants of the same name from other language files (so PDFOC_EMAIL_GREETING, for example, instead of just EMAIL_GREETING).

24 Feb 2006, 9:08 AM
#179
studmuffin avatar

studmuffin

New Zenner

Join Date:
Nov 2005
Posts:
9
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

Hey Grayson, & all you guys...

was wondering if i could pester you again :)

i have worked out that the problem lies in the fact i am using the wholesale / retail cusomers pricing mod:

http://www.zen-cart.com/modules/ipb/index....f=11&t=23405&s=

http://www.chromeorange.co.uk/zen_modules/...ual_pricing.zip

the problem is i cant see where a conflict is happening....
would you have any ideas ??

thanks

dan

24 Feb 2006, 6:17 PM
#180
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Stock For Product With Different Attributes (OLD)

Have you tried using WinMerge?

Download fresh copies of both contribs again and put them in seperate folders. Get WinMerge (search on google - its free) and carefully see what the differences are.

It may get tricker... you may have to then compare the lines with differences to the stock zen cart files. If you find a line that is different in both contributions AND both are different then the stock, then that is a conflict for sure!

Good luck.

  • Steven