http://www.apricot.com.sg/error.jpg
I install 4.7 with AJAX and the admin page look messed up any help guys?
Printable View
http://www.apricot.com.sg/error.jpg
I install 4.7 with AJAX and the admin page look messed up any help guys?
Could this module be modified to provide individual product codes as well as stock levels?
I have tried using the Attributes Modelnumbers contrib by helix, but is (still) in beta and seems very flakey.
ColinR
OK..apparently there are more than one thread for SBA and since I'm so deep into this I figured I'd see if perhaps I was in the wrong one...
I don't even know which mod it would refer to but I have a very basic question...
How do you use this mod with a text field???? I ran into a HUGE issue.... what happens when you have a TEXT input field???? For instance. Let's say I have 10 white frames and 4 black frames in stock and both can be engraved. You currently can't even attempt this because it appears this mod turns every option into a dropdown...including text input fields.
I added an additional column in the database for product attribute product codes. I called it attribute_skus. I have not yet figured out how to make this editable in admin, but it is pretty easy to add the model #'s in PHPmyAdmin. I was able to get the model #'s to display in the same table in admin though so that I am able to verify I added them to the correct variant. If you would like this code I can provide it.
I have not decided if I will go any further with this as my need has already been fulfilled. I just need to be able to import and export inventory using my company's inventory program. I would imagine one could put this info on invoices and shopping cart pages as well pretty easily.
I installed the stock_by_attributes_4-7MULTIADD (zc 1.38).
But as soon as I edit a product, the product description gets deleted :(
Anyone know how this is possible?
kuroi,
I see that there is another version of SBA 4.7 by Hugo13- SBA 4.7 ajax. If I am using the MULTADD version of SBA and want to change that, will installing this newer version (that is evidently not the MULTADD) cause me to lose all my quantity data that's been input?
Thanks for all you do for ZC and it's community.
If you don't run the SQL patch then your data should be safe. However, beware of the AJAX version, it's missing some key files. In theory installing it over the top of the multiadd version should add the AJAX functionality and fill in the holes left by the missing files, but I haven't personally tried using either so that advice comes with a big health warning.
Thanks kurio,
After reviewing some some of the post history in this thread again, I've decided to leave well enough alone for now. I don't want to take the risks that making these changes might incur and I don't have enough time to play around with testing it.
Hi all,
I'm running Zen Cart 1.3.8a with the Product attributes with Stock, latest version. It seemed to be working.
However now, when I set a quantity for a single variant. It marks all of the variants as out of stock.
You guys experienced this before.
Thanks in advance.
Rich
I found the bugger.
products_with_attributes_stock.php line 234
should beCode:for ($i = 0;$i < sizeof($arrNew);$i++) {
$strAttributes = implode(",", $arrNew[$i]);
$query = 'insert into `'.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.'` (`products_id`,`stock_attributes`,`quantity`) values ('.$products_id.',"'.$strAttributes.'",'.$quantity.') ON DUPLICATE KEY UPDATE `stock_attributes` = "'.$strAttributes.'", `quantity` = '.$quantity;
$db->Execute($query);
}
Otherwise the attributes will display in the wrong order on the fieldCode:for ($i = 0;$i < sizeof($arrNew);$i++) {
sort($arrNew[$i])
$strAttributes = implode(",", $arrNew[$i]);
$query = 'insert into `'.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.'` (`products_id`,`stock_attributes`,`quantity`) values ('.$products_id.',"'.$strAttributes.'",'.$quantity.') ON DUPLICATE KEY UPDATE `stock_attributes` = "'.$strAttributes.'", `quantity` = '.$quantity;
$db->Execute($query);
}
I added the following code to admin/products_with_attributes_stock.php
Changed
PHP Code:
echo '<th class="stockAttributesHeadingStockId">'.PWA_STOCK_ID.'</th><th class="stockAttributesHeadingVariant">'.PWA_VARIANT.'</th><th class="stockAttributesHeadingQuantity">'.PWA_QUANTITY_IN_STOCK.'</th><th class="stockAttributesHeadingEdit">'.PWA_EDIT.'</th><th class="stockAttributesHeadingDelete">'.PWA_DELETE.'</th>';
To
and addedPHP Code:
echo '<th class="stockAttributesHeadingStockId">'.PWA_STOCK_ID.'</th><th class="stockAttributesHeadingVariant">'.PWA_VARIANT.'</th><th class="stockAttributesHeadingSku">'.PWA_ATTRIBUTES_SKU.'</th><th class="stockAttributesHeadingQuantity">'.PWA_QUANTITY_IN_STOCK.'</th><th class="stockAttributesHeadingEdit">'.PWA_EDIT.'</th><th class="stockAttributesHeadingDelete">'.PWA_DELETE.'</th>';
right afterPHP Code:
echo '<td class="stockAttributesCellSku">'."\n";
echo $attribute_products->fields['attributes_sku'];
echo '</td>'."\n";
PHP Code:
sort($attributes_output);
echo implode("\n",$attributes_output);
and to admin/includes/languages/english/products_with_attributes_stock.php
I added
and to admin/includes/stock_attributes.cssPHP Code:
define('PWA_ATTRIBUTES_SKU', 'Attributes SKU');
I changed
toPHP Code:
.stockAttributesHeadingStockId,
.stockAttributesHeadingVariant,
.stockAttributesHeadingQuantity,
.stockAttributesHeadingEdit,
.stockAttributesHeadingDelete {
border-bottom: 1px solid #ccc;
width:18%;
}
and changedPHP Code:
.stockAttributesHeadingSku,
.stockAttributesHeadingStockId,
.stockAttributesHeadingVariant,
.stockAttributesHeadingQuantity,
.stockAttributesHeadingEdit,
.stockAttributesHeadingDelete {
border-bottom: 1px solid #ccc;
width:18%;
}
toPHP Code:
.stockAttributesCellStockId,
.stockAttributesCellVariant,
.stockAttributesCellQuantity,
.stockAttributesCellEdit,
.stockAttributesCellDelete {
border-bottom: 1px dotted #ccc;
}
PHP Code:
.stockAttributesCellSku,
.stockAttributesCellStockId,
.stockAttributesCellVariant,
.stockAttributesCellQuantity,
.stockAttributesCellEdit,
.stockAttributesCellDelete {
border-bottom: 1px dotted #ccc;
}
total noob question:
just installed stock with attributes mod 4.7.ajax over zencart 1.3.8a using barebones template that's i've customized a little.
when choosing Catalog > Products with Attributes Stock i get a blank page, except for this:
"No input file specified."
i'm sure it's something easy and obvious, but i'm missing it. duh.
thanks for your help.
okay, think i got it.
thanks anyway.
I have just tried to install the stock by attributes mod. I ran the stock_attribute.sql through Admin-Tools-Install SQL Patches. However, I do not have the "Products with Attributes Stock" option under Admin-Catalog. I logged into my web host Cpanel and see the zen_products_with_attributes_stock table was created. Am I missing a step?
Thanks for any guidance.
Thanks for the suggestions. I must be missing something. I went throug instructions again and copied files again. I still do not have the Products with Attributes under Catalog in Admin. Has anyone esle run into this problem.
I have a problem not listed in this thread that I have seen yet. I am running Zen 1.3.8 and the newest version of stock by attributes. The products with attributes section is located in admin>catalog and I am able to insert stock quantities but when you check out with products with a stock level of 0 no out of stock or error message appears. Configuration>Stock> Allow Checkout is set to 0. Any help?
http://fazeapparel.com/catalog/index...ndex&cPath=4_5
I too am very interested to see if this module can hide attributes with zero qty. Also, can it display the quantity for each attribute rather than add up all of them?
Say you are selling
Soda
Sprite - AVAIL 3
Coke - AVAIL 1
Pepsi - AVAIL 1
Canada Dry - AVAIL 0 (DONT DISPLAY THIS!)
Is this possible?
This is a common problem. Some FTP tools appear not to overwrite by default. This usually happens when you have installed your Zen Cart after the date the mod was written. So your Zen Cart has installation date stamps, but the mod has older ones and the FTP client thinks the installed files are more current.
Hopefully they prompt you with an option to overwrite, but this doesn't appear to always happen, especially when the default is not to overwrite "newer" files. In that case, it's important to check the log file. Incomplete uploads are by far the most common reason for Stock by Attributes not working.
Ahhhh good old Cyberduck..:smile: The only (free) FTP app for the Mac I could find that had a decent feature set and GUI.. But you are right it occasionally does not consistently overwrite files correctly.. I found myself switching to my PC to do all of my FTPing because of that..
Sorry, I posted this in wrong thread before.
I am using "Stock by Attributes" v4.7a on ZC 1.3.8.
We have a number of shoes sizes for a particular shoe style and we allow people to pass through the checkout process when a particular size is out of stock, so it goes on back order. This then removes the qty ordered from the stock by attribute number.
If the TOTAL stock level for a particular shoe style goes negative because a large number of sizes are on back order, then ALL sizes that actually are in stock also now show out of stock in the cart.
I need to show when a product is out of stock based only on the stock by attribute and not if total goes 0 or negative. Is this a bug and/or can it be fixed?
I have taken a look at the files but can't find where the problem lies. Also, can't find a thread relating to this specific problem.
Thanks,
Dan
Hi, thanks, but I need to allow checkout when there is no stock so items go on back order, i.e. negative stock levels for those sizes indicate how many outstanding shoes of those sizes need to be ordered so orders can be completed. The problem occurs when individual sizes that go -ve accumulate so the total stock for a particular style goes -ve. this then causees even sizes that are in stock to show as out of stock.
Thanks
Dan
I have installed the following module on 1.3.6 (the site just went live a few weeks ago)
Stock by Attributes
Version: 4.7
Zen Cart™ Version: v1.3.8
But when someone makes a purchase it does not deduct from the inventory level for products with attributes stock. It does deduct from the product category stock.
I have tried looking around for an answer to this problem and have not been able to fine one yet.
Has anyone had this same issue?
Thanks in advance for your help.
@edeades
Two possible reasons:
- The order.php class hasn't been over-written on your web server so you are running the original code Zen Cart code and not the special code that manages stock at attribute level (a common problem with FTP clients that don't by default over-write files already on the server).
- You are running a version of the plugin designed to be compatible with version Zen Cart 1.3.8a, and not the version 1.3.6 that you are actually running. For that you would need version 4.3.1 of the mod.
Thanks so much for the response kuroi. I had a feeling it had something to do with orders.php. I am a little confused though. I verified I am on Zen Cart 1.3.8. Could it be that I am trying to use the 4.7AJAX mod instead of 4.7MULTIADD? The only orders.php I see in the AJAX mod is in the admin folder. I downloaded and looked at the MULTIADD and see there is orders.php in the includes\classes. Should I be using the MULTIADD mod instead? If so, is there a recommendation for installing the MULTIADD since I already have the AJAX mod installed. Thanks so much!
I downloaded the 4.7MULTIADD mod and used ftp to send the orders.php from the includes\classes folder. The includes\classes was not in the AJAX mod.
It is working perfectly now!
Thanks so much for your help.
hello limelites or anybody who can help me ,i had followed the advice as ontop however after changing the text , i recieved this error message on stocks with 0 qty updated in the products with attributes page.
1146 Table 'beb0917211113392.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK' doesn't exist
in:
[SELECT pov.products_options_values_id, pov.products_options_values_name, pa.*, pwas.* FROM zen_products_options_values pov, zen_products_attributes pa LEFT JOIN TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK pwas ON pwas.stock_attributes = pa.products_attributes_id WHERE pa.products_id = '3' and pa.options_id = '1' and (pwas.quantity > 0 or pwas.quantity IS NULL) and pa.options_values_id = pov.products_options_values_id and pov.language_id = '1' order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name]
Can anybody help me with this???? Thanks alot i am using v 1.38 zen cart along with v4.7 ajax with orders.php updated from multiadd.
My site is www.bebemummy.com
I have been looking at the various posts....but cannot see the answer for my problem. I installed the 4.7ajax on my 1.3.8a version, but cannot see the Products by attribute under admin/catalog.
Not sure if I installed it correctly or not. Is there a way to verify it ?? Can someone please help? Website is www.ijashun.com
I realised that though I am using Zencart 1.3.8a, I am using lavendar template version 1.3.6. Is this causing problems?
anybody knows what does my error message means? Pls thanks!
I checked whether the files are loaded...here is the result
products_with_attributes_stock_4.7.ajax has 3 directories in it
1. Admin ---- got saved in phpuploads
2. Ajax ------ directly to the root
3. Includes----- admin/includes. Here it shows an additional classes folder.
Are the directories in the right place?? Or it would be great to know where each of them should be.
Any help is really appreciated.
I figured it out. I reinstalled the files individually to respective folders.
Thanks
However, my next problem is that when I click on admin/catalog/Products with Attributes Stock I get this :
Suchen: Store
--------------------------------------------------------------------------------
Product ID Product Name Product Model Quantity for all variants Add Quantity For Product Variant Sync Quantities
Can anyone help where I can add the product variants and other information?
@brocolee
Did you run the installation SQL?
Did the admin/includes/extra-Datafiles>products_with attribute_stock_databse_tables.php get uploaded correctly ton your server.
yes i did regarding the installation sql !
Thanks kuroi for answering the noob question..
Now its finally working! Just that i see naother problem and that is when i was testing and proceed for a check out....
When i delete the order in my back end and tick "restock quantity" the stock nv return back to "SBQ table"
Kuroi,
I removed 4.7ajax and installed multiadd. I am able to add to the product stock by attributes table. However I am not able to display the quantities next to the attributes in the product info page. I tried what you had mentioned in wiki (grayson). I have only one attribute currently..size.
Also when quantity is added to cart, the stock does not reduce (when continue shopping is clicked without checking out).
I have checked for the proper installation, as you suggested.
here is the link.. http://ijashun.com/index.php?main_pa...products_id=25
Can you help, please?
Thanks in advance.
Swathi
I have another question...can we combine stock by attribute with product attribute grid module... so that we can have the quantity of stock available next to the attribute and also allow the customer to choose the quantity
eg.
size Small available 4. select 2
Thanks in advance for any help.
Swathi
I wanted to be able to not have a particular attribute availble if none is stock eg: black medium no stock but all other availble option still visable. I changed the code as above on the attributes.php but it never worked in the store I can still select it an it then goes on backorder
Was there anything else that I should have done first?
HI there,
I'm new to stock by attributes and have just installed 4.7a on my 1.38a Zen cart.
All looks to be working ok.
However, I wanted to do a test so I went to admin > catalog/products > proucts with attributes stock.
Clicked on Add Quantity For Product Variant and entered an amount say 10 on ALL. then saved. Then I Sync Quantities.
However, if I go back into the same attribite via the Add Quantity For Product Variant and enter another 10 say to all I get this error.
att: 5561|5559|5562|5558|5556,5678|5679|5680|5681|5682|5683|5684
Warning: Cannot modify header information - headers already sent by (output started at /home/myfoldername/mywebfolder/myadmin/products_with_attributes_stock.php:193) in /home/myfoldername/mywebfolder/myadmin/includes/functions/general.php on line 21
It seems as though regardless of the error that it still does work but as I'm new to the mod I wanted to make sure.
It still adds to the total correct amount and I can then sync with now problems.
Thanks for any input,
Murray
Hi there,
I wanted to add a little to the above post. I'm not sure if it is related or not though.
I have entered the admin > catalog/products > proucts with attributes stock area.
I find a product I want to edit. I click on Add Quantity For Product Variant.
I sellect ALL. Then make a change.. say 10. (ALL attributes then have 10 of each in stock)
Then I think to myself.. actually thats out of stock.. so I go back into 'attributes stock area' of the product and do -10. As it lists say 700 items in stock of various attributes.
This then sets all to -10. NOT to 0. I don't know another way to reset this to 0? I have gone back in Add Quantity For Product Variant area and tried to edit to other numbers but now there are a lot if various amounts. Cannot I not edit ALL attributes of the same product at once?
Now I have many attributes of that product listed as -10. If I log back in and edit using 'attributes stock area' ALL feature to say 10 again. Many of the products remain as -10.
I can individually edit each one.. but I have many attributes and as you can edit ALL in the 'attributes stock area' I was wondering what I'm doing wrong or if in fact the error in above post that happens when I process the ALL feature works is working correctly.
I wanted to add the ONLY time I can NOT get an error is when selecting the attributes which I have 2.
Size
Color
If I Add Quantity For Product Variant I select a specific color AND size.
If I select ALL on either of them or both it will have above post error.
Hi Swathi
I'm afraid you're asking me a pile of questions to which I don't know the answers. But I'll do my best and let's hope that other people jump in with their experience.
I've never had need to use the multiadd version myself, can't really comment much on how that works.
Suimilarly I've never implemented the Grayson solution. I put the link in the wiki because people clearly wanted it, but you will need to read a little further down the thread to get the up-to-date details since the mod's structure has changed from when she first devised the approach, but the implications of those changes are discussed.
I've never really looked closely at the attribute grid mod. I'm guessing that it lays the attributes out in a grid! However, most likely it will be completely independent of this mod and compatible, but will know nothing about quantities so you would need to build that in.
However, even with quantities built into the display, customers won't be able to order multiples. Zen Cart's attribute system doesn't have any attributes that support ordering a quantity of the same attribute. That's a very big deal. I built a partial solution to this once to support a specific requirement for a client. It was horrendously complex and took me about three days to develop and test, test, test.
On stock reduction not occurring, I used to investigate these individually, but the problem was always due to one of the same two issues: either the includes/classes/order.php class hadn't been properly loaded to the server, or there was a backup of the original in the same folder overriding the changed version.
I'm trying to implement qty by attribute for my 1.3.7 site so I can sell shirts in the holiday season.
So far, I'm not having luck. I suspect it's due to the module needing 1.3.8, can someone confirm this?
Can someone point me to something that WILL work for my 1.3.7 cart?
When I did install this, I was able to see the back end and it appeared to work. I.e. I could put in 3 small shirts and 4 mediums and then hit the update link and the main product showed qty of 7 with the appropriate sub-qty. But then, when I went on the front end and purchased 1 small shirt, I would see the main qty go to 6 on the admin view but the sub-qty for small would STAY at 3. The behavior I expected to see was that both the main qty AND the sub-qty would go down.
If I went to the front end and tried to order 4 small shirts, it would tell me there were not 4 available, which is correct. But then I could still order 3 since the sub-qty remained at 3, but in reality I would only have 2 available at this point.
So I'm thinking that either my cart version is not compatible with this and I hope someone can point me to something that works (doesn't need to be fancy). Or, I have misunderstood the purpose of this mod and someone can point me to something more appropriate for my needs. Or .... something else :)
Any help or direction is appreciated.
A few possibilities ...
if you've installed the AJAX version then you won't have all the files needed - there's lots more about this elsewhere
if you've not installed it properly, in particular the includes/classes/order.php file, then it also won't work, and in the way you've described.
the current versions may well not be compatible with 1.3.7, in which case go back to the downloads area and get the version that was written for 1.3.7.
Yep, i grabbed the 1.3.7 version, works like a champ.
One question, is it supposed to "turn off" attributes that have 0 qty or no? Right now, if my "small" is 0 qty, the cart still shows small as an option on the front end. Just wondering if that's expected behavior. Any tweaks out there to turn that off automagically if stock on an attribute is 0?
Thanks for the help
Hello,
I've tried looking for an answer or a solution but could not find it. I'd like to ask if there is any addon that alows you to search based on attributes.
For example I have clothing sizes S, M, L and I want to search for only M, or filter the rest.
If no, could I ask for a quick explanation what's the main problem with that?
Thank you!
This mod can't help you with this. It has nothing to do with searching.
The topic generally has been discussed a number of times, but I don't know of any mod that does it, as a general mod capable of handling any combination of attributes would be very complex and slow. Normally when one of our clients wants to to search by attribute we write custom code based either on attributes or on a new product type with additional product codification to meet the specific needs of the store.
However, this thread is already excessively long just from supporting this mod, so if you need more information about how this can be done, please start a new thread.
I've spent countless hours going over these posts...
Is it true that it is still not possible to either
1- display to the customer the different attribute variations and how many of each are in stock
or
2- disable the attribute option(s) from the respective dropdown menu's that are not in stock.
I have the Stock By attributes module version 4.7Ajax (up from 4.7 multi add) successfully installed.
I saw posts by several members years to months ago asking about this / almost solving this / etc - but with no stated solutions... has anyone figured out how to do this?! Could you point me to contributed modules that can do this?! If i'm asking this in the wrong spot could you lead me to the correct place?!
Thank you for any advice you can extend to me.
This mod out the box does not support this kind of functionality.
Been some talk and possible solutions posted in this and the other Stock by Attributes thread.. You can use the thread search tools to narrow your search to posts in the specific threads.. Don't know if any of these solutions are working or not.. (I haven't personally used any of them..)
I've searched and searched... but I'm lost.....
I've installed the mod in our test database. Shows up and all of our inventory is listed....
but when I click on define variant,
I get an error:
1146 Table 'XXdatabasenameXX.products_attributes' doesn't exist
fair enough...
all of our database tables have a prefix....
I, for the life of me, can't figure out any and all places that need to be modified to show the correct table name.....
any help with this would be great
Thanks
You don't say which flavor of the Stock By Attributes mod you installed:
Kuroi's version 4.7
MultiAdd version 4.7
Ajax version 4.7
I could never get the last two to work.. and since the contributors of both of these versions (MultiAdd or Ajax) have NOT ONCE support their version of this mod, I do not use them. My research of the support threads shows that these two versions are the ones with MULTIPLE problems. I use ONLY the version 4.7 Kuroi wrote. He is the ONLY mod author still actively answering questions in these support threads, so for my money this is the one I will use. However I do like the stylesheets used in the MultiAdd version because it visually makes a nice seperation between the parent product and the variants. but THAT'S ALL that I used from that version!:smile:
That said if you used Kuroi's version, it's a VERY straight forward install and should work right away.. No hacks to this mod needed AT ALL!
Do you have a link to the Kuroi version? I cannot locate it.
It's in the downloads section where you found this mod. The downloads preserves previous versions of add ons below the most current submissions. So if you scroll down and you will see version 4.7 (without MultiAdd or Ajax after the version number) and a download link for that version.
Can someone help me with this problem.
I am using Stock By Attributes MultiAdd but I'm running into a simple problem. I read the entire forum and can't find anything on it...
I need to set my stock quantity to Zero. I can do it by manually manipulating the database, but can't seem to get it to work from the Admin panel. Everytime I try I get a MySQL error that looks like this...
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' attribute_sku=0 where stock_id=68 limit 1' at line 1
in:
[update `products_with_attributes_stock` set quantity=, attribute_sku=0 where stock_id=68 limit 1]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
I added the Attribute_sku. I've tried everything and can't get it to work. It just keeps the Quanit=, and places no value there. If I put in -0 it works though...I don't get it.... Please HELP!
I think I am using the Stock attributes by decantlor or something like that.
The question I have is, How can I change the ***->
when it says 0 in stock....
http://www.nothingbutcostumes.com/in...ducts_id=11404
I am thinking about changing it to OOS Try another Size!
I have added the "Stock by Attribute" add-on and I was able to add my items. I added 82 items with 11 different categories.
My problem is, when I try and order the things it will let me order more of one atribute than I have, unless I order 83 of them. It is only looking at the prduct inventory to decide if it is out of stock, instead of the stock by attribute.
Does anyone know a fix for this?
Thanks,
Miriam
Im using Stocks by attributes.. thank you for the contributor...
I have a problem with the inventory of each attributes.
Once someone ordered a particular product(Ex: Product A : Size: 8/27" Inseam), after the payment, it doesn't update the product attributes stock.
So if Size: 8/27" Inseam has 5 in stock, after the purchased have been done the remaining stock should be 4... But the add on doesnt deduct the stock, the remaining stock is still 5. What I am doing right now is updating it manually if someone purchase a particular item.
Hope someone could help me with this problem...
@magoline and @julxz
There are two main possibilities:
if you've installed the AJAX version then you won't have all the files needed - there's lots more about this earlier in the thread (the key missing file is includes/classes/order.php
if you've installed the MultiAdd version, or my version, but not managed to do it properly, i.e. the revised includes/classes/order.php file (yes that one again) hasn't replaced the default Zen Cart one then the mod won't work, and in the way you've described.
See too post #763. A touch embarrassing, but 100% accurate.
**deleted -- nevermind -- I think I get it now**:laugh::laugh:
From the WIKI:
This wiki page points to posts that are not publicly viewable. I have one attribute in a dropdown for a product and here is how I did it, hopefully this saves someone a little bit of time.Quote:
How can I show the amount of stock available next to each attribute on the product information page?
zen cart version = 1.3.8a
in includes\modules\attributes.php
after
add the following:Code:die('Illegal Access');
}
Code://START PWA EDIT
function zen_draw_pull_down_menu_disableable($name, $values, $default = '', $parameters = '', $required = false) {
$field = '<select name="' . zen_output_string($name) . '"';
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++) {
$field .= ' <option value="' . zen_output_string($values[$i]['id']) . '"';
if ($default == $values[$i]['id']) {
$field .= ' selected="selected"';
}
if ($values[$i]['disabled'] == true) $field .= ' disabled="disabled"';
$field .= '>' . zen_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>' . "\n";
}
$field .= '</select>' . "\n";
if ($required == true) $field .= TEXT_FIELD_REQUIRED;
return $field;
}
//END PWA EDIT
after
add the following:Code:if ($pr_attr->fields['total'] > 0) {
find the following:Code://START PWA EDIT
$PWALookup = array();
$PWAQ = $db->Execute("
select
products_with_attributes_stock.quantity as q,
products_attributes.options_values_id as id
from products_with_attributes_stock
left join products_attributes on products_with_attributes_stock.stock_attributes = products_attributes.products_attributes_id
where products_with_attributes_stock.products_id='".(int)$_GET['products_id']."'
");
if ($PWAQ->RecordCount() > 0) {
do {
$PWALookup[$PWAQ->fields['id']] = $PWAQ->fields['q'];
$PWAQ->MoveNext();
} while (!$PWAQ->EOF);
}
//END PWA EDIT
replace with:Code:$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name']);
find the following codeCode://START PWA EDIT
$PWAkey = $products_options->fields['products_options_values_id'];
$PWAAppend = "";
$PWADisabled = false;
if (array_key_exists($PWAkey ,$PWALookup)) {
if ($PWALookup[$PWAkey] == 0) {
//out of stock message
$PWAAppend = " (Out of stock)";
$PWADisabled = true;
} else {
//your IN STOCK message goes here
$PWAAppend = " (".$PWALookup[$PWAkey]." in stock)";
}
}
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'].$PWAHack,
'text' => $products_options->fields['products_options_values_name'].$PWAAppend,'disabled'=>$PWADisabled);
//END PWA EDIT
replace with:Code:$options_menu[] = zen_draw_pull_down_menu('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_array, $selected_attribute, 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '"') . "\n";
Code://START PWA EDIT
$options_menu[] = zen_draw_pull_down_menu_disableable('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_array, $selected_attribute, 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '"') . "\n";
//END PWA EDIT
This appears to be geared towards showing stock for products with only one attribute.. I don't see how this works if you have product attribute variants.. Am I missing something??? Is this found on the Zen Cart Wiki??
**goes off to look @ Zen Wiki**
Hi
I'm using 1.3.8a and stock_by_attributes_4-7ajax
other addons include, image handler, google checkout and a cherry_zen template.
I think I installed the module correctly and it seems to work. I select a product variant in the products with attribute tab, add stock and sync. On checking the parent product stock level all is well it shows the added stock quantity of all the variants.
On testing the checkout end, when I select an attribute, e.g. tie colour, and then add to basket, it and all other varients show as no stock.
any ideas as to what I have done wrong????
thanks
Richard
I'm using the newest version of Zencart and the newest version of this mod, I've also got the Multiadd and I think I've added all the right files.
Problem I'm having is, I've got the stock attributes with stock levels and those are working fine, but in the shop the attributes box is empty, so it's not displaying s,m,l,xl,xxl etc I'm sure it's something simple but I've been through this thread and can't find something specifically relating to my issue.
Any help would be great.
Thanks
To quote a line I heard in a movie once.. "Drop that zero and get yourself a hero"
Let me repeat again, what I have said in this thread (just one page up..)
Of the three flavors of this mod:I could never get the last two to work.. and since the contributors of both of these versions (MultiAdd or Ajax) have NOT ONCE supported their version of this mod, I do not use them.
- Kuroi's version 4.7
- MultiAdd version 4.7
- Ajax version 4.7
My research of the support threads for SBA (there are two pretty active ones) shows that the MultiAdd and Ajax versions are the ones with MULTIPLE problems. Most of the functional PROBLEMS people have with this mod all come from either the MultiAdd or the Ajax versions of Stock By Attributes.
The ORIGINAL is still the best IMO.. So I use ONLY the version 4.7 of SBA that Kuroi wrote. Why deal with problematic mods which bring VERY little beneficial features to the table??) Kuroi is the ONLY mod author still actively answering questions in these support threads, so for my money this is the ONLY version of Stock By Attributes that I will use. (where are the authors of the troubled Multiadd and Ajax versions of this mod???) However I do like and use the stylesheets from the MultiAdd version because it visually makes a nice seperation between the parent product and the variants. However, THAT'S ALL that I used from that version!:smile:
That said if you used Kuroi's version, it's a VERY straight forward install and should work right away.. No hacks or "adjustments" to this mod needed AT ALL! It just works as described..
Kuroi's version of Stocks By Attributes is in the downloads section where you found the (IMO) half/non working MultiAdd and Ajax versions of this mod. The downloads preserves previous versions of add ons below the most current submissions. So if you scroll down and you will see version 4.7 (WITHOUT MultiAdd or Ajax after the version number) and a download link for that version.
ETA
Let me just add the link -- some folks have a hard time "finding" previous versions in the add-on section: http://www.zen-cart.com/index.php?main_page=download_contrib&contrib_id=310&update_id=9
Does this work with text as i installed it and it doesnt appear to be working just comes up showing it as a drop down. Do i need to do anything to change it so i can use text?
OK Thanks I've installed Kuroi's version but I still have the same problem, but I wasn't able to install his sql file as it said duplicate already there and like a total noob I can't figure out how to delete tables in MySQL all I can do is drop the table.
So if anyone can instruct me on how to remove this mod completely and then do a fresh install (more so in the database) as I think overwriting all the files will mean I'm completely on Kuroi's version now.
Here is a link to my one and only product :D you can see whats wrong with the attribute, maybe it's not this mod but any help would be greatly appreciated
http://www.irbsandc.com/cart/index.p...products_id=13
Cheers
I haven't checked explicitly, but I'd be surprised if the other variants of the mod were using a different table structure, so you shouldn't need to re-install the SQL. If you did need to drop database tables you would use a tool such as phpMyAdmin.
I fear that you may be looking for the problem with your attribute display in the wrong place. My version of stock by attributes doesn't go near that and nor does the multiadd version. I wondered if the AJAX version might have an impact (I haven't used it) but can't see anything on the page you gave that would do so.
So I'm left wondering whether the problem is actually that there's something a little off in the way your option, the option values, or the product attribute have been set up.
Is there any easy way to uninstall all the patches etc as i really do need the text one available or is there some altering of code that can be done?
Not sure I understand your question..
Which patches are you referring to??
What do you mean by "i really do need the text one"??
If in your second question you are referring to a text attribute, there is no method in any flavor of SBA to tie a text attribute to stock. SBA in it's current flavors is meant to work for tangible types of attributes (such as size, or color). I know this applies to Kurois version,a nd I'm pretty sure it is supposed to applie to the other flavors as well..
If I am understanding you correctly (and you will have to confirm), it sounds like you are looking for the ability to have non-stock bearing attributes along with stock bearing attributes appklied to a product.
For example let's say you have the following product variant:
T-Shirts
Size: Small
Color: Blue
Number in Stock: 6
Customer could select this product combo (Small, Blue T-Shirt) and also be given an option to have the shirt personalized. The product page would include a textbox attribute where the customer could enter the text they want on the t-shirt.
This would require SBA to allow you to flag some product attributes as non-inventory attributes. Now here's the bad news.. If this is the kind of functionality you are looking for, this mod simply will not support that..:no:
I am looking to move the text that says
"In Stock"
Next to the area where the attributes are instead of where it is.
also is there a way to make a square around the entire area?
Well since I am wishing... Also make the background of that block a different color....
Tried and failed miserably.... Here is the unmodified section.
Link
http://www.nothingbutcostumes.com/in...ducts_id=15554
Stock by Attributes mod by decantlor. Code:
Quote:
<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
// do nothing
} else {
?>
<?php
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
// hide the quantity box and default to 1
$the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
} else {
// show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
//jstephens added for attribute quantity.
if(PRODUCT_STOCK_ATTRIBUTE_SHOW == 'true' && zen_qty_product_attributes_count((int)$_GET['products_id'])) {
$output = '';
include("stock_check.php");
$inf = strlen($output)?$output . '<br />':'';
$attib_qty2 = <<<ABC
<div id='form_stock_check'>$inf
<input type='submit' value='Check Stock' name='stock_check' />
</div>
<script>
document.getElementById('form_stock_check').style.display = 'none';
</script>
ABC;
$attib_qty1 = <<<ABC
<script>
document.write("<div class='attributeQuantity' id='stockTeller'>Checking...</div>");
</script>
ABC;
$display_qty = $attib_qty1 . $display_qty;;
}
?>
<?php if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
echo $display_qty;
echo $display_button;
echo $attib_qty2;
?>
</div>
<?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->
<!--bof Attributes Module -->
<?php
if ($pr_attr->fields['total'] > 0) {
?>
<?php
/**
* display the product atributes
*/
require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php'); ?>
<?php
}
?>
<!--eof Attributes Module -->
Does this mod in any way create unique SKUs for each product/attribute combination by appending the attribute onto the base SKU?
I'm searching real hard for a way to sync my Zen Cart with a Quickbook point of sale system, but Zen Cart's attribute system is making it basically impossible, I need separate SKUs for each attribute combination.
Thanks.
Hi,
I have mass populated my products_with_attributes_stock with all product variant qty's.
I have now realised ALL 4000+ lines need resyncing with the overall product qty.
I there a way for me to run an sql query to do this to ALL lines???
Also, I assume that this needs doing everytime I update my variant qtys.
Many Thanks
Phil
I don't have a SQL script handy that does this, and I would need help myself to construct one (seems there would be a bit of complexity in this kind of update script that is beyond my basic SQL knowledge) but to answer your question generally, yes, you could construct some SQL to do this update..
Only if you update the variant quantities via a direct upload..
In the products_with_attributes_stock class you'll find this short functionIt first collects the summed total for a product's attribute variants and then applies it to the product table for that product.Code:function update_parent_products_stock($products_id)
{
global $db;
$query = 'select sum(quantity) as quantity from '.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.' where products_id = "'.(int)$products_id.'"';
$quantity = $db->Execute($query);
$query = 'update '.TABLE_PRODUCTS.' set products_quantity="'.$quantity->fields['quantity'].'" where products_id="'.(int)$products_id.'"';
$db->Execute($query);
}
To avoid the php and apply it to all products, you would probably want to create a database view or a temporary table based on the first query and then apply the resulting rows in that to all matching rows in the product table.
Thanks kuroi, I shall take a look at this synatx and see if I can create one that repeats the same funtion on all products. So am I right in thinking:
it looks at the attributes qty table and all matching rows of a particular product id, adds up all the corrosponding values in the quantity column and the updates the product id qty with the result in the products table??
Posted via Mobile Device
Hi All
I am having an issue with my stock by attributes. When I select Catalog > Products with attributes stock, Most of the timne I get a message saying a script has stopped working? something to do with Ajax??
Also it says: Suchen: ??what does this mean?
has anyone else got this problem, and or know any other problems before I go live with this add on???
Regards,
Phil
Let me answer with a quote from Kuroi.. (who IMO has written the ONLY version of this add-on that is worth installing)
I've posted in this thread what my opinion is about the "others" (AKA the Ajax and the MultiAdd versions of SBA). I won't repeat it, but here's the link:
http://www.zen-cart.com/forum/showpo...&postcount=776
Yes he does..
I'm afraid no one has written a step by step to remove one of the errant versions of SBA..
Best way to approach this is to open up the folder where you have the source files that you used for your install and one by one open each folder and remove those same files from your store..
That said, I cannot say for sure, but you may be able to simply install the Kuroi version over the Ajax version.. I haven't tried that personally to know if it works..