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

Results 1,761 to 1,780 of 3,609
18 Nov 2013, 11:21 AM
#1761
philman1008 avatar

philman1008

New Zenner

Join Date:
Sep 2013
Location:
United Kingdom
Posts:
11
Plugin Contributions:
0

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

potteryhouse:

In the file attributes.php make these changes. This should resolve your display error.

On line 199 change this:

$products_options_display_price = ATTRIBUTES_PRICE_DELIMITER_PREFIX . '<span class="productSpecialPrice">' . $products_options->fields['price_prefix'] . $currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . '</span>' . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;

> 
> To this:
> ```
$products_options_display_price = ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] . $currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;

On line 224 change this:

$originalpricedisplaytext = ATTRIBUTES_PRICE_DELIMITER_PREFIX . '<span class="normalprice">' . $products_options->fields['price_prefix'] . $currencies->display_price( zen_get_attributes_price_final($products_options->fields["products_attributes_id"], 1, '', 'false'), zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . '</span>' . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;

> 
> To this:
> ```
$originalpricedisplaytext = ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] . $currencies->display_price( zen_get_attributes_price_final($products_options->fields["products_attributes_id"], 1, '', 'false'), zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;

I made these changes and the product will simply not display at all now :-( Any ideas?

18 Nov 2013, 2:38 PM
#1762
potteryhouse avatar

potteryhouse

Zen Follower

Join Date:
Jun 2012
Location:
Florida
Posts:
123
Plugin Contributions:
0

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

Philman1008:

I made these changes and the product will simply not display at all now :-( Any ideas?

Try the test version I posted above (post #1762). It should resolve that issue, I made changes to adjust for the selection drop-down lists problems.

20 Nov 2013, 1:29 PM
#1763
bradlawson25 avatar

bradlawson25

New Zenner

Join Date:
Sep 2011
Posts:
14
Plugin Contributions:
0

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

Can you disable a Attribute Option type from being port of SBA? For example you have Attribute Option type "Read Only". I want to make a attribute called Gift Wrap and put in values "Yes" and "No". Can I tell SBA if the attribute option type is "Read Only" then do not add it to part of the "Products with Attribute Stock". Right now if I have 10 "xs" 'blue" shirts for me to use Gift Wrap I would have to have 10 xs blue shirts with "Gift Wrap" marked "Yes" and 10 xs blue shirts with "Gift Wrap" marked "No".

Thanks

Brad

21 Nov 2013, 4:00 PM
#1764
potteryhouse avatar

potteryhouse

Zen Follower

Join Date:
Jun 2012
Location:
Florida
Posts:
123
Plugin Contributions:
0

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

bradlawson25:

Can you disable a Attribute Option type from being port of SBA? For example you have Attribute Option type "Read Only". I want to make a attribute called Gift Wrap and put in values "Yes" and "No". Can I tell SBA if the attribute option type is "Read Only" then do not add it to part of the "Products with Attribute Stock". Right now if I have 10 "xs" 'blue" shirts for me to use Gift Wrap I would have to have 10 xs blue shirts with "Gift Wrap" marked "Yes" and 10 xs blue shirts with "Gift Wrap" marked "No".

Thanks

Brad

Hi,
Setting a selection as read-only and trying to add to the cart will not work as you want. But, you can turn off the QTY, and other tests for stock in the "Configuration > Stock" page and add the yes/no as another selection on the product. You will then have to add the new selection in the stock page and place a large value in it.

While thinking about your problem, I looked at a change to the mod last night that may resolve your issue and provide more flexibility in this mod for the future, but it will take a few days to get the updates done. When I finish I will post it here as a new version for testing. Please provide feedback on it so I know if this approach is useful.

This is the basic concept I am using for the new change I am making:

Add another selection type for use when making "Attribute Names" the new type will be set to generic / general, and will not have any of the added text the other types get for display on the Product page or in the shopping cart and will not be tracked for stock.

The main use I see for this will be for Selections that do not need or have an associated quantity, such as a Yes / No selection, or when a color, or size selection that is not tied to an available quantity (qty independent). In these cases the selection will not need to be in the Stock page since no stock will be tracked against these new types.

The goal is to keep existing functionality while expanding available options. This change will affect several files, as a minimum it touches the attributes.php, product info, and shopping cart checkout pages. It also will require running an sql file to add the new options to the database.

24 Nov 2013, 6:16 PM
#1765
potteryhouse avatar

potteryhouse

Zen Follower

Join Date:
Jun 2012
Location:
Florida
Posts:
123
Plugin Contributions:
0

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

[Attachment no longer available]

This version (1.5.X_TEST_1) is provided to get feedback for the next version to be posted to the plug-ins.
This is a test version only.

There IS a change to the database.
The attributes.php file has been moved to an overrides folder.

The following files have been updated. The update is based on Version 1.5.2:

admin\includes\classes\products_with_attributes_stock.php
admin\products_with_attributes_stock.php
admin\stock_by_attr_install.php
includes\functions\functions_lookups.php
includes\functions\extra_functions\products_with_attributes.php
includes\modules\pages\shopping_cart\header_php.php
includes\modules\YOUR_TEMPLATE\attributes.php

This file has been moved to an override folder, rename 'YOUR_TEMPLATE' to your template name:
includes\modules\YOUR_TEMPLATE\attributes.php

This version should resolve most display problems and other items that have been posted in the forum.
This version also supports "Multiple-Attribute-Combinations" i.e., it allows for multiple attributes for a product in the SAME Stock ROW on the stock page, thus you can create custom combinations with specific quantities.

Short list of some items resolved:

  1. Dynamic Filter not working correctly with SBA.
  2. <span> tag in the drop-down selection list.
  3. QTY: showing up on read-only attributes.
  4. <b> tag showing up in drop-down selection list.
  5. Option to add a yes/no selection list that will not be tied to a stock level (New Attribute Name "SBA Select List (Dropdown) Basic" added to support this option)
  6. New functionality (NEEDS TESTING by more then just me) that supports "Multiple-Attribute-Combinations".

Please use only on a TEST installation and provide thoughts, suggestions, feedback.

Depending on what feedback I get, I plan to submit this to the Plug-ins on Zen Cart early next month as Version 1.5.3, since it contains significant changes.

26 Nov 2013, 4:14 AM
#1766
chargin avatar

chargin

Zen Follower

Join Date:
Sep 2011
Posts:
136
Plugin Contributions:
0

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

I have a question about upgrading a store from 1.39h to 1.5x versions of Zencart.
What does stock by attributes do in this case? will it stop working?
I think the new versions of zencart have a stock system built in? Can I import the stock levels either to zencarts new system or to a different version of SBA that works with 1.5x?

I did search this thread for this info but didnt get far..

26 Nov 2013, 2:56 PM
#1767
potteryhouse avatar

potteryhouse

Zen Follower

Join Date:
Jun 2012
Location:
Florida
Posts:
123
Plugin Contributions:
0

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

Chargin:

I have a question about upgrading a store from 1.39h to 1.5x versions of Zencart.
What does stock by attributes do in this case? will it stop working?
You will have to update the files of SBA with the most current, the previous version will not work correctly with Zen Cart 1.5.1.

I think the new versions of zencart have a stock system built in? Can I import the stock levels either to zencarts new system or to a different version of SBA that works with 1.5x?
The version of SBA in Zen Cart 1.5.1 is similar to the 1.3.9 version, if you want the attribute stock you will still need the SBA mod installed.
Your current SBA table will be upgraded if you use the script. BUT, test this on a TEST setup prior to doing the upgrade and BACKUP EVERYTHING before you start.

I did search this thread for this info but didnt get far..

Once you have upgraded your site to 1.5.1, than update the SBA files with the current available from the Plug-ins. The setup script in SBA will update your current SBA table. Please read all instructions before starting, and make Backups that you can revert to if you have problems. Instructions are provided with the Plug-in download, if you have suggestions to make them better please post them here and we will try to add your suggestions to future releases.

26 Nov 2013, 10:07 PM
#1768
chargin avatar

chargin

Zen Follower

Join Date:
Sep 2011
Posts:
136
Plugin Contributions:
0

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

That is great news thanks for taking the time.

27 Nov 2013, 8:32 AM
#1769
palafirst avatar

palafirst

New Zenner

Join Date:
Oct 2011
Posts:
29
Plugin Contributions:
0

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

Something strange is happening and I cannot find the answer in any of my searches. Have been building a new Zen Cart (v1.5.1) site using Stock by Attributes (the new version by potteryhouse). Everything was working fine, but shortly after moving the site to the actual server the Products with Attributes Stock isn't working. When I click on the menu option under Catelog I get the list of the products with attributes and I can click "Add Quantity For Product Variant" or "Edit Quantity" and see the product attribute (size), but when I make any change and click "Submit" I immediately get an error page "The connection was reset. The connection to the server was reset while the page was loading."

I don't think this is connected to moving to the new server because someone has been able to add some inventory numbers since the move.

Any ideas. I'm rather desperate. Really need to get this site up and running. The site is at https://www.cocoroots.com/cart

Thanks,
Greg

29 Nov 2013, 2:22 PM
#1770
jmsmith avatar

jmsmith

New Zenner

Join Date:
Nov 2013
Location:
London
Posts:
1
Plugin Contributions:
0

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

SBA is coming up with the following error when attempting to update quantities via 'Edit Quantity':

*"No data received
Unable to load the webpage because the server sent no data.
Reload this webpage.
Press the reload button to resubmit the data needed to load the page.
Error code: ERR_EMPTY_RESPONSE"
*

Any ideas? It is able to update quantities on the main screen by directly inputting the number, but this is not working for my new stock!

Urgently need to get this sorted in order to get stuff sold by Christmas...!

Huge thanks, people!

30 Nov 2013, 4:58 PM
#1771
lunny avatar

lunny

New Zenner

Join Date:
Nov 2013
Location:
Chesham
Posts:
2
Plugin Contributions:
0

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

Hi Greg.

Did you find a fix for this yet? I've been having the same issue too for about a week now. I'm also using v1.5.1. Everything else works fine. The funny thing is though, that when when I select the "Products with Attributes Stock (aka SBA)" option, it then says shows the heading of the page to be "Stock By Attribute (SBA) Stock Page Version 1.5.2". So is there a compatibility problem because the site is 1.5.1 but it's saying that particular page is 1.5.2?

Thanks.

1 Dec 2013, 6:35 AM
#1772
magz avatar

magz

Zen Follower

Join Date:
Apr 2013
Location:
north carolina
Posts:
110
Plugin Contributions:
0

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

Hi,

I'm testing SBA 1.5.2 (upgrade from 1.5.0) on ZC 1.5.1, and am grateful for the fact that available stock appears in the cart for products both with and without attributes. However, I'm having trouble with miscalculated stock for products with attributes. It's probably just a setting somewhere that I need to change, but can't figure out which one. Here's the situation:

I have ukuleles that can be purchased with or without optional gig bags. In my test, I use 2 ukes of the same model. The desired behavior is: if someone orders 1 or 2 ukes (both with bags OR both without bags OR 1 with and 1 without), they should NOT get an insufficient stock message. If someone tries to buy 3 or more ukes (with or without bags), they SHOULD get the insufficient stock message. Currently, the system somehow thinks that I have 2 ukes with bags and 2 separate ukes without bags, so someone can put 2 ukes with bags and 2 without in their cart and not get the low stock warning, though they should. What am I doing wrong?

Here's how I have the uke set up:

  • the gig bag attribute type is check box
  • quantity of the product is set to 2
  • qty of attribute is 2 (when it was 0, I was getting low stock msg even when ordering 1 uke with bag, and available qty was blank, not even 0)
  • in Configuration->Stock, "SBA Show Available Stock Level in Cart (when less than order)" is set to true, the other SBA items are set to false.

I'll appreciate your guidance.... Thank you!
Magz

1 Dec 2013, 11:22 PM
#1773
lunny avatar

lunny

New Zenner

Join Date:
Nov 2013
Location:
Chesham
Posts:
2
Plugin Contributions:
0

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

Hi Greg.

Did you find a fix for this yet? I've been having the same issue too for about a week now. I'm also using v1.5.1. Everything else works fine. The funny thing is though, that when when I select the "Products with Attributes Stock (aka SBA)" option, it then says shows the heading of the page to be "Stock By Attribute (SBA) Stock Page Version 1.5.2". So is there a compatibility problem because the site is 1.5.1 but it's saying that particular page is 1.5.2?

Thanks.

2 Dec 2013, 7:18 AM
#1774
divavocals avatar

divavocals

Totally Zenned

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

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

Lunny:

Hi Greg.

Did you find a fix for this yet? I've been having the same issue too for about a week now. I'm also using v1.5.1. Everything else works fine. The funny thing is though, that when when I select the "Products with Attributes Stock (aka SBA)" option, it then says shows the heading of the page to be "Stock By Attribute (SBA) Stock Page Version 1.5.2". So is there a compatibility problem because the site is 1.5.1 but it's saying that particular page is 1.5.2?

Thanks.FYI.. post bumping or duplicating your posts is very much frowned upon.. if no one has responded to your post it may be that people are busy where they don't have an answer..

also a posting tip for you it always helps if you quote the post you're responding to.. otherwise it's very hard to tell what problem you are also having..

2 Dec 2013, 1:47 PM
#1775
potteryhouse avatar

potteryhouse

Zen Follower

Join Date:
Jun 2012
Location:
Florida
Posts:
123
Plugin Contributions:
0

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

Lunny:

Hi Greg.

Did you find a fix for this yet? I've been having the same issue too for about a week now. I'm also using v1.5.1. Everything else works fine. The funny thing is though, that when when I select the "Products with Attributes Stock (aka SBA)" option, it then says shows the heading of the page to be "Stock By Attribute (SBA) Stock Page Version 1.5.2". So is there a compatibility problem because the site is 1.5.1 but it's saying that particular page is 1.5.2?

Thanks.

Hi,
The SBA Mod version 1.5.2 was written for Zen Cart 1.5.1, the version 1.5.2 was used to indicated a MAJOR or Significant change. In this case the mod version 1.5.2 now supports a "Custom ID" field. But, to use this new mod and new field there was a change to the SBA Table, thus if you have not, you should run the

[LIST]
[*]Full/Upgrade DB Install
[LIST]
[*]Full, makes all script changes to the database (DB) (i.e., adds new SBA table, adds entries into the Admin page, and new entries into the Configuration file).
[*]Upgrade, updates Configuration file and the SBA table as needed. If run again, it will "Clean" table entries and reapply the settings, it will not affect current data in the "products_with_attributes_stock" table.
[/LIST]
[/LIST]

This will add the new field to the database, based on the testing I just conducted I suspect those having problems with 1.5.2 have not run this script or that for some reason it has not added the new field.

`customid` VARCHAR(255) NULL DEFAULT NULL,

Have you run this script to "Update" the database table?
Do you have this new field in the database table for SBA?

FYI, I was on vacation and could not help as I did not have access to a test environment.

3 Dec 2013, 3:50 PM
#1776
palafirst avatar

palafirst

New Zenner

Join Date:
Oct 2011
Posts:
29
Plugin Contributions:
0

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

palafirst:

Something strange is happening and I cannot find the answer in any of my searches. Have been building a new Zen Cart (v1.5.1) site using Stock by Attributes (the new version by potteryhouse). Everything was working fine, but shortly after moving the site to the actual server the Products with Attributes Stock isn't working. When I click on the menu option under Catelog I get the list of the products with attributes and I can click "Add Quantity For Product Variant" or "Edit Quantity" and see the product attribute (size), but when I make any change and click "Submit" I immediately get an error page "The connection was reset. The connection to the server was reset while the page was loading."

I don't think this is connected to moving to the new server because someone has been able to add some inventory numbers since the move.

Any ideas. I'm rather desperate. Really need to get this site up and running. The site is at www.cocoroots.com/cart

Thanks,
Greg

THE PLOT THICKENS...

PotteryHouse has been trying to help me with this issue and it looks like it could be something with the fact that the site is hosted on GoDaddy. I installed the identical site on BlueHost and it works fine. Anyone else having this problem? Anyone come up with a solution? To help here is what PotteryHouse has written me about this:

BEGINNING OF MESSAGE: I suspect that GoDaddy has some base site configuration issue, since the same files worked fine for you on Bluehost, Also, I use both bluehost and hostmonster (they are the same company just different brand manning, and for the most part same servers)

Things to check to compare GoDaddy and Bluehost I think would be the htaccesss files, the version of PHP used, and the versions of the MySQL databases.
Any of these may cause issues if too new or too old. as a note, the Zen Cart team recently released a Beta version of Zen Cart 1.5.2 that is to address issues with PHP 5.4 and 5.5, this is a first step to the next major release of Zen Cart 1.6.

Anyway the log error foreach() sounds to me to be a PHP version issue, on bluehost and hostmonster you can add a line in the htaccess file to specify which version of PHP to use. GoDaddy may also support this, but I do not know for sure since I have never used them. END OF MESSAGE

The error message he refers to is: PHP Warning: Invalid argument supplied for foreach() in /home/content/15/7409315/html/cart/zcadmin/products_with_attributes_stock.php on line 414

I do not know if this error is the real problem since I've tried testing this problem several times today and there have been no new errors logged.

Thanks in advance for any assistance. This one is starting to hurt.

12 Dec 2013, 12:56 PM
#1777
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

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

Installed on 1.3.9h all files uploaded after sql successful upload but now getting following error message on product detail page

1146 Table 'freshhea_zc1.zen_zen_products_with_attributes_stock' doesn't exist
in:
[SELECT quantity FROM zen_zen_products_with_attributes_stock AS a LEFT JOIN zen_products_attributes AS b ON (b.options_id=2 AND b.options_values_id=2) WHERE a.products_id = '58' AND a.stock_attributes = b.products_attributes_id AND a.quantity > 0 order by b.products_options_sort_order]

Any idea how to fix this or uninstall this module?

Thanks

13 Dec 2013, 2:17 AM
#1778
potteryhouse avatar

potteryhouse

Zen Follower

Join Date:
Jun 2012
Location:
Florida
Posts:
123
Plugin Contributions:
0

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

jsarwar:

Installed on 1.3.9h all files uploaded after sql successful upload but now getting following error message on product detail page

1146 Table 'freshhea_zc1.zen_zen_products_with_attributes_stock' doesn't exist
in:
[SELECT quantity FROM zen_zen_products_with_attributes_stock AS a LEFT JOIN zen_products_attributes AS b ON (b.options_id=2 AND b.options_values_id=2) WHERE a.products_id = '58' AND a.stock_attributes = b.products_attributes_id AND a.quantity > 0 order by b.products_options_sort_order]

Any idea how to fix this or uninstall this module?

Thanks

Hi,

For Zen Cart version 1.3.X you should have installed "Stock by Attributes - Version: 1.4.14" this is noted on the plugin page, each SBA version indicates what version of Zen Cart it will support.

If you have version 1.4.14 than the removal is to delete the files you added for this mod, in the case of files you updated / merged, replace them with the backup copies you (I hope you made) have. The changes to the database should not affect anything once those files are reverted, they can just be left alone.

If you installed the SBA version 1.5.x than you do basically the same thing as above, with the exception, the 1.5.x version has a script to remove the database changes the versions 1.5.1.2 and 1.5.2 have the script available from the "Configuration -> Products with Attributes Stock (aka SBA) Setup", read the provided instructions from the download, it explains the removal.

If you have suggestions for improvement please let us know and we can update the instructions.

13 Dec 2013, 2:09 PM
#1779
magz avatar

magz

Zen Follower

Join Date:
Apr 2013
Location:
north carolina
Posts:
110
Plugin Contributions:
0

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

Hi,

I'm testing SBA 1.5.2 (upgrade from 1.5.0) on ZC 1.5.1, and am grateful for the fact that available stock appears in the cart for products both with and without attributes. However, I'm having trouble with miscalculated stock for products with attributes. It's probably just a setting somewhere that I need to change, but can't figure out which one. Here's the situation:

I have ukuleles that can be purchased with or without optional gig bags. In my test, I use 2 ukes of the same model. The desired behavior is: if someone orders 1 or 2 ukes (both with bags OR both without bags OR 1 with and 1 without), they should NOT get an insufficient stock message. If someone tries to buy 3 or more ukes (with or without bags), they SHOULD get the insufficient stock message. Currently, the system somehow thinks that I have 2 ukes with bags and 2 separate ukes without bags, so someone can put 2 ukes with bags and 2 without in their cart and not get the low stock warning, though they should. What am I doing wrong?

Here's how I have the uke set up:
- the gig bag attribute type is check box
- quantity of the product (on product setup page) is set to 2
- qty of attribute is 2 (when it was 0, I was getting low stock msg even when ordering 1 uke with bag, and available qty was blank, not even 0)
- in Configuration->Stock, "SBA Show Available Stock Level in Cart (when less than order)" is set to true, the other SBA items are set to false.

  • settings in attributes controller:
    Attachment 13519

I'll appreciate your guidance.... Thank you!
Magz

PS- sorry for this duplicate post, I didn't know before that I could change the subject and I think my msg from Dec 1 drowned in the flood and went unnoticed...

13 Dec 2013, 3:07 PM
#1780
jsarwar avatar

jsarwar

Zen Follower

Join Date:
Jul 2012
Posts:
347
Plugin Contributions:
0

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

I installed the correct version. I was able to get this corrected.
Thanks