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,534

Results 2,081 to 2,100 of 3,609
18 Mar 2015, 4:00 PM
#2081
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

Kevin205:

In my version of SBA; deleting a product from catalogue does NOT delete the records belonging to that product in the SBA table. Is there a preferred method of cleaning up / deleting product attribute from SBA table?

That functionality has not yet been ported into the version of SBA for Zc 1.5.1. Which is the version of ZC identified in your signature as your current version. The functionality however is in the version applicable to ZC 1.5.3 and 1.5.4 available at: https://github.com/potteryhouse/stock_by_attribute_1.5.4/tree/mc12345678_ZC154

Remember this is still beta software. The admin/includes/classes/observers/class.products_with_attributes_stock.php file found in that folder contains the actions necessary to accomplish what you are describing (as well as other functions that would require code changes elsewhere in your system or they could be commented out so as not to throw errors.) To use this file the applicable auto_loaders file would also be necessary to kick ZC off to use the above admin class file.

Otherwise, the method I would suggest to remove all attributes applicable to a given product would be to delete all sba table entries for that product using a sql query after backing up the database... Yes, backup the database before deleting...

The expected sql would be:

delete from products_with_attributes_stock where products_id = '[B]20[/B]'

Where 20 would be the product number for the product being deleted... Remember BACKUP before executing.

18 Mar 2015, 7:18 PM
#2082
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

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

mc12345678:

That functionality has not yet been ported into the version of SBA for Zc 1.5.1. Which is the version of ZC identified in your signature as your current version. The functionality however is in the version applicable to ZC 1.5.3 and 1.5.4 available at: https://github.com/potteryhouse/stock_by_attribute_1.5.4/tree/mc12345678_ZC154

Remember this is still beta software. The admin/includes/classes/observers/class.products_with_attributes_stock.php file found in that folder contains the actions necessary to accomplish what you are describing (as well as other functions that would require code changes elsewhere in your system or they could be commented out so as not to throw errors.) To use this file the applicable auto_loaders file would also be necessary to kick ZC off to use the above admin class file.

Otherwise, the method I would suggest to remove all attributes applicable to a given product would be to delete all sba table entries for that product using a sql query after backing up the database... Yes, backup the database before deleting...

The expected sql would be:

delete from products_with_attributes_stock where products_id = '[B]20[/B]'

> 
> Where 20 would be the product number for the product being deleted... Remember BACKUP before executing.

Got it and thank you mc12345678.
19 Mar 2015, 2:38 PM
#2083
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

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

Is it possible to write a query to display the following in one pass?

products_id
products_model
customid
products_attributes_id
options_id
options_values_id
products_options_values_name

I have been trying to get a query to work, but have not been successful.

19 Mar 2015, 3:23 PM
#2084
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

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

I got kicked out while typing!

I have this query working, but only for one product id (52). I need to retrieve all data.

select 
    p.products_id,
    p.products_model,
    pa.products_attributes_id,
    pa.options_values_id,
    pov.products_options_values_name,
    sba.customid,
    sba.quantity
from
    zen_products as p
        left join
    zen_products_attributes as pa ON p.products_id = pa.products_id
        left join
    zen_products_with_attributes_stock as sba ON pa.products_attributes_id = sba.stock_attributes
        left join
    zen_products_options_values as pov ON pa.options_values_id = pov.products_options_values_id
where
    p.products_id = 52; 	

This question might not belong here; but since it performs a query on the SBA table, I thought it could be OK?

19 Mar 2015, 4:41 PM
#2085
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

Assuming that you use only single option names with each productit seems that if you removed the where clause, that the results for all products would be returned with null I thought in the fields where a product was not tracked by SBA, if wanted to return only sBA tracked product information, then would change from p.products_id to sba.products_id so that results only included sba tracked product.

If however product includes multiple option names (multiple attributes) then unfortunately, the query becomes a bit more complex if even possible with the current data structure of SBA. (Stock_attributes contains combinations of attribute information separated by commas instead of an additional table from which to pull the attributes... This has been one of the issues of SBA in times past and why it has been so difficult to overcome some aspects of SBA.

Ideally though that aspect will be resolved as well as additional capability is added... That said, it also can be worked around in it's current state but requires on occasion additional queries based on the product information.

19 Mar 2015, 5:37 PM
#2086
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

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

That did it

replaced
p.products_id = 52

with
p.products_id = sba.products_id

It accomplished what I needed. It now display all SBA related data, Thank you mc12345678

19 Mar 2015, 6:07 PM
#2087
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

Kevin205:

That did it

replaced
p.products_id = 52

with
p.products_id = sba.products_id

> 
> It accomplished what I needed.  It now display all SBA related data,  Thank you  mc12345678

Welcome, still could be made easier (assuming no loss of index power) by swapping the first returned value of p.products_id with sba.products_id and omitting the where statement, but it works.

If I may ask, what's the usage of this query? Also as stated, not all data will be provided by that one query if the store has multiple attributes for a product.
20 Mar 2015, 9:00 PM
#2088
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

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

mc12345678:

Welcome, still could be made easier (assuming no loss of index power) by swapping the first returned value of p.products_id with sba.products_id and omitting the where statement, but it works.

If I may ask, what's the usage of this query? Also as stated, not all data will be provided by that one query if the store has multiple attributes for a product.

Sorry for the late reply.

While trying to eliminate the discontinued items from the SBA table, I could not find a comprehensive report with all of SBA data needed in one report. That is why I tried to generate the report via SQL.

20 Mar 2015, 9:01 PM
#2089
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

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

Can customid data be place in e-mails to clients?

20 Mar 2015, 9:07 PM
#2090
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

Kevin205:

Can customid data be place in e-mails to clients?

Unfortunately the same answer as before basically applies. Currently supported in the version available from the link above, but not yet ported to version 1.5.3 in support of ZC 1.5.1.

20 Mar 2015, 9:09 PM
#2091
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

Kevin205:

Can customid data be place in e-mails to clients?

Gotcha', was trying to see if there was a need for a function to provide that data on a "routine" basis.

20 Mar 2015, 9:14 PM
#2092
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

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

mc12345678:

Unfortunately the same answer as before basically applies. Currently supported in the version available from the link above, but not yet ported to version 1.5.3 in support of ZC 1.5.1.

Thank you

30 Mar 2015, 7:46 PM
#2093
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

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

I am not real familiar with SBA - so will start this off by saying... pardon me if I ask a really STUPID question! LOL

I have a customer that has a very old version of zen cart that we are trying to upgrade. She uses SBA, Dynamic Dropdown, and an Atrribute Image swap.

I have done the upgrade to 1.5.4 using the latest SBA code on github. The latest SBA code appears to have Dynamic Dropdown built in from what I can see.

My problem is that on her current site, if you click the first dropdown, Say... Long Sleeve Tshirt, then click on the next dropdown, EG: Color, it will only show the long sleeve options. This, to me, would be the "Dynamic Dropdown" function.

In the NEW build, it shows ALL the attributes for the "product", instead of just the Long Sleeve T-shirt.

Here is a link to the new build:

Here is a link to the original site

I have gone at this every way I know how... merging code, not merging code, and it just doesn't work. :ohmy:

Is there something that I am missing? Or does Dynamic Dropdowns just not work "out of the box" with the new version of SBA?

Thanks so much for any assistance you can give me!!

30 Mar 2015, 8:21 PM
#2094
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

stellarweb:

I am not real familiar with SBA - so will start this off by saying... pardon me if I ask a really STUPID question! LOL

I have a customer that has a very old version of zen cart that we are trying to upgrade. She uses SBA, Dynamic Dropdown, and an Atrribute Image swap.

I have done the upgrade to 1.5.4 using the latest SBA code on github. The latest SBA code appears to have Dynamic Dropdown built in from what I can see.

My problem is that on her current site, if you click the first dropdown, Say... Long Sleeve Tshirt, then click on the next dropdown, EG: Color, it will only show the long sleeve options. This, to me, would be the "Dynamic Dropdown" function.

In the NEW build, it shows ALL the attributes for the "product", instead of just the Long Sleeve T-shirt.

Here is a link to the new build:

Here is a link to the original site

I have gone at this every way I know how... merging code, not merging code, and it just doesn't work. :ohmy:

Is there something that I am missing? Or does Dynamic Dropdowns just not work "out of the box" with the new version of SBA?

Thanks so much for any assistance you can give me!!

Correct, the version that is in the branch mc12345678_sba154 has dynamic dropdowns incorporated as provided via download from this site. There is a new selection available in the admin that was not a part of the original code that was put together to specifically work with this version of SBA. That said the new site does not appear to have the sequenced dynamic aspect active...

There are a few things though that need to go together to get the desired result(s).

The code that was a part of your previous version likely could be ported to this one and continue working; however, to use the version created here and active upon installation requires the product variants to be entered as discussed over the few previous pages where each entry of a variant contains all attributes applicable to that stock tracked quantity.

To best try to resolve, would help to know what the settings were/are for the old site in the dynamic dropdown configuration area. Both for multiple attributes as well as single attributes.

Then to also know how the variants are setup for example on the product presented above.

30 Mar 2015, 9:03 PM
#2095
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

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

In looking at the current admin (version 1.3.8a) and the new build (1.5.4), I do not see anything that says anything about Dynamic Dropdowns either under Configuration or Catalog menus.
When I use the Search Configuration on the new build, I see
Enable Dynamic Dropdowns 2
Product Info Single Attribute Display Plugin multiple_dropdowns
Show Out of Stock Attributes True
Product Info Multiple Attribute Display Plugin sba_sequenced_dropdowns
Mark Out of Stock Attributes Right
Display Out of Stock Message Line True
Prevent Adding Out of Stock to Cart True
SBA Number of Records to Displayed 25

Enable Dynamic Dropdowns
On for Multi-Attribute Only

Does that help any?

30 Mar 2015, 9:17 PM
#2096
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

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

To add to this..... the Image swap mod has 2 files in common with SBA
admin/options_name_manager.php
includes/modules/custom/attributes.php

I merged the coding - but the attributes.php file removes the image swap functionality, even though it is merged correctly. It also makes the different dropdowns go wonky, so I have to use the Image swap attributes.php file.

Also, I cannot use the includes/templates/custom/templates/tpl_modules_attributes.php file because it causes the image swap not to work.

stellarweb:

In looking at the current admin (version 1.3.8a) and the new build (1.5.4), I do not see anything that says anything about Dynamic Dropdowns either under Configuration or Catalog menus.
When I use the Search Configuration on the new build, I see
Enable Dynamic Dropdowns 2
Product Info Single Attribute Display Plugin multiple_dropdowns
Show Out of Stock Attributes True
Product Info Multiple Attribute Display Plugin sba_sequenced_dropdowns
Mark Out of Stock Attributes Right
Display Out of Stock Message Line True
Prevent Adding Out of Stock to Cart True
SBA Number of Records to Displayed 25

Enable Dynamic Dropdowns
On for Multi-Attribute Only

Does that help any?

30 Mar 2015, 9:41 PM
#2097
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

stellarweb:

In looking at the current admin (version 1.3.8a) and the new build (1.5.4), I do not see anything that says anything about Dynamic Dropdowns either under Configuration or Catalog menus.
When I use the Search Configuration on the new build, I see
Enable Dynamic Dropdowns 2
Product Info Single Attribute Display Plugin multiple_dropdowns
Show Out of Stock Attributes True
Product Info Multiple Attribute Display Plugin sba_sequenced_dropdowns
Mark Out of Stock Attributes Right
Display Out of Stock Message Line True
Prevent Adding Out of Stock to Cart True
SBA Number of Records to Displayed 25

Enable Dynamic Dropdowns
On for Multi-Attribute Only

Does that help any?

So, it looks like the sequenced aspect of dynamic dropdowns is activated (by the usage of Enable Dynamic Dropdowns 2 and Product Info Multiple Attribute Display Plugin sba_sequenced_dropdowns

But what seems to be the case is that the variants are not populated to support that option or one of the other settings/code is not carrying the sequencing forward.

Strange as well is that you don't have an option in your configuration list for dynamic dropdowns... My guess is that there is probably two or more database entries for the record as part of the upgrade from the previous version... Obviously not easily accessible, but the list of options can still be modified if you get to know what gID is applicable for all of those on your system. Will have to provide a way to remove the duplicate record information via separate correspondence unless someone else can jump in with that solution in the interim.

So the next thing would be to understand how this product is setup in the variants section for this one product. Able to do a screen capture or copy and paste of a row or series of rows for that product?

30 Mar 2015, 9:53 PM
#2098
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

stellarweb:

To add to this..... the Image swap mod has 2 files in common with SBA
admin/options_name_manager.php
includes/modules/custom/attributes.php

I merged the coding - but the attributes.php file removes the image swap functionality, even though it is merged correctly. It also makes the different dropdowns go wonky, so I have to use the Image swap attributes.php file.

Also, I cannot use the includes/templates/custom/templates/tpl_modules_attributes.php file because it causes the image swap not to work.

Ahhh, well... Not sure what version of the includes/templates/custom/templates/tpl_modules_attributes.php file is used on your current site, but that is the one file that actually engages dynamic dropdowns... Without it or a version of the original, no dynamic dropdown functionality is provided...

As for the image swap... The base version of this version of SBA supports image swapping for product that has one attribute... I've asked for feedback on it's functionality when using the multiple attribute option(s)... Again, technically you may be able to use your old stores versions of the template file and may also be able to use the old stores version of the dynamic dropdown classes. The version that is available for download of Dynamic Dropdowns though out-of-the-box does not work in it's entirety with SBA as written. It may just be the javascript side that is an issue, but when tested it did not function as written and is why an additional class was created written for this version in the event someone had written/rewritten the previous versions and continued to want to use them. Again trying to take the route of adding to the overall operation, not remove or be overly controlling. Maybe down the line different changes will be made, but it is still being developed with existing functionality to remain in place.

30 Mar 2015, 10:36 PM
#2099
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

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

Would it be easier if I PM you with access to the admins?

Thanks so much for your willingness to help! I have been pulling my hair out trying to figure this out! LOL

4 Apr 2015, 4:40 PM
#2100
xfourninetwox avatar

xfourninetwox

New Zenner

Join Date:
Mar 2008
Posts:
57
Plugin Contributions:
0

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

Hey guys, there are 101 and one pages in response to this thread so I can't page through all these to find my answer. I am trying to add the SQL patch (I guess?) and can't figure out what is going wrong. I'm trying to upload but keep getting this error:

Error Failed: 4
Error ERROR: Cannot execute because table products_with_attributes_stock does not exist. CHECK PREFIXES!
Error ERROR: Cannot execute because table products_with_attributes_stock does not exist. CHECK PREFIXES!
Error ERROR: Cannot execute because table products_with_attributes_stock does not exist. CHECK PREFIXES!
Error ERROR: Cannot execute because table products_with_attributes_stock does not exist. CHECK PREFIXES!
Warning Note: 4 statements ignored. See "upgrade_exceptions" table for additional details.

I'm using ZC v1.5.1 if that helps...