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

Stocks by attributes

Locked

Views: 251,291

Results 641 to 660 of 1,126
This thread is locked. New replies are disabled.
15 Mar 2009, 5:57 PM
#641
cropinstop avatar

cropinstop

New Zenner

Join Date:
Oct 2006
Location:
Surprise Arizona
Posts:
73
Plugin Contributions:
0

Stocks by attributes

cropinstop:

If "Fast and Easy Checkout"is installed when running Stock by Attributes, the shopping cart will proceed to successful checkout when the quantity of an attribute ordered exceeds the quantity provisioned with Stock by Attributes.

Found the solution.

An "attribute stock exceeded" check is missing from "includes/modules/pages/checkout/header_php.php". This file is unique to the "Fast and Easy Checkout" contribution.

Change

// Stock Check
if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
$products = $_SESSION['cart']->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
to

// Stock Check
if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
$products = $_SESSION['cart']->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {

  // Added to allow individual stock of different attributes
  unset($attributes);
  if(is_array($products[$i]['attributes'])) {
      $attributes = $products[$i]['attributes'];
  } else  {
      $attributes = '';
  }
  // End change

  if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'], $attributes)) {
	  zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));

16 Mar 2009, 12:10 PM
#642
surrealdesign avatar

surrealdesign

New Zenner

Join Date:
Jan 2009
Posts:
6
Plugin Contributions:
0

Re: Stocks by attributes

Hey Kellan,

I've read back over everything, installed the coding as per pg 56 and 57... and still having a few issues, hoping you might be able to help :)

I got it to the point where it states (1 in stock) etc beside the item, however, when it does that it displays the attribute twice, once with nothing and once with the (1 in stock) element... I can't figure out why this is.

Also, I don't know if I've missed this (reading so many pages makes it easy to miss things) But is there any way that I can get it so that when an option is selected in the first drop down menu, it alters what is available in the second drop down menu... ie; select a size from the first menu, and only 1 colour is avail from the second menu... I dunno whether its all wishful thinking to get this much stuff hehe.

TIA,
Nyssa
(test site; http://www.sabrerose.com/testing )

16 Mar 2009, 2:10 PM
#643
sonjamichelle avatar

sonjamichelle

New Zenner

Join Date:
Mar 2009
Posts:
21
Plugin Contributions:
0

Re: Stocks by attributes

I've been banging my head over this issue for a couple of days and I really haven't found a definitive answer.

I have stock_by_attributes installed and it seems to be running just fine. However when ever I edit my quantities, for all attributes after I hit submit I get the following error.

[quote[
att: 1386|1390|1389|1388|1387

Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/o/n/sonjamichelle/html/catalog/admin/products_with_attributes_stock.php:193) in /home/content/s/o/n/sonjamichelle/html/catalog/admin/includes/functions/general.php on line 21
[/quote]

I've looked through several files to find whitespace after the ending ?> and only found one instance. Though that didn't fix the problem.

It only does this when I choose to apply the quantity to "all". If I choose a single attribute, after hitting submit, I'm brought back to the list of products.

16 Mar 2009, 2:26 PM
#644
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stocks by attributes

sonjamichelle:

Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/o/n/sonjamichelle/html/catalog/admin/products_with_attributes_stock.php:193) in /home/content/s/o/n/sonjamichelle/html/catalog/admin/includes/functions/general.php on line 21You're using the multiadd variant of this mod. Unfortunately the author left a debug statement in at line 193 of admin/products_with_attributes_stock.php. It's this that is triggering the errors. You can just delete it.

17 Mar 2009, 6:45 PM
#645
the44chris avatar

the44chris

New Zenner

Join Date:
Mar 2009
Posts:
5
Plugin Contributions:
0

Re: Stocks by attributes

Hi guys,

I was wondering if somebody could help me with a pretty simple request.

The site I have zencart installed on will be for vendors, and so I would like to print a table on the product info pages that lists the stock of all the possible combos of product variants. I know that sql values have to be called from the 'products with attributes stock' table and displayed in a loop, I'm just not sure of the php syntax needed to do this.

I've done a pretty good amount of errant attempts, mainly just by copying the table display code from the admin portion and trying to display that on the product page after the bulleted list. It doesn't work.

I will only have two attributes, size and color. Thanks for any help on this one.

17 Mar 2009, 7:07 PM
#646
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Stocks by attributes

Hi the44chris.... you should post a link to your site to help anyone that would try to assist....

17 Mar 2009, 8:26 PM
#647
the44chris avatar

the44chris

New Zenner

Join Date:
Mar 2009
Posts:
5
Plugin Contributions:
0

Re: Stocks by attributes

Thanks for the reply limelites.

As of now, I just have the site running on my localhost. It is just a stock install of zencart though, with easypopulate and stock by attributes installed.

The pre-installed zencart item I was trying to get it to work with was the "Hewlett Packard - by attributes SALE" product with the color and memory attributes. So for example with that product I would like something similar to the following html:

<table> <tr> <th>Color</th> <th>Memory</th> <th>Units in Stock</th></tr> <tr> <td>Blue</td> <td>4mb</td> <td>15</td></tr> </table>

...and etc. for the rest of the possible attribute combinations.

Just to list the availability, no radio buttons or anything for selection of items in the list.

Thanks again
-Chris

17 Mar 2009, 9:27 PM
#648
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Stocks by attributes

Chris, I'm not sure why you want this, it seems the built in ability to use a drop down menu which lists all the available attributes in the drop down list would be easier for the customer to use and would certainly save space.

The simplest way to list the attributes would of course be to enter them in the description of the item using an HTML table.

That's the way I do it on my own site, I enter a table in the description for each product and if it's available in other sizes and/or colours then I just mention it in the ad.

How you would get php scripts to generate a list of available attributes and insert them in the description is going to be tricky. Each item would have differently sized lists, different headings too, so where would you put the list exactly?

As for 'Quantity in stock', this display can be turned on or off from the admin area at Admin> Catalog> Product Types> General Products> Edit Layout> Show Quantity in Stock Display Quantity in Stock on Product Info to 1..... For this to work though, you need to make sure when you're listing each product that you set Product Qty Maximum: to 0 (unlimited).

17 Mar 2009, 10:15 PM
#649
robrem avatar

robrem

New Zenner

Join Date:
Mar 2009
Location:
Taos, NM
Posts:
19
Plugin Contributions:
0

Re: Stocks by attributes

I recently installed Zen Cart and have made some changes to customize it to my needs, including installing the Cherry Zen add on. I've created a test product and a real product with attributes. I just tried to install stock by attributes but when I go to the catalog tab "Products with attributes: does not show up. Obviously I've messed up something in the installation - any ideas on how to troubleshoot this?

17 Mar 2009, 10:52 PM
#650
robrem avatar

robrem

New Zenner

Join Date:
Mar 2009
Location:
Taos, NM
Posts:
19
Plugin Contributions:
0

Re: Stocks by attributes

Hey, You can ignore the previous post. I went back through and compared my uploads and found a file placed in the wrong folder. I tried again and the tab showed up but could not find the page, another round of comparing and I found another file that just didn't upload for some reason. After looking through this thread I'm curious if I will have some of the O/S display problems others have had or if the newest version (4.6) fixed it.

18 Mar 2009, 12:23 AM
#651
the44chris avatar

the44chris

New Zenner

Join Date:
Mar 2009
Posts:
5
Plugin Contributions:
0

Re: Stocks by attributes

Thanks again for the reply limelites,

My main problem with the current setup is that you cannot display the quantity in stock of a particular attribute, rather, it adds up stock from all of the attributes and displays that total, which is almost useless in my opinion.

I thought of creating a table that displays the stock of each individual attribute combination so that a company can login and immediately see if we have available stock of that particular combination without the need of entering it into the cart to see if it's in stock.

The chart could also be used by the company selling the product to a customer to recommend a smaller size or different color if the desired size and color is out of stock with all of the information in front of them.

I think displaying something like this would be easier than figuring out how to update that Qty display you are referring to to show specific stock of a combination of attributes. I was hoping to just create a "select * from... echo...while blah blah" command right after the unordered list that appears on the product page.

Thanks

18 Mar 2009, 9:35 PM
#652
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Stocks by attributes

I am using the "Stock by Attributes v4.7 (MULTIADD)". My client is using the product variant feature to track inventory as she has products with multiple combinations of attributes to track stock for.
For example:
size=S color=Pink -- Qty in stock = 3
size=M color=Pink -- Qty in stock = 5

This mod is is working JUST FINE for her.. However, it would be nice to refine the customer's experience just a little.

I've read through this whole thread and the other "Stock by Attributes" thread as well, and I have ONE question. I have seen several posted solutions to NOT display attributes when there is no available stock for that ONE attribute, and I have seen a few solutions to display the quantities of available stock for individual attribute.

What I do NOT see (and need to confirm that it does not in fact exist) is a way to apply this sort of logic to product variants. I would like for example to not allow the customer to add a particular product variant to the cart at all if it is not in stock.

Currently I have the following settings under Configuration > Stock:> Check stock level = true

Subtract stock = true
Allow Checkout = false
Mark product out of stock = ***
Stock Re-order level = 5
Show available stock level in cart when less than order = true
Products status in Catalog when out of stock should be set to = 0
Show Sold Out Image in place of Add to Cart = 1Now this works OKAY to notify customers that the product variant they requested is out of stock or let's them know how many are in stock if they selected more than what's available. However, the customer doesn't know this until after they add the product variant to their cart.

It would be nice to notify the customer before they add the product to their cart. Did I miss this?? Has someone already posted a solution that allows me to prevent a variant from being added to the cart or better yet lets the customer know before they click "Add to Cart" that the variant they want is not in stock.

18 Mar 2009, 10:23 PM
#653
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Stocks by attributes

Just another thought.. Is there a way to display on the product details page what the administrator sees in "Stock by Attributes" admin. In other words, is there a way to display the available variants shown in the admin section?? (in a grid or tabular format would be ideal) Then one could choose whether or not to display ALL variants or only the ones in stock currently.

For example: Here's what I see for one particular product.
Length: 16"
Size: 3.5" x 4"
Texture: Kinky Straight
Quantity Available = 0

Length: 18"
Size: 3.5" x 4"
Texture: Kinky Straight
Quantity Available = 0

Length: 16"
Size: 3.5" x 4"
Texture: Fresh Relaxed
Quantity Available = 0

Length: 18"
Size: 3.5" x 4"
Texture: Fresh Relaxed
Quantity Available = 0

Length: 16"
Size: 3.5" x 4"
Texture: Fresh Relaxed X^2
Quantity Available = 0

Length: 18"
Size: 3.5" x 4"
Texture: Fresh Relaxed X^2
Quantity Available = 0

Length: 16"
Size: 3.5" x 4"
Texture: Straight
Quantity Available = 0

19 Mar 2009, 12:03 AM
#654
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Stocks by attributes

the44chris:

My main problem with the current setup is that you cannot display the quantity in stock of a particular attribute, rather, it adds up stock from all of the attributes and displays that total, which is almost useless in my opinion.

I thought of creating a table that displays the stock of each individual attribute combination so that a company can login and immediately see if we have available stock of that particular combination without the need of entering it into the cart to see if it's in stock.
I shoulda read your post a little more carefully.. It looks like you and I are asking for the same thing..:laugh:

limelites:

Chris, I'm not sure why you want this, it seems the built in ability to use a drop down menu which lists all the available attributes in the drop down list would be easier for the customer to use and would certainly save space.That's easy.. When you are tracking your stock by a combination of attributes, the drop down lists displaying the quantity of each attribute won't work as the stock is being tracked by a combination of attributes. (see the example I posted above)

limelites:

The simplest way to list the attributes would of course be to enter them in the description of the item using an HTML table. Of course we could create a table for each product, but this is a NIGHTMARE to manage. It is difficult even when you have a few products (let alone the store owners with HUNDREDS or even THOUSANDS of products to manage) all with multiple possible attribute combinations.

limelites:

How you would get php scripts to generate a list of available attributes and insert them in the description is going to be tricky. Each item would have differently sized lists, different headings too, so where would you put the list exactly?While I don't know PHP, I don't think that either Chris or I are looking to do anything terribly fancy here.. We can already view what's available for each product variant in the admin, would it really present a technical challenge (for someone who knows how to do this of course..:D) to include that information on the product details page??

19 Mar 2009, 1:28 PM
#655
the44chris avatar

the44chris

New Zenner

Join Date:
Mar 2009
Posts:
5
Plugin Contributions:
0

Re: Stocks by attributes

Diva,

Exactly what I was thinking. An html table in the description would in fact be a nightmare to manage, such is the appeal of a dynamically generated php one.

I think that I could even figure this out with my VERY limited knowledge of php, it would just take me a very long time and I would pretty much be starting only with my knowledge of html.

-Chris

19 Mar 2009, 3:21 PM
#656
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Stocks by attributes

the44chris:

Exactly what I was thinking. An html table in the description would in fact be a nightmare to manage, such is the appeal of a dynamically generated php one.Absolutely..:yes: While this is not the BEST solution, I do think it's the simplest way to get to what we are seeking.

IMO doing anything else (while desirable) is tantamount to a serious re-write of this add-on. With Zen Cart v2.0 having much more advanced inventory management features, a re-write of this mod would seem to be a bit of a time waster. So for me I'll go for the low hanging fruit.. (especially since it would solve my issue) Exposing the available inventory for products which are tracked by a combo of more than one attribute on the product detail page will solve my problem just fine.. A little CSS magic, and we can make this solution quite nice..:cool:

the44chris:

I think that I could even figure this out with my VERY limited knowledge of php, it would just take me a very long time and I would pretty much be starting only with my knowledge of html.

-ChrisI wish I was as confident as you!:laugh: I know WHAT needs to be done.. I'm just not sure know HOW to do it..:no: But I'm willing to mess around and see if I get lucky..:laugh: If I can't guess at a solution, then I am willing to seek "professional" (AKA paid) assistance:laugh:..

19 Mar 2009, 4:53 PM
#657
the44chris avatar

the44chris

New Zenner

Join Date:
Mar 2009
Posts:
5
Plugin Contributions:
0

Re: Stocks by attributes

Well, what we want to display is basically an exact copy of the sql table "products_with_attributes_stock" with the option name displayed instead of the "stock_attributes" Field. You can see the table through phpMyAdmin.

That info would go into the php file:

tpl_product_info_display.php

located...
/includes/templates/template_default/templates

You can see where the information for the bulleted list after the product description comes from. I would suppose that another php command could just be created right after the closing tag of the "Manufactured By" php command.

Then it is just a matter of getting the syntax correct for displaying mysql information in tabular format using php. Examples can be found everywhere on the internet for this.

That's what I've figured out so far, It's not much. I'll try to do some more work on it later tonight and post any findings I may come across.

-Chris

19 Mar 2009, 8:05 PM
#658
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Stocks by attributes

Dang dude!! You are DEFINITELY braver than me.. :laugh: I am REALLY thinking that I may need to enlist some PHP help.. to do this.. It would probably take a PHP genius a hot second to do this while I was still futzing around with it.. :laugh:

the44chris:

Well, what we want to display is basically an exact copy of the sql table "products_with_attributes_stock" with the option name displayed instead of the "stock_attributes" Field. You can see the table through phpMyAdmin.

That info would go into the php file:

tpl_product_info_display.php

located...
/includes/templates/template_default/templates

You can see where the information for the bulleted list after the product description comes from. I would suppose that another php command could just be created right after the closing tag of the "Manufactured By" php command.

Then it is just a matter of getting the syntax correct for displaying mysql information in tabular format using php. Examples can be found everywhere on the internet for this.

That's what I've figured out so far, It's not much. I'll try to do some more work on it later tonight and post any findings I may come across.

-Chris

20 Mar 2009, 1:58 AM
#659
chuckienorton avatar

chuckienorton

New Zenner

Join Date:
Dec 2007
Posts:
54
Plugin Contributions:
0

Re: Stocks by attributes

cropinstop:

Found the solution.

An "attribute stock exceeded" check is missing from "includes/modules/pages/checkout/header_php.php". This file is unique to the "Fast and Easy Checkout" contribution.

Change ....

@cropinstop: Thanks for reply! I'm having a problem with FEC: my installation of FEC made the checkout process STOP checking out the 'stock for attributes' stock COMPLETELY! So if there are stock left for an attribute and someone checks out, it doesn't reduce the stock. Any clue what's happening?

20 Mar 2009, 2:46 PM
#660
stika avatar

stika

New Zenner

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

Re: Stocks by attributes

Somebody was asking the reason why Stock by Attributes cannot delete variants in admin when you are using your own language that is not english.

The problem is in confirm deletion form which is returning the word 'Yes' translated in your own language.

The deletion routine is currently waiting for the string 'Yes' and not 'Si' or 'Oui' or whatever translation of 'Yes' is in your language so you need to change the line 309 of /admin/produtcs_with_attributes_stock.php.

if($_POST['confirm'] == 'Yes')

to

if($_POST['confirm'] == TEXT_YES)

Zencart 1.3.8a italian with SBA 4.7 Multi

Regards and always many thanks for this great mods