Zen Cart Logo
Forums / All Other Contributions/Addons / Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Views: 658,734

Results 321 to 340 of 3,609
4 Dec 2007, 3:54 AM
#321
rian_c avatar

rian_c

New Zenner

Join Date:
Nov 2007
Posts:
1
Plugin Contributions:
0

Stock by Attribute v4.0 addon for v1.3.5-1.3.9

hello,
I am setting up a new store with ZenCart 1.3.7 and have installed the attributeStock3.01.1 (by danielcor). Everything is working fine on the backend and we can assign quantities to the attributes for each product. However, on the product pages, the dropdown boxes are empty (even though stock is non-zero). I've got all of the files for the module uploaded into the proper folder names, etc.

Does anyone know how to fix this and if there is a newer version of this module that might help? Thanks,

rian_c

4 Dec 2007, 11:01 AM
#322
kuroi avatar

kuroi

Totally Zenned

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

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

rogerh:

You lost me here... what "extra step"? Backup files? Oh, do you mean the ones I have named "OLD"? I don't understand how those are being executed.The construction of a Zen Cart page is a very complex business. The control code whizzes round your site picking up components from all over the place. In some places it just picks up files that match specific naming conventions, in others it picks up everything in a relevant folder.

For this reason it is dangerous to leave backup files mixed in with your live files. Zen Cart doesn't have any logic to tell it that the insertion of OLD into a filename means that you don't want it executed.

By all means keep backups, but keep them separate from your live (or in this case development) site.

4 Dec 2007, 11:09 AM
#323
kuroi avatar

kuroi

Totally Zenned

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

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

rian_c:

hello,
I am setting up a new store with ZenCart 1.3.7 and have installed the attributeStock3.01.1 (by danielcor). Everything is working fine on the backend and we can assign quantities to the attributes for each product. However, on the product pages, the dropdown boxes are empty (even though stock is non-zero). I've got all of the files for the module uploaded into the proper folder names, etc.

Does anyone know how to fix this and if there is a newer version of this module that might help? Thanks,

rian_cSorry Rian, but this is the support thread for Stock by Attributes not Danielcor's attributeStock (I don't know of any support for the mod that you are using).

All I can tell you is that the module that you are using is a fairly recent update, and I believe that you have the latest version. However, I also believe that the update, like the original was developed for an earlier version of Zen Cart and anything to do with attribute stock is likely to be very sensitive to precisely matching mod versions with the version of Zen Cart for which they were developed.

Anybody know differently?

10 Dec 2007, 11:06 PM
#324
aesthetics avatar

aesthetics

New Zenner

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

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Alright, another stock-by-attribute question -- unfortunately I think I might already know the answer, but I want to double-check!

I have products with multiple attributes. Can I stock by only one of those attributes?

For example, we have titanium barbells in different lengths. Our stock number should be associated with the length. We also, however, custom-anodize these pieces, so we have an attribute drop-down for titanium color options. Is there a way to stock by the length, but NOT by the color?

11 Dec 2007, 11:17 AM
#325
kuroi avatar

kuroi

Totally Zenned

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

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

aesthetics:

I have products with multiple attributes. Can I stock by only one of those attributes?Unfortunately not.

12 Jan 2008, 12:30 AM
#326
milobloom avatar

milobloom

Totally Zenned

Join Date:
Feb 2004
Posts:
1,267
Plugin Contributions:
1

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

I didn't realize that every product had to have a quantity when I installed this mod.

Having a store with too many products with lots of attributes allready makes this mod to hard to deal with.

How can I either,

  1. Make it so that everything defaults to a high quantity

or

  1. Uninstall this mod - or at least make it so that it doesn't make all of my products out of stock anymore.

One thought I was thinking of if it cannot be uninstalled is allow checkout if its out of stock and delete the Red box that says so... If so, which files do I edit?

12 Jan 2008, 12:47 AM
#327
kuroi avatar

kuroi

Totally Zenned

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

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

milobloom:

I didn't realize that every product had to have a quantity when I installed this mod.Every product has to have a quantity in Zen Cart, whether you have this mod installed or not, even if that quantity is zero.

Are you using a version of this mod prior to 4.6 when you needed to enter attribute stock for each product that had attributes or else the product stock was treated as zero. If so, you may want to upgrade, because that's no longer the case. Now you enter attribute stock only for those products where you want to manage stock at attribute level and then only for those attribute combinations that are non-zero.

However, if you want to uninstall it, a list of the files that have been overwritten is included in the Stock by Attribute readme and on the Wiki page specifically so that you know which ones to replace from your original Zen Cart release package.

12 Jan 2008, 1:31 AM
#328
milobloom avatar

milobloom

Totally Zenned

Join Date:
Feb 2004
Posts:
1,267
Plugin Contributions:
1

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Oh. ok that should have been obvious.

Thanks.

17 Jan 2008, 6:08 PM
#329
01011010 avatar

01011010

New Zenner

Join Date:
Aug 2007
Posts:
52
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

70 colors, 9 sizes, and various other customization attributes; what do you get when you mix all these together, and multiply them by a few hundred products?

Answer: A million, trillion, zillion combinations, that must be entered one at a time.

Aside from hiring 3,000 third-world laborers to enter all these combinations, what are my options? I don't actually need (or even want) to track stock, I simply need to keep my customers from purchasing a few unavailable combinations.

For an example, I want to sell a t-shirt. This t-shirt comes in many different colors, sizes Small through 5XL. However, the color "Eggplant" is only available up to 3XL.

How can I keep people from buying 4XL and 5XL Eggplant t-shirts, which simply do not exist?

I'm trying to get this all working with Product Attribute Grid.

Thanks,
01011010

18 Jan 2008, 2:33 AM
#330
taipa avatar

taipa

New Zenner

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

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

poosk:

Ok I've tried this like a million times and can't get it to work..

tbrides:

Hello,

I've a solution for adding Sold Out on the attribute if the stock of it is 0.
It works for dropdown boxes, radio buttons and checkboxes.

I've modified kuroi's attributes.php file, adding the suggestions of other people and figuring it out for dropdowns.

  • First you need to add this to:
    includes\languages\english\custom\product_info.php

if product_info.php is not there it will be in
includes\languages\english\product_info.php

Once you have added the below move the file to your custom directory

define('TEXT_ATTRIBUTES_NOT_IN_STOCK',' Sold Out');

> > 
> > 
> > - I've changed the function  "function zen_draw_pull_down_menu"      in includes\functions\html_output.php
> > 
> > 
> > ```php
function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
    $field = '<select name="' . zen_output_string($name) . '"';
    $soldout = "";
    if (zen_not_null($parameters)) $field .= ' ' . $parameters;

    $field .= '>' . "\n";

    if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

    for ($i=0, $n=sizeof($values); $i<$n; $i++) {
    /* Added by TB on 16/2/2007 */
    /*need to check if Sold Out occurs in the option tag for the dropdown*/
    if(strpos($values[$i]['text'], "Sold Out")) $soldout = 'class ="red bold"';
    else $soldout = "";
      $field .= '  <option '.$soldout.' value="' . zen_output_string($values[$i]['id']) . '"';
      if ($default == $values[$i]['id']) {
        $field .= ' selected="selected"';
      }

      $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>' . "\n";
    }
    $field .= '</select>' . "\n";

    if ($required == true) $field .= TEXT_FIELD_REQUIRED;

    return $field;
  }
  • Then I modified kuroi's attributes.php file. Located in
    includes\modules\custom\attributes.php.
    See attached. Rename your old one to something like attributes.php-old and upload this one.

  • Then I added the class .red to my stylesheet, which just sets color:red

If anybody cares to try this in a test environment for me after they have installed the stock by attributes module.
Please let me know how it goes. It should work, works for me, but no guarantees.

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/ctr/public_html/store/includes/functions/html_output.php on line 510

I get this same error too.

Is there a working fix for Zen 1.3.8 and Stock by Attributes v4.7 to make it mark the attributes that are sold out? Or remove from the drop down on the product page or something? It's very annoying for customers to add a product to their cart, and not find out it's sold out until later when they go to check out.

18 Jan 2008, 11:52 AM
#331
kuroi avatar

kuroi

Totally Zenned

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

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

01011010:

Aside from hiring 3,000 third-world laborers to enter all these combinations, what are my options? I don't actually need (or even want) to track stock, I simply need to keep my customers from purchasing a few unavailable combinations.Set the stock decrement flag in the Admin to false and then EITHER:

Write yourself a small SQL script to insert a line into the attributes stock table with more stock than is ever likely to be required for a single order, wrap your SQL script in a PHP script that loops to create a record for every conceivable option, delete those combinations that don't actually exist OR

Create a spreadsheet with all possible options, export it to a CSV file, use a database admin tool (e.g. phpMyAdmin) to import it to the attributes stock table.

22 Jan 2008, 7:53 PM
#332
philip24 avatar

philip24

New Zenner

Join Date:
Jan 2008
Posts:
36
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Hi.

I am running zen cart 1.3.7, so I have installed version 4.6 of this contribution. Installation went smoothly, the admin side seems to be ok but when I make a test purchase and go to checkout, I get the following error.

Fatal error: Cannot redeclare class order in /var/www/html/shop/includes/classes/order.php on line 1037

Can someone please tell me what I have messed up?

Philip

22 Jan 2008, 8:00 PM
#333
kuroi avatar

kuroi

Totally Zenned

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

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

philip24:

I am running zen cart 1.3.7, so I have installed version 4.6 of this contribution. Installation went smoothly, the admin side seems to be ok but when I make a test purchase and go to checkout, I get the following error.

Fatal error: Cannot redeclare class order in /var/www/html/shop/includes/classes/order.php on line 1037Are you keeping a backup files in your includes/classes folder, or elsewhere on your live site?

22 Jan 2008, 8:13 PM
#334
philip24 avatar

philip24

New Zenner

Join Date:
Jan 2008
Posts:
36
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

kuroi:

Are you keeping a backup files in your includes/classes folder, or elsewhere on your live site?

Yes, thank goodness, I have. I learnt one thing at least!!

23 Jan 2008, 1:21 AM
#335
kuroi avatar

kuroi

Totally Zenned

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

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

philip24:

Yes, thank goodness, I have. I learnt one thing at least!!Errrr. My point is that you shouldn't. See post #324 which explains the dangers and why this could be the reason that you are having this problem.

23 Jan 2008, 9:36 AM
#336
philip24 avatar

philip24

New Zenner

Join Date:
Jan 2008
Posts:
36
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

kuroi:

Errrr. My point is that you shouldn't. See post #324 which explains the dangers and why this could be the reason that you are having this problem.

Thanks very much Kuroi - that did the trick. Another valuable lesson learnt!!!

Philip

24 Jan 2008, 12:51 PM
#337
cosmicegg avatar

cosmicegg

New Zenner

Join Date:
Jun 2007
Posts:
4
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Hi, thank you for the products with attributes stock mod:-) i was just wondering if you know where i am going wrong with something. apparently (randomly and not very often) an attribute will be set to 0 but the user can still buy it with that attribute - i have set my cart to not allow checkout on out of stock items and it works for the vast majority o the time but sometimes it doesnt.

also when an attribute goes out of stock most of the time it shows up as ":" as opposed to the attribute name and sometimes it still has a stock level (although it doesnt show up to the user)

just had a brand new problem - i had 1 item with an attribute stock of 1 but the user ordered it x2 and now the stock says -1..any clues?

hope that made sense!

thanks for any help you can give:-)
just let me know if you need any details.

24 Jan 2008, 1:35 PM
#338
kuroi avatar

kuroi

Totally Zenned

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

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

cosmicegg:

(randomly and not very often) an attribute will be set to 0 but the user can still buy it with that attribute - i have set my cart to not allow checkout on out of stock items and it works for the vast majority o the time but sometimes it doesnt.

just had a brand new problem - i had 1 item with an attribute stock of 1 but the user ordered it x2 and now the stock says -1..any clues?These are common issues. But in every case that I have investigated (quite a few now) it has turned out to be either an installation problem (see post #308) or a problem with keeping backup files in inappropriate places i.e. on a live site (see post #319).

24 Jan 2008, 2:16 PM
#339
cosmicegg avatar

cosmicegg

New Zenner

Join Date:
Jun 2007
Posts:
4
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

kuroi:

These are common issues. But in every case that I have investigated (quite a few now) it has turned out to be either an installation problem (see post #308) or a problem with keeping backup files in inappropriate places i.e. on a live site (see post #319).

looks good, thank you :smile:

25 Jan 2008, 11:28 AM
#340
vivaraquel avatar

vivaraquel

Zen Follower

Join Date:
Sep 2004
Location:
Australia
Posts:
305
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Taipa:

I get this same error too.

Is there a working fix for Zen 1.3.8 and Stock by Attributes v4.7 to make it mark the attributes that are sold out? Or remove from the drop down on the product page or something? It's very annoying for customers to add a product to their cart, and not find out it's sold out until later when they go to check out.

Ok, you're gonna hate me for this but ...

I had this mod installed in my site before i redid it all and haven't bothered with it again as it gave me an error message when deleting items for which I had to hit my back button and hit delete again for it to delete.

But I remember adding another mod which made it so that if an attribute was not in stock it wouldn't show up in the drop down menu. And if someone added more than the available stock of an attribute, on the shopping cart window it would come up in red (or whatever color you want it to be) that the amount in the cart is not available and it would actually say how many were available.

The bad news is I don't remember what the mod was. You'll have to read through the downloads section, that's how I found it.

Good luck.