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: 660,384

Results 3,421 to 3,440 of 3,609
28 Oct 2021, 7:58 AM
#3421
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

cubmanky:

Would love to see a demo or can someone answer a question. I was told in another form that this program would do this.

Have product A, B ,and C
You select A which has a color attribute with the options of red, green, and blue. When you click on red it then will give you a image attribute with the options of 1, 2, 3. If you were to pick green it would give you the options for 4, 5, 6.

Will this do the above?
Yes, absolutely yes it supports this type of handling. It is accomplished through the use of the sba sequenced dropdown filtering for product that have multiple attributes which also is the default setting. Basically when a product has two or more option names (color and whatever group represents 1 through 6 above) then selection of the first choice will affect the option values available for the second choice.

I have it installed on one of my development servers but was going to put a sample product on my lieve server with associated controls to prevent actually purchasing one of the items. I don't need to deal with that whole issue or also "why haven't I received this free item" type thing...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

28 Oct 2021, 5:02 PM
#3422
cubmanky avatar

cubmanky

Zen Follower

Join Date:
Jan 2014
Posts:
224
Plugin Contributions:
0

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

Ok, so a little more thought, below is what i need.
Click on item Font XYZ
You have a drop down for height, options are 1, 2, and 3
For each height option i need it to bring up a test option So you click 2 it would bring up the 2 inch text from the option names that would give you a test box.

If you click the 3 it would bring up a 3 inch text box.
I know I can control price for price for the attributes in the 1, 2, and 3, but if I set the price per letter when a person enters test it will not add it to the cart. So I have to do a single text for each of the height options

28 Oct 2021, 5:35 PM
#3423
cubmanky avatar

cubmanky

Zen Follower

Join Date:
Jan 2014
Posts:
224
Plugin Contributions:
0

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

Just to say I did the Full/Upgrade DB Install Do I need to run any of the other sql files? How do I setup the selection of the first choice will affect the option values available for the second choice. Second value is a text box

28 Oct 2021, 9:05 PM
#3424
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

cubmanky:

Just to say I did the Full/Upgrade DB Install Do I need to run any of the other sql files? How do I setup the selection of the first choice will affect the option values available for the second choice. Second value is a text box
This module is primarily for tracking stock of items that have attributes. From the previous description of need, it seems that the stock aspect for usage of this is not really a need, but the other capability offered is. So, that said, likely when creating desirable variants, will want to use huge quantities.

So, then comes the issue of addressing the request. As is, because core Zen Cart software doesn't offer the ability to multiply attribute cost factors, the "simplest" method to the above is to have each text box have its own price per character setting. I would have suggested possibly using price factors as well, but that too has its internal "issues". So... I would envision that there would be one option name of font size and three text boxes or however many support the option values. Then, to add a variant that uses the chosen font size and the associated text box at the above absurd quantity or as befits the product quantity that is associated. A little more on that in a moment.

Ok, so what this does on the product page though is display an option name of font size and one each text box for calculations. Problem there is that customer doesn't really know what to do with that configuration. Further, there is the issue that if they select 1, put text in box "1" then selecting 2 requires re-entry of the text... And that's before even thinking of how to make the process easier for the customer.

The way I see to make it easier for the customer is to offer a single text field where the text is entered, with that content placed in the field that applies to the font size selected. The reason for this is so that the end resulting text field is the only one that should have the desired text to support the calculations, but the user only enters info one time. That all would involve additional javascript/jQuery to shuffle the text around for storage/price calculation and that would also involve hiding the field(s) from the customer's view to ease the process.

Lastly though, because of what I said in the first paragraph, I'm not so sure that the sought after dependent attributes is really what addresses implementation sought. E.g., there isn't really a "dependency" about that stock. There's a relationship between atribute selection, but its more about the internals of Zen Cart than the product itself. As far as the product, font size and entered text is the dependency, pricing based on the font size is what is actually being addressed.

THAT I actually think could be addressed through the notifier/observer system at least as far as the shopping cart and order classes are concerned.

Anyways, while I am now in ramble mode, let me address one of the other parts a little more. Adding variants to force availability. When the store is setup to prevent checkout with no available stock, then to prevent a combination from being chosen to check out, if that combination has no stock available, it will be prevented. Such as a stock of 0. A conbination that is not defined can check out so long as the core product has sufficient stock remaining. Further with that, if a variant has quantity, but the core product does not, then the variant can not be checked out. This is why the admin screen for variants offers info about how the sum of variants relates to the total available product. Not everyone sells product the same way or with the same dependency of variants to stock. For example, may have a thousand beads for a necklace, but only 20 strands of necklace that can be sold. That leads to a shortcoming of this module as thus far implemented. Its not (yet) possible to identify a central container of say red beads that could be used across multiple product ina stock tracing aspect. It is possible to indicate an unlimited number of such an option value so that the stock would not be internally tracked, but I digress from your needs...

So.. in summary, based on the operational need, I don't see that this module really offers the best solution for what has been described. I would suggest that the observer system for attribute related aspects be considered to support designating the attribute's cost based on the selection made in the first dropdown. This is based on the characteristic that there doesn't appear to be a need to track the stock of these attributes, that there are ways to swap out the image of the entered text which are going to naturally need to use javascript/jquery (unless a popup window is shown when a sample is desired to be seen) and the need to incorporate text population to the correct field(s) to provide a decent customer experience.

As to seeing the most capability of this software in attribute setup, setting the option name type to the SBA Simple Select (Dropdown) type offers the more central stock dependency of displaying the option value quantity available based on previous/earlier selections. One caveat that remains at the moment is that the first option name should not be a read-only type option name. Such can be the second on, but not first).

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

29 Oct 2021, 3:25 AM
#3425
cubmanky avatar

cubmanky

Zen Follower

Join Date:
Jan 2014
Posts:
224
Plugin Contributions:
0

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

So I fallow somewhat. for attribute for text its a charge per letter. and its a different charge according to the height. I'm just trying to not have to make a single item for all ten heights

29 Oct 2021, 8:00 AM
#3426
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

cubmanky:

So I fallow somewhat. for attribute for text its a charge per letter. and its a different charge according to the height. I'm just trying to not have to make a single item for all ten heights
My turn to indicate that somewhat follow. Not sure about the last sentence. My thought was that a single product would exist where that product has two option names: height and text. The height option name would have your ten different sizes. The text option name would get populated by the customer(s).

I haven't gone looking for your site, I assume that the above is desired as it would be "simple" in day-to-day management although have to come through the remainder of forcing the calculations and storage of those results. At the same time would having it all combined like that in some way significantly reduce the number of product sold? For some reason I envision a store that has like 50-100 product currently that might be reduced to like 10. :) while seeing something like that would become very manageable, I could see how it might be undesirable.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

29 Oct 2021, 11:51 AM
#3427
cubmanky avatar

cubmanky

Zen Follower

Join Date:
Jan 2014
Posts:
224
Plugin Contributions:
0

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

Yes that’s what I would like. Only issue is with the text box it’s a charge per letter each heigh has a different. Price per letter. I can set up the drop box easy for the height. But for the text I would have to show one line for each height so it would pull the correct charge for height. https://thecubden.org/store1 is my temporary store I’m working with.

13 Mar 2022, 8:49 PM
#3428
frumious avatar

frumious

New Zenner

Join Date:
Jun 2020
Location:
Scotland
Posts:
11
Plugin Contributions:
0

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

SBA Version 1.5.4 for Zen Cart Version 1.5.7d

Just upgraded my zencart from 1.5.6 and updated SBA to current version

All works well except the checkout confirmation fails giving error
Call to undefined function zen_get_customid() in /includes/templates/my_templates/templates/tpl_checkout_confirmation_default.php :151

Line 151 reads:
if( $tmpCheck != zen_get_customid($order->products[$i]['id'],$attributes) ){
$tmpCheck = zen_get_customid($order->products[$i]['id'],$attributes);
$customid .= ' ' . zen_get_customid($order->products[$i]['id'],$attributes) . ' ';
}

So, any idea why this function is undefined to this script and what can i do about it. Help anyone?

13 Mar 2022, 10:20 PM
#3429
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

frumious:

SBA Version 1.5.4 for Zen Cart Version 1.5.7d

Just upgraded my zencart from 1.5.6 and updated SBA to current version

All works well except the checkout confirmation fails giving error
Call to undefined function zen_get_customid() in /includes/templates/my_templates/templates/tpl_checkout_confirmation_default.php :151

Line 151 reads:
if( $tmpCheck != zen_get_customid($order->products[$i]['id'],$attributes) ){
$tmpCheck = zen_get_customid($order->products[$i]['id'],$attributes);
$customid .= ' ' . zen_get_customid($order->products[$i]['id'],$attributes) . ' ';
}

So, any idea why this function is undefined to this script and what can i do about it. Help anyone?
Should note that there no longer are changes to that file as part of a Zen Cart 1.5.7 installation. It should be restored to its original state.

Additionally, the use of functions has over the last several years transitioned to class methods. If you truly wish to keep that modification (though you may see duplicate results based on how the code has been modified to not need so many file edits), then change:
zen_get_customid
to
$_SESSION['pwas_class2']->zen_get_customid

Really the only template (or template override) modifications still a part of this software are:
includes/templates/YOUR_TEMPLATE/templates/tpl_modules_attributes.php
and
includes/templates/YOUR_TEMPLATE/templates/tpl_shopping_cart_default.php

Further, in the install/upgrade, should (have) use(d) the recent version of the SBA software so that in rebuilding the store to include the plugin, less had to be done.

Even the includes/modules/YOUR_TEMPLATE/attributes.php file is now obsolete and doesn't need to be modified to support this plugin. The base version of the file is all that is needed.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

16 Mar 2022, 8:01 PM
#3430
dave224 avatar

dave224

Zen Follower

Join Date:
Jun 2012
Posts:
481
Plugin Contributions:
0

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

I have a product made up of attributes. The customer can select which attributes they want in the product. They can select one or as many attributes as they want. I want to keep track of the stock of each attribute. I saw the following comment in includes/classes/observers/class.products_with_attributes_stock.php on line 1588 of the June 10, 2021 distribution on github:

// @TODO: at some point to be able to handle combinations of PWAS table items such that there are combinations of records or variants making up a single product.

so I assume the code can not handle this case at this time. Am I correct? Thanks.

16 Mar 2022, 8:15 PM
#3431
dave224 avatar

dave224

Zen Follower

Join Date:
Jun 2012
Posts:
481
Plugin Contributions:
0

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

I have a product made up of attributes. The customer can select which attributes they want in the product. They can select one or as many attributes as they want. I saw the following comment in includes/classes/observers/class.products_with_attributes_stock.php on line 1588 of the June 10, 2021 distribution on github:

// @TODO: at some point to be able to handle combinations of PWAS table items such that there are combinations of records or variants making up a single product.

so I assume the code can not handle this case at this time. Am I correct? Thanks.

16 Mar 2022, 11:21 PM
#3432
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

Dave224:

I have a product made up of attributes. The customer can select which attributes they want in the product. They can select one or as many attributes as they want. I saw the following comment in includes/classes/observers/class.products_with_attributes_stock.php on line 1588 of the June 10, 2021 distribution on github:

// @TODO: at some point to be able to handle combinations of PWAS table items such that there are combinations of records or variants making up a single product.

> so I assume the code can not handle this case at this time. Am I correct? Thanks.

Based on your description of what you want to do this week work for you. I make this statement based on the following (of I express an incorrect assumption then please correct me):
You have a product. 
That product nearly has an infinite number on quantity (most likely to be the sum of your available attributes) 
You have attribute 1 through n where n is the number of attributes available to the customer. 
Every attribute has its own quantity and it is that quantity you want to control, limit or otherwise track. 
So for example attribute 1 has a quantity of 100.
Attribute 2 has a quantity of 200.
Attribute 3 has a quantity of 300.

When making a purchase of the base product a customer may choose attribute 1 and 3 for example. Let's say they order 100 of this product combination. 
After their purchase your stock will be 0, 200, 200 respectively. 
If that is the case then you are good to go. 
If you wanted to limit the purchase though instead to where you only allow purchases where they choose attributes 2 and 3 together and only allow attribute 1 to be purchased alone and say there was an attribute combination of 3 and 4, along with the possibility of purchasing attribute 4 by itself, then that is not currently possible because of the "clash" of the 3 and 4 combination with the ability to sell 4 by itself. 
Now the last other case which is supported is if combinations of attributes are offered but those combinations are ideally discreet, meaning that each combination of attributes has its own stock. The popular example is one of t-shirts where there may be a logo, a size and a color. Such a combination of product (assuming the logo is preprinted) would be discreet because that combination only exists in a given quantity. If though the logo would not be a factor in the total quantity as in it is infinitely available there is a way to make that attribute not count against the stock associated with the size and color... That currently requires a sql command to implement, but it can robustly be used...


For my original product description when populating the attributes you would simply apply the quantity of each attribute by itself so that each attribute has its own quantity. Any attribute that is not given a quantity will be available in the quantity identified to the overall product. Also generally speaking the quantity of a product that can be purchased will be limited to the lesser of the available attribute quantity and the total product quantity. I know a little hard to wrap ones mind around, but.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

17 Mar 2022, 4:31 PM
#3433
dave224 avatar

dave224

Zen Follower

Join Date:
Jun 2012
Posts:
481
Plugin Contributions:
0

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

mc12345678:

Based on your description of what you want to do this week work for you. I make this statement based on the following (of I express an incorrect assumption then please correct me):
You have a product.
That product nearly has an infinite number on quantity (most likely to be the sum of your available attributes)
You have attribute 1 through n where n is the number of attributes available to the customer.
Every attribute has its own quantity and it is that quantity you want to control, limit or otherwise track.
So for example attribute 1 has a quantity of 100.
Attribute 2 has a quantity of 200.
Attribute 3 has a quantity of 300.

When making a purchase of the base product a customer may choose attribute 1 and 3 for example. Let's say they order 100 of this product combination.
After their purchase your stock will be 0, 200, 200 respectively.
If that is the case then you are good to go.
Your assumption is correct. I'll try it. Thanks.

29 May 2022, 7:01 AM
#3434
donw avatar

donw

New Zenner

Join Date:
May 2018
Location:
Melbourne, Australia
Posts:
29
Plugin Contributions:
0

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

Hi everyone, Would appreciate some help with the following:

I need an sql query to generate a report that outputs the total quantity of each colour/size variant of a specific product model number which is manually input when running the query.

e.g output: Model xyz Green
S 3
M 5
L 10 etc

The complexity of this query is beyond my basic sql skills, and it must be something a lot of people need.

The site is running ZC 1.5.5, SBA V 1.54.

Any help will be much appreciated.

29 May 2022, 12:10 PM
#3435
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

donw:

Hi everyone, Would appreciate some help with the following:

I need an sql query to generate a report that outputs the total quantity of each colour/size variant of a specific product model number which is manually input when running the query.

e.g output: Model xyz Green
S 3
M 5
L 10 etc

The complexity of this query is beyond my basic sql skills, and it must be something a lot of people need.

The site is running ZC 1.5.5, SBA V 1.54.

Any help will be much appreciated.

Easy Populate V4 accomplished this also the admin of this plugin provides that information effectively for a specific product. Could modify the use of the unique products_id for possibly the products_model or related field that is not forced to be unique.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

29 May 2022, 3:14 PM
#3436
donw avatar

donw

New Zenner

Join Date:
May 2018
Location:
Melbourne, Australia
Posts:
29
Plugin Contributions:
0

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

mc12345678:

Easy Populate V4 accomplished this also the admin of this plugin provides that information effectively for a specific product. Could modify the use of the unique products_id for possibly the products_model or related field that is not forced to be unique.

Thanks for your reply. I realised I left something important out of what I am wanting the query to do. It should have read: "I need an sql query to generate a report that outputs the total quantity sold of each colour/size variant of a specific product model number which is manually input when running the query."

As background, I want to be able to run the query using the LibreOffice report generator, which I have used successfully for others reports, so trying to modify or use code from another add on is not what I am looking for.

8 Jun 2022, 6:37 PM
#3437
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

donw:

Thanks for your reply. I realised I left something important out of what I am wanting the query to do. It should have read: "I need an sql query to generate a report that outputs the total quantity sold of each colour/size variant of a specific product model number which is manually input when running the query."

As background, I want to be able to run the query using the LibreOffice report generator, which I have used successfully for others reports, so trying to modify or use code from another add on is not what I am looking for.

Do you use sba as basically shown above? Specifically where a product has only one attribute that defines quantity and not where a combination of two or more attributes identify a quantity?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

10 Jun 2022, 4:41 PM
#3438
frumious avatar

frumious

New Zenner

Join Date:
Jun 2020
Location:
Scotland
Posts:
11
Plugin Contributions:
0

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

So this is wierd.
SBA Version 1.5.4 for Zen Cart Version 1.5.7d

When adding a product with a single attribute set (example "Size") to my shopping cart from the product info page, (shopping as a customer,) I get an error pop up saying "The combination of options you have selected is currently out of stock. Please select another combination." It pops-up this error even though there is stock available (in all "Sizes") It's amost like SBA has suddenly decided that all of my products have a combination of attributes set when, in fact, most of them do not. They have a single attribute, or no attributes set.
The errormessage does NOT pop up when adding products that actually do have a combination of attributes set (example "Size" and "Colour") everything works as expected. The item, with the correct attributes set are added to my cart.
It's behaving as though it's expecting a combination of attrubutes (like color and size) for products that only have a single attribute set (like size.)
This is a fairly recent development that i dont understand. No Error logs being generated, just the javascript pop-up.
Incedently, after clicking "okay" on the error message the product gets added to the cart anyway, (if it's in stock) but the pop-up is very confusing to the user. I cant work out why this is happening? Does anyone understand what im talking about and have any ideas?
Thanks

10 Jun 2022, 5:08 PM
#3439
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

frumious:

So this is wierd.
SBA Version 1.5.4 for Zen Cart Version 1.5.7d

When adding a product with a single attribute set (example "Size") to my shopping cart from the product info page, (shopping as a customer,) I get an error pop up saying "The combination of options you have selected is currently out of stock. Please select another combination." It pops-up this error even though there is stock available (in all "Sizes") It's amost like SBA has suddenly decided that all of my products have a combination of attributes set when, in fact, most of them do not. They have a single attribute, or no attributes set.
The errormessage does NOT pop up when adding products that actually do have a combination of attributes set (example "Size" and "Colour") everything works as expected. The item, with the correct attributes set are added to my cart.
It's behaving as though it's expecting a combination of attrubutes (like color and size) for products that only have a single attribute set (like size.)
This is a fairly recent development that i dont understand. No Error logs being generated, just the javascript pop-up.
Incedently, after clicking "okay" on the error message the product gets added to the cart anyway, (if it's in stock) but the pop-up is very confusing to the user. I cant work out why this is happening? Does anyone understand what im talking about and have any ideas?
Thanks
What are your settings for admin -> Configuration -> Dynamic Dropdowns?

Also when saying: "When adding a product with a single attribute set (example "Size") to my shopping cart from the product info page, (shopping as a customer,)..."
Please be more specific as relates to the setup of the product on the admin side. How many option names are associated with the product (regardless the type of option name, though that information is also helpful to have including sort order [sequence] for each). Also, the quantity of each attribute and the total quantity of product for the product in question (total quantity is the value that can be set on the page specific to the product where other factors about the product may be set such as the price of the product, the image for the product, etc...).

Then the other thing is to check to see if there are remnant records in the PWAS table as can be seen using the current/recent version of: admin/products_with_attribute_stock.php and associated admin files. At the bottom of the admin screen, if there are "remnant" combinations, they will be presented for action. I suspect though first that the issue relates to the above configuration for use.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

10 Jun 2022, 5:58 PM
#3440
frumious avatar

frumious

New Zenner

Join Date:
Jun 2020
Location:
Scotland
Posts:
11
Plugin Contributions:
0

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

OMG you nailed it !!!
It was simply an incorrect setting in Dynamic Drop Downs config.
Thank you sooo much.
It's always worth askin...