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 201 to 220 of 273
This thread is locked. New replies are disabled.
3 Mar 2006, 3:29 AM
#201
seizer avatar

seizer

New Zenner

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

Stock For Product With Different Attributes (OLD)

I don't think it would be too terribly difficult. I'd add a column to the products_attributes table (eg. products_attributes_checkstock) and make it binary, then edit the PWAS (this) mod with a simple if (products_attributes_checkstock == true) condition. I think that would work.

uhhh...sorry steven you lost me :unsure:
like i said i am pretty new zencart (or wait maybe i just said php ::bsh ) and php.

i can't find a table called products_attributes_checkstock
and i am not sure what *PWAS (this) mod * is.

sorry for looking like such a dunce. :(

I came here to learn. I left here wiser.

3 Mar 2006, 8:52 AM
#202
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)

Not at all!

PWAS is this mod that we are all discussing in this thread "Products With Attributes Stock"

And products_attributes_checkstock doesn't exist :) So its no wonder you couldn't find it... what I was suggesting is that you ADD it (as a column) to the table called products_attributes. But don't mess with that unless you know what you are doing ;)

I was just throwing out a possible method for achieving what you want and maybe someone can run with it... it is a good idea. I've got a mile long list of things to get to for my own store and I have several requests on the table too, so I doubt I can do it for you any time soon. Buf for someone that is inclined, I don't think it is very hard at all.

However, if you don't know php very well and/or zencart then its not nearly as trivial as I'm making it sound.

  • Steven
3 Mar 2006, 9:57 PM
#203
seizer avatar

seizer

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

okay i gave this a go today and managed to get it so that only thsoe attributes i want to include will be included.

the changes weren't many. my code is a little hacked right now but i will clean it up and post.

it was easy. ::tup all i did was creat a new field in the products attribute table called include_for_stock_qty set it to tinyint with a default value of 0

next i changed the admin/products_with_attributes_stock.php queries to include only those items flagged for inclusion.

ditto with classes/products_with_attributes_stock.php

it works great if i go into ohomyadmin and set the records I want to the proper value(it's easy for me since i only have one attribute this will ever affect.

what i have been trying to do is modify the admin/attribute_controller.php file and although i have managed to create a field for this on the form (i placed it alongisde all the flags at the end of the row) i can't seem to see hopw this value get sent to or picked up from the database. i have modified the queires and set the variables but still can't seem to get it <_<

if anyone cn tell me where i can find this i would behappy to finish this tonight and post what's done :D

this php is pretty easy once you get the hang of it.

I came here to learn. I left here wiser.

4 Mar 2006, 2:48 AM
#204
seizer avatar

seizer

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

okay i i got it working where you can choose which attributes you want to include in your stock count AND i got it so you can choose them from the attribute controller screen.

and its working nicely. if anyone wants it i'll get it out to you. there were some chnages to a few files:

admin/attributes_controller.php - Modified attibuts controller screen to include and exclude attribute in stock count

classes/products_with_attributes_stock - inserted a condition into the select query to return only those attributes flagged as being included in stock count

languages/english.php - added a title for the attributes flags boxes

languages/english/attributes_controller.php - added titles for legends

and a field inserted to the products_attribute table.

what i did notice however that if i have a product that has attributes where none of those attributes are tracked for quantity my product alwasy displays as OUT OF STOCK regardless of how much is in the "total" quantity field.

has anyone else had this problem?

I came here to learn. I left here wiser.

5 Mar 2006, 5:00 PM
#205
seizer avatar

seizer

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

after working until 4:00 am the last two nights i have worked out all the kinks and have modified this mod so that it only tracks attributes you wish it to track. ::tup

i am not sure if you all were going to include this in your next update of this mod but i find it very useful since i only track certain attributes.

i had a problem with allowing the checkout. (i created a second posting by mistake ::ops ) but have fixed the problem since then. i go a little crazy when i have little sleep. :wacko:

anyway i am wondering if there is a way to disable an attribute (as opposed to deleting) so that a customer will not have that option. this will prevent them from even having to select the option ony to be told there is insufficient quantity a screen later.

going to make apot of STRONG coffee. see you at 4:00am!

I came here to learn. I left here wiser.

5 Mar 2006, 5:42 PM
#206
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)

Yes, I'm sure that is possible. If you take a look at this example on my dev site, you'll see how I use JS to notify whether or not there is stock for a particular set of attributes. I'm not JS expert, but I'd imagine there would be a way to instead delete the option altogether if stock is < 1.

Of course, I still have not managed to find the time to package it up but if you look at the page source you can pull out the JS and then the rest shouldn't be too hard for someone that is motivated and has the time.

I'm sorry to those that are waiting for me to do it. I just can't afford to push off work on my site ay more, I'm already a month behind schedule.

  • Steven
6 Mar 2006, 12:02 AM
#207
dreamstudio avatar

dreamstudio

Zen Follower

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

Re: Stock For Product With Different Attributes (OLD)

i took out the js file but couldnt get it to work on my site, it just doesnt do anything, do i have to place the js test anywhere in particular on the page so it shows the stock for that item?

6 Mar 2006, 9:41 PM
#208
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 an update on my progress. I've now made it so the Add to Cart button is disabled if an option is out of stock.

I thought again about having it remove the out-of-stock attributes alltogether and I realized that is impossible, at least for multiple-attribute situations. It would be possible with an AJAX type implementation, though.. and if anyone gets that working then it is better than mine I think.

Once I wrap all this up and finish I'll release it here. But please understand that this is just one small part of my site and I still have tons of work to do... so ETA: few weeks. I'm sure someone with some JS knowledge could get it done before that AND do it better than I did... I just want you to see what is possible.

[example]

  • Steven
6 Mar 2006, 10:02 PM
#209
cslhypnotech avatar

cslhypnotech

Zen Follower

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

Re: Stock For Product With Different Attributes (OLD)

s_mack:

Just an update on my progress. I've now made it so the Add to Cart button is disabled if an option is out of stock.

I thought again about having it remove the out-of-stock attributes alltogether and I realized that is impossible, at least for multiple-attribute situations. It would be possible with an AJAX type implementation, though.. and if anyone gets that working then it is better than mine I think.

Once I wrap all this up and finish I'll release it here. But please understand that this is just one small part of my site and I still have tons of work to do... so ETA: few weeks. I'm sure someone with some JS knowledge could get it done before that AND do it better than I did... I just want you to see what is possible.

[example]

  • Steven
    Looks real slick, Steven. ::tup
7 Mar 2006, 3:03 AM
#210
speedyvespa avatar

speedyvespa

New Zenner

Join Date:
Jun 2004
Posts:
60
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

Hello all,

I just tested this in my (modified) v1.2.5 zencart - seems to work fine for me. So far!

Anyone else have any experiences in installing this truly wonderful mod on 1.2.5?

pip-pip.

7 Mar 2006, 3:43 PM
#211
joostvdl avatar

joostvdl

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

seizer:

Steven

First of all many props to those who hvve worked so hard on this contrib. ::tup I am going to start working with it tonight.

I'd actually like to get that contrib if you don't mind.
Great looking site by the way.

Thanks
I also like your contrib Steven.

I send also a PM to you.

7 Mar 2006, 4:06 PM
#212
joostvdl avatar

joostvdl

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

A Java script that checks the different combinations that are available:

<script type="text/javascript" language="JavaScript">
function changeCategory(vl) {
	switch(vl) {
 case "6":
  strn = '<select name="id[2]"><option value="5">Extra Large</option><option value="5">Extra Large</option><option value="4">Large</option><option value="4">Large</option><option value="3">Medium</option><option value="3">Medium</option></select>';
    break;
 case "8":
  strn = '<select name="id[2]"><option value="5">Extra Large</option><option value="5">Extra Large</option><option value="4">Large</option><option value="4">Large</option><option value="3">Medium</option><option value="3">Medium</option><option value="15">Xs</option></select>';
    break;
	}
  document.getElementById('2').innerHTML='';
  document.getElementById('2').innerHTML=strn;
  
  return false;
}
</script>

and the dropdown lists:

      <tr>
       <td class="main">Kleur:</td>
       <td class="main"><span id="1"><select name="id[1]" id="superid" onChange="changeCategory(this.value)"><option value="8">Groen</option><option value="6">Roze</option></select></span></td>
      </tr>
      <tr>
       <td class="main">Maat:</td>
       <td class="main"><span id="2"><select name="id[2]"><option value="5">Extra Large</option><option value="5">Extra Large</option><option value="4">Large</option><option value="4">Large</option><option value="3">Medium</option><option value="3">Medium</option><option value="15">Xs</option></select></span></td>
      </tr>
       <td class="main"><a href="/conversion.php" target="new">Onbekende maat? Klik hier voor de maat<br>conversietabel (link opent in een nieuw venster).</a></td>
<script type="text/javascript" language="JavaScript">
vll = document.getElementById('superid').options[document.getElementById('superid').selectedIndex].value;
changeCategory(vll);
</script>

With this javascript there is no need for AJAX.

But I hav not yet integrated this in the mod. So any help should be great.

Joost

8 Mar 2006, 1:45 PM
#213
seizer avatar

seizer

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

Steven

Can I get a copy of your JS file? I'd like to try and get this on my site. I'll even try and package it .

Cesar

I came here to learn. I left here wiser.

12 Mar 2006, 12:27 PM
#214
aigle_princess avatar

aigle_princess

New Zenner

Join Date:
Mar 2006
Posts:
30
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

Hi,

This looks like somethig I would like too.
But still somewhat different.

I want attibutes just to appear if anothe certain attribute is already shoosen.
Like described in
http://www.zen-cart.com/modules/ipb/index....&hl=conditional

I sure would apriciat if that could be made.
Now alle attributes are available and visible although of no use and only confusing for the customers.
:blink:

12 Mar 2006, 7:17 PM
#215
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 would be solved if someone gets an Ajax implementation working. If y'all wait for me to do it, it will probably be in the summer.

12 Mar 2006, 7:25 PM
#216
joostvdl avatar

joostvdl

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

I will create it this week. Because I have to for my customer.

Steven: I Have your file received., but if I need some more altered files, can I contact you then?

Joost

13 Mar 2006, 12:41 PM
#217
ringy avatar

ringy

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

Sorry to interrupt the current thread, but is there an easy way of populating the stock levels by attributes rather than use the Admin > Products With Attribute Stock > Add Quantity For Product Variant process???

I have a large catalogue so something like Easy Populate, or even a PHPmyAdmin approach would be very useful.

Cheers :)

13 Mar 2006, 6:33 PM
#218
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 in a similar boat...

I found that integrating with easypopulate was a huge pain for me, but I admit I'm not sure if it is this mod or others that I've put in but I couldn't even get easypop to work at all.

PHPmyadmin is slower than the admin interface for me :)

One thing I did that helped was bypass the "confirm" step when adding attribute stock... that sped it up a bit but still not enough, so I ended up taking the time and effort to export the DB and use Excel to fill it out and then export that in import it back into the DB. It is faster if you have a lot of items, but VERY easy to screw up.

  • Steven
14 Mar 2006, 8:43 AM
#219
ringy avatar

ringy

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

Hi Steven,

Thanks for the advice.

Fortunately, I still have EP working with this contrib, but it doesn't avoid the need to have to trawl through all the products and systematically define stock by attributes. I guess I'm in need for a more slick way of doing this as I am just setting up my store and have a lot of products to initiate.

However, I would be keen for a smarter way of managing stock in future as I have more than one retail outlet, so may have to manually maintain stock levels on my site.

I am interested in your "work-around" for the confirm step - I tried to edit this out of the code to no avail - can you post your mod please?

I am happy to delve into the database using Excel (back-ups rule!), so would you be happy to provide a guide on this please?

Of course, I don't ask for much ::tup

14 Mar 2006, 4:30 PM
#220
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)

Pretty sure I already posted the no_confirm mod here. Sorry, I can't provide steps for doing it in excel - it would take me hours just to figure out a way to explain it. Its easier to figure out honestly.

But it seems to me someone had come up with a guide. I remember ignoring it because it looked to complicated but it probably is worth the effort if you have >100 products to edit.

  • Steven

Edit, ok 2 more things I don't like about this forum software!!! If you search for "nocontrib" you will find my post, but it just points you to this thread rather than the specific post like most forums do ::tdn Second, I found the post and I was going to link you directly to it but it won't let me do that either!!! :yk