Zen Cart Logo
Forums / All Other Contributions/Addons / Stocks by attributes

Stocks by attributes

Locked

Views: 251,301

Results 541 to 560 of 1,126
This thread is locked. New replies are disabled.
28 Jan 2009, 2:55 PM
#541
ptownkid avatar

ptownkid

New Zenner

Join Date:
Jul 2008
Posts:
25
Plugin Contributions:
0

Stocks by attributes

Ok, so I've sitting here reading this thread for an hour and my eyes can't take any more.

I installed the mod without issues, and it seems to be working correctly, however i would like to have my customers see the same quantites that i can see in the back end.

Seems silly that they don't find out a certain colour is unavailable until they add it to their cart. Is there a way to fix this?

28 Jan 2009, 3:50 PM
#542
ptownkid avatar

ptownkid

New Zenner

Join Date:
Jul 2008
Posts:
25
Plugin Contributions:
0

Re: Stocks by attributes

Ok, so i found the info on the wiki page, and I edited the file as directed, and nothing has changed, the customer still can't see the quantity.

Maybe I made an error in the file, can someone have a look please?

28 Jan 2009, 5:20 PM
#543
ptownkid avatar

ptownkid

New Zenner

Join Date:
Jul 2008
Posts:
25
Plugin Contributions:
0

Re: Stocks by attributes

Well, a few more hours of holding my head in my hands and I've gotten somewhere.

The code fixes linked to the wiki will only display stock values if you're using radio buttons for your attributes. A few pages later there are some more fixes that apparently will allow you to use drop down menus which i will try later.

What i'm trying to decipher now is where the text is located that shows next to the radio buttons. It currently says [20 pieces] and i'd like it to read [20 units in stock] which is far less misleading.

Anyone know where that text is located?

28 Jan 2009, 10:25 PM
#544
krazykev avatar

krazykev

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
1

Re: Stocks by attributes

Ptownkid,

can you post a link to the wiki you are reading this info from. I am a developer and am interested in having a go at this problem.

Cheers

Kev

29 Jan 2009, 11:26 AM
#545
krazykev avatar

krazykev

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
1

Re: Stocks by attributes

FOund wiki stuff - sorry - am new to this - will look it at over the next few days. Anybody else actively working on this that wants to collaborate?

Kev

2 Feb 2009, 6:20 PM
#546
krazykev avatar

krazykev

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
1

Re: Stocks by attributes

Ok everyone.

I have found a solution to this - at least it works for me. I have only tested it with drop downs, but it seems to work ok. By this I mean product attributes that are out of stock are not displayed to customers on the product info page.

Before unleashing it in to the wild I wouldn't mind collaborating with someone - maybe even the author. I am using the MULTIADD 4.7 version with Zen Cart 1.3.8.

So far everything seems ok but my technical knowledge of Zen Cart is limited.

Any offers of assistance appreciated.

Krazy Kev

6 Feb 2009, 8:03 AM
#547
kagen avatar

kagen

New Zenner

Join Date:
Oct 2008
Posts:
18
Plugin Contributions:
0

Re: Stocks by attributes

i accidentally uploaded the files for the stock attributes, before i installed the sql patch. Now it doesn't work when i try and install the sql.

here is the error message

1062 Duplicate entry 'STOCK_SHOW_LOW_IN_CART' for key 2
in:
[INSERT INTO zen_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Show available stock level in cart when less than order', 'STOCK_SHOW_LOW_IN_CART', 'false', 'When customer places more items in cart than are available, show the available amount on the shopping cart page:', '9', '6', NULL, now(), NULL, "zen_cfg_select_option(array('true', 'false')," );]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

I have tryed many things but am stuck. if you could help me that would be great!!!!

Thanks!!

6 Feb 2009, 8:13 AM
#548
kagen avatar

kagen

New Zenner

Join Date:
Oct 2008
Posts:
18
Plugin Contributions:
0

Re: Stocks by attributes

nvermind i fixed it

6 Feb 2009, 1:41 PM
#549
crin avatar

crin

New Zenner

Join Date:
Nov 2006
Posts:
39
Plugin Contributions:
0

Re: Stocks by attributes

Hi all,

I have installed the products with attributes stock mod on my fresh ZenCart install. When i try to select it form the Catalog Menu i get the follwing errors...


Warning: main(includes/classes/products_with_attributes_stock.php) [function.main (http://nutmegsjewellery.co.uk/newstore/admin/function.main)]: failed to open stream: No such file or directory in /home/sites/nutmegsjewellery.co.uk/public_html/newstore/admin/products_with_attributes_stock.php on line 12

Warning: main(includes/classes/products_with_attributes_stock.php) [function.main (http://nutmegsjewellery.co.uk/newstore/admin/function.main)]: failed to open stream: No such file or directory in /home/sites/nutmegsjewellery.co.uk/public_html/newstore/admin/products_with_attributes_stock.php on line 12

Warning: main(includes/classes/products_with_attributes_stock.php) [function.main (http://nutmegsjewellery.co.uk/newstore/admin/function.main)]: failed to open stream: No such file or directory in /home/sites/nutmegsjewellery.co.uk/public_html/newstore/admin/products_with_attributes_stock.php on line 12

Fatal error: main() [function.require (http://nutmegsjewellery.co.uk/newstore/admin/function.require)]: Failed opening required 'includes/classes/products_with_attributes_stock.php' (include_path='.:/usr/share/pear') in /home/sites/nutmegsjewellery.co.uk/public_html/newstore/admin/products_with_attributes_stock.php on line 12

I followed the instructions ot the letter and I am using the latest release of the mod and a fresh install of the latest version of Zen Cart

6 Feb 2009, 2:45 PM
#550
krazykev avatar

krazykev

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
1

Re: Stocks by attributes

It could be that the user account used to deliver web pages to users on your server (typically IUSR_xxxxx on Windows) does not have read permissions to the folder/file

public_html/newstore/admin/products_with_attributes_stock.php

Login in to your server/control panel and check the permissions on this file/folder.

Kev

6 Feb 2009, 2:56 PM
#551
crin avatar

crin

New Zenner

Join Date:
Nov 2006
Posts:
39
Plugin Contributions:
0

Re: Stocks by attributes

hanks Kev, It was previously set to 644. I have tried it on 666 but now get the follwing error...

A file permissions error has occurred. Please check the permissions on the script and the directory it is in and try again.Bit baffled by this, thought it would be strightforward install :s

6 Feb 2009, 3:32 PM
#552
bravo00 avatar

bravo00

New Zenner

Join Date:
Feb 2008
Posts:
5
Plugin Contributions:
0

Re: Stocks by attributes

is it possible to set the quantity for all variants on every product id in one go, to say 100?

I have over 3000 products, and it seems a bit long winded to click Add Quantity For Product Variant and select all for the options and 100 for quanity!

hope that makes sense

6 Feb 2009, 8:22 PM
#553
kellan4459 avatar

kellan4459

New Zenner

Join Date:
Dec 2008
Posts:
79
Plugin Contributions:
0

Re: Stocks by attributes

I've looked through the code for the stock_by_attribute add-on and it looks like the verification is done at checkout. Is there any modifications that would prevent an attribute from showing in the product listing. For example if I want to allow time slots for an event but only allow qty 1 for each time slot. I don't want the customer to have to go through checkout multiple times trying to find an open time slot. I want them to be able to only see available time slots unless someone has purchased that time slot in the time it took them to complete their transaction then checkout would suffice for verifying quantity. I see a couple of queries in the attributes.php under modules that should be ok for checking quantity but I would like to here from someone with more time working with this area of the zencart to give me some feedback on preventing attributes from showing up if qty is zero or if this feature exists and I'm just missing something.

Thanks

7 Feb 2009, 6:53 PM
#554
krazykev avatar

krazykev

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
1

Re: Stocks by attributes

Crin,

it sounds likike you are having a file permissions problem. Did you correctly set all the folder permissions as specified by the original Zen Cart installation instructions?

Kevin

7 Feb 2009, 11:12 PM
#555
kellan4459 avatar

kellan4459

New Zenner

Join Date:
Dec 2008
Posts:
79
Plugin Contributions:
0

Re: Stocks by attributes

kellan4459:

I've looked through the code for the stock_by_attribute add-on and it looks like the verification is done at checkout. Is there any modifications that would prevent an attribute from showing in the product listing. For example if I want to allow time slots for an event but only allow qty 1 for each time slot. I don't want the customer to have to go through checkout multiple times trying to find an open time slot. I want them to be able to only see available time slots unless someone has purchased that time slot in the time it took them to complete their transaction then checkout would suffice for verifying quantity. I see a couple of queries in the attributes.php under modules that should be ok for checking quantity but I would like to here from someone with more time working with this area of the zencart to give me some feedback on preventing attributes from showing up if qty is zero or if this feature exists and I'm just missing something.

Thanks

I made a single SQL statement change that does the behavior that I was looking for in my original post. After reading some posts by Grayson I think I was able to do this properly. The version of zencart I have has since replaced main_template_vars_attributes.php with just attributes.php. What I wanted to do was prevent the option from showing if the individual product-option qty was 0. I made the following modification using a LEFT JOIN and then doing a check whether the quantity is greater than zero or IS NULL within the same sql statement. If > 0 then the individual product-option has qty available. If it IS NULL then there is not an entry for this product-option and it should be using the Main Item Qty.

$sql=	"SELECT  pov.products_options_values_id,
        pov.products_options_values_name,
        pa.*,
        pwas.*
        FROM   " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " pwas ON pwas.stock_attributes = pa.products_attributes_id
        WHERE   pa.products_id = '" . (int)$_GET['products_id'] . "'
        and    pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
		and    (pwas.quantity > 0 or pwas.quantity IS NULL)
        and    pa.options_values_id = pov.products_options_values_id
              and       pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
		$order_by;

Do any of the senior zenners see any potential problems with this? Are there other areas that could potentially be broken by this modification that I may have missed?

Thanks

8 Feb 2009, 4:29 AM
#556
kellan4459 avatar

kellan4459

New Zenner

Join Date:
Dec 2008
Posts:
79
Plugin Contributions:
0

Re: Stocks by attributes

I added the following to make the quantity show in select boxes if a quantity is specified for the individual attribute since some of my products will use the Item Quantity and not an individual item attribute quantity.

if($products_options->fields['quantity'])
{
	$products_text_to_use = $products_options->fields['products_options_values_name'] . " (" .  $products_options->fields['quantity'] . " Available)"; //yes Available is improperly hard coded 
} 
else 
{
	$products_text_to_use = $products_options->fields['products_options_values_name'];
}
        $products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
        'text' => $products_text_to_use);
8 Feb 2009, 1:14 PM
#557
krazykev avatar

krazykev

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
1

Re: Stocks by attributes

Hi Kellan,

I did something very similar but didn't check for null/0 so didn't have to make your second change above.

select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
on pa.options_values_id = pov.products_options_values_id
join products_with_attributes_stock PWAS
on PWAS.stock_attributes = pa.products_attributes_id
where pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "'
and PWAS.quantity > 0 " .
$order_by;

This is in attributes.php

9 Feb 2009, 10:00 PM
#558
krazykev avatar

krazykev

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
1

Re: Stocks by attributes

Hi all,

I have just tweaked EasyPopulate to import/export Products With Attributes Stock data. It is very simple and works for me. How do I publish this to others as it is a cross/hybrid mod of EasyPopulate and Stock By Attributes? Also, should I publish it as I think a commercially available mod, Easy Populate Advanced does this. Whilst this is my solution so there are no copy right breaches, I don't want to do anything to offend other Zenners.

Also, what is a "New Zenner"??????

Kev

10 Feb 2009, 9:18 AM
#559
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Stocks by attributes

Hi Kev

I'm not sure what the position is for you to release it as a commercial module when your foundations are a couple of free modules (assuming it was the Easy Populate free and not the commercial) but I do believe a free release to the community would be quite popular.

If you did release it commercially, then you are more or less obliged - in fact, you may even be legally obliged as goods must be fit for use - to offer support and ensure that it works for any paying customer. If a free release, that sort of support becomes entirely voluntary.

One option is to release it as a freebie, then develop an enhanced commercial option, much in the way that Langer did with EP and EP Advanced.

If you release to the community, package it up in the correct zc directory structure, include a detailed readme with installation instructions, a list of modified core files, a list of new files etc and then submit it via the Submit your file button here

New Zenner simply refers to the number of posts you have made on the forum

10 Feb 2009, 9:38 AM
#560
krazykev avatar

krazykev

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
1

Re: Stocks by attributes

Hi Ryk,

I don't think I was very clear. I have no intention of releasing this commercially. I am aware that Easy populate Advanced is commercially available, and that it may offer similar functionality. What I want to avoid is releasing a free mod that would be stepping on the toes of a commercially available mod and upsetting the author.

Since you have suggested that a free mod may prove useful, I will document my work tonight and upload it for all to use, unless someone suggests otherwise.

Kevin