Apologies if I'm stating the obvious :)Quote:
Originally Posted by buzzville
But for products with atttributes and units of .5 yards...
if you have 10 yards, then you need to state that you have 20 of the item...
Printable View
Apologies if I'm stating the obvious :)Quote:
Originally Posted by buzzville
But for products with atttributes and units of .5 yards...
if you have 10 yards, then you need to state that you have 20 of the item...
is the quantity field in the database set to int or float ? int requires whole numbers, whereas float allows decimals of varying precision
*applause* Thank you DrByte! That seems to have done the trick! Thanks for helping those with zero skills to figure this stuff out!Quote:
Originally Posted by DrByte
Quote:
Originally Posted by MikeyG
Sorry to bounce but would really like some one to explain how this works so I can use it in other ways to manage stock.
Thanks
MG
Hey all!
I'm just about to upgrade my ZC from 1.2.7 to 1.3.0.2.
Everything has been running smoothly but now I've met some hard resistance.
I've downloaded this contrib and installed it without any problems.
But now it fetches ALL attributes on each product who has attributes.
As far as I can see the package is missing attributes_controller.php
Am I right? Anyone who could supply me with the file?
That should be "main_template_vars_attributes.php"Quote:
Originally Posted by Svanis
Hi Bunster,Quote:
Originally Posted by Bunster
I'm having the same problem and tried this fix, but it's still not working for me... I can either get the insufficient stock message for products with attributes or products without, but not both at the same time. Is this still working for you? I'm starting to think this mod is hurting me more than it's helping me...
try my fix on previous post within the same thread; http://www.zen-cart.com/forum/showpo...7&postcount=39Quote:
Originally Posted by buzzville
Hi Buzzvile,
yes as tajul_ashyqin said you will need to add that piece of code as well.
But it still will not display your available stock so your customers will have to guess the magic number for available stock.
To be honest I have now given up trying to get this to function as I want it to and am now looking for alternatives.
I believe this functionality will be in ZCv1.4 but it'll be a while before that see's the light of day, the dev team have more than enough on their plate to be getting on with so no point in pestering them.
good luck
Bunster
Thanks Tajul_ashykin and Bunster. It was the functions_lookup.php file that was the trick. I kept changing one section of code, but missed a second section that did the trick. Now the low stock message is working for both types of stock... I just need to pay a little more attention! Now to see if I can figure out how to get the quantities to show...
do not forget to post it in these forum as i am also trying to achieve it but still no luck... :blush:Quote:
Originally Posted by buzzville
When I've added a product to my cart and then goes back to the product to add it once more this takes me to the cart but doesn't add the product.
This occurs both when adding a new attribute aswell as adding the previously added attribute to the shopping cart.
Products with no attributes works fine.
Seems to be some problems with sessions since removing the session id from the addressbar makes it possible to add the product/attribute to my cart.
I do not know if this relates to this contrib but I saw the problem after installing it.
works fine on my site!:DQuote:
Originally Posted by Svanis
Yeah, thats a good answer..Quote:
Originally Posted by tajul_ashyqin
Anyone got it working in ZC 1.3.5 ?
I receive this error:
Fatal error: Call to undefined function zen_get_new_date_range() in c:\xxxxxx\includes\templates\template_default\sideboxes\tpl_categories.php on line 75
But when I was "un-installing" it, it seems that the error message comes from functions_lookups.php because when I overwrite the file with the original one, the message disapaers...
/Typhoon
Sorry MG, I can't help you out. The mod was written by danielcor. He was kind enough to offer it to the community even though he did not have the time for that. I packed it up for him, but have no programming knowledge myself. It was a gift to be taken as is. Although he does not frequent this thread I believe he is active on the forums.Quote:
Originally Posted by MikeyG
Typhoon,
I have not tried this on 1.3.5, but expect to shortly. I will report back.
Audra
All credit to danielcor for getting this working in Zen Cart 1.3. However, it's been three months since he posted anywhere in the forum, so I think we have to assume that he isn't around at the moment to take it forward.
Consequently, as a personal favor to Bunster, I have taken this add-on, tidied it up a little (i.e. reduced the number of core files that need to be over-ridden) and upgraded it to work with Zen Cart 1.3.5, with the intention of also looking at some of the problems people, e.g. Bunster, have been experiencing with it.
However, there's a catch. I have no previous experience of using Zen Cart to manage stock by attributes. The good news is that there seems to a fairly active user community for this add-on, so this is a call for Beta Testers.
:beta:
If you have used previous versions of this add-on, understand that this will be a beta version supplied for testing purposes only, are ready to test on Zen Cart 1.3.5 and promise to provide feedback on what works and what doesn't, then PM me. The add-on is in alpha test at the moment and will be ready for beta test shortly.
audradh: Thank you, looking forward for your answer...
kuroi: This is a very good initiative from you that is very appreciated around here, for sure. Please let me (us) know when you have the beta test available, I'll be happy to try it out.
Regards,
/Typhoon
Thanks Kurio, I think you have just put a big smile on a lot of faces knowing this mod is being looked at.
Bunster
<Bunster scurries off to eagerly prepare a ZC1.35 test server>
I sure hope so Bunster.
Good news is that alpha testing is progressing very smoothly, so smoothly in fact that I've been going back over this thread and adding fixes for those of the bugs reported that I understand.
Please note however, that as I hope this code will become redundant when Zen Cart 1.4 is released, there are quite strict limits on the amount of development that will be done to this add-on.
Woops! I never even gave the stock with attributes a second thought after its been working so smoothly with v1.3.02, stupidly i've started my upgrade to 1.3.5 already! well, might as werll bite the bullet and see if it works... if it does/not i'll keep you posted with my progress.
I was just comparing my files and came across the funcion_lookups one, and thats what sparked my thinking :)
I havent read through the previous posts yet, but im sure i'll have to :)
The existing package will fail with 1.3.5. At the least you will need to amend the functions_lookups.php file. I have amended other files too, though don't know if these changes are critical or "nice to have".
Kuroi:
Feel free to add me as a Beta tester - I've a fair bit of experience with a slightly modified version of the stocks by attribute on 1.3.0.2
Unfortunately I'm not yet sure when I'll be doing my upgrade as I'm waiting to see how many of my other modules are being updated.
Thanks for taking pity on those like me, who can't code my way out of a paper bag :P
I'd like to be a beta tester as well. Thanks!
OK. The updated add-on is ready to move from alpha testing to beta testing. Here is a list of the amendments and additions:
1. Removed zen_ prefix from table creation SQL allowing it to be run by Admin > Tools > Install SQL Patches (bug fix)
2. Changed quantity field to float in products with attributes table allowing fractional stock quantities (bug fix)
3. admin/orders.php updated for compatibility with Zen Cart 1.3.5
4. admin/products_with_attributes_stock.php updated to pass a languages_id to functions get_products_attributes and get_attributes_name each time they are called (bug fix)
5. includes/functions/functions_lookups.php updated for compatibility with Zen Cart 1.3.5
6. products_with_attributes_catalog_dhtml.php file created so that catalog_dhtml.php no longer needs to be over-written (new feature)
7. Language file for Admin is now used, which together with earlier bug fix should allow full integration with carts whose Admin is not in English (new feature)
8. Re-enabled check stock and disable checkout feature for all products (bug fix)
9. Fixed "Out of Stock" indicators in Shopping Cart for products with attributes (bug fix)
10. Added "Stock Available" to shopping cart page for display when stock is low. This can be turned on and off via the Admin > Stock menu (new feature)
11. Low stock email now triggered by low stock on an attribute, even if overall stock for product remains above stock reorder level (new feature)
My fixes for languages issues, and the "out of stock" messages are different from those posted higher up in this thread and will not suffer from the knock-on problems that those solutions caused.
The robustness of the changes ranges from completely tested with high confidence, down to fairly certain that this will work but needs testing by somebody with more experience in this area. I'm therefore now turning it over to those who have kindly volunteered to beta test (who will be contacted privately), but would still be grateful for a beta tester volunteer who is running a shop with the Admin in a language other than English.
Hey Kuroi, nice going! I've been comparing the mod files to 1.3.5, but I guess I'll spend my time more productively now!
I'm sure danielcor would be more than pleased to hear that someone is running w/ this.
It sounds like you have found some beta testers already, but I would be happy to help if you need additional feedback. Unfortunately, I run an English only shop, so cannot help on that front.
Another appreciative Zen user, who cannot survive without this mod:yes:
Audra
Running a Swedish shop, hook me up..
Is there an accepted procedure to becoming a beta tester or is it just hands up in the air?
Hands up in the air is working fine for the moment. You have a PM (personal message) with more details (as hopefully does everybody else who has vounteered up to this point).
can these updated mod restock the quantity of the attributes stock upon cancellation of order?!
I haven't done anything explicit to create it and so unless one of my fixes has enabled code already intended to do this (I know that Danielcor tried) to work properly, it is not included.Quote:
Originally Posted by tajul_ashyqin
However, as you are now a beta tester with a better idea than me what you are looking for ... I look forward with anticipation to hearing your answer to the question!
I've downloaded and installed this module.
It appears to me that it will not allow me to keep track of attribute stock separately from real stock.
EG, I've got products where I combine two things to make a single product.
So I can order a small, medium, or large bracelet with design X, Y, or Z
My stock consists of:
12 large bracelets
12 medium bracelets
12 small bracelets
And separately of:
8 design X's
9 design Y's
3 design Z's
When someone orders a small bracelet with design Y, I should decrement the stock for small bracelets and for design Y.
It doesn't appear that this add on will allow me to manage stock as such, correct? Rather, it would only work if I had a fixed number of
12 large design X
14 large design Y
7 large design Z
3 medium design X
11 medium design Y
6 medium design Z
3 small design X
5 small design Y
1 small design Z
Correct?
Does anyone know of a module that handles the situation I am presenting? Would it be simpler to customize this module or start from scratch? It seems to me that starting from scratch would be easier, but I don't know the inner workings of this module...
Thanks very much!
If I understand correctly the situation that you have described, your products have two components: a bracelet and a design. These are separate until a customer makes an order when you combine a bracelet with a design to create the product ordered. The resulting product will have attributes of size and design, but what you quite logically want to track is your stock of raw components. Stock by Attributes is not designed to do this. Nor to my knowledge is there any other add-on that is.
On my previous version of the shop (1.2.7) in combination with attribute stocks I was able to add a little text behind the actual attributes in the product info page.
Example
Size:
Small [In stock]
Medium [Available att supplier] (<- Not as much text in swedish :P)
This was done by editing/adding the following code to: includes/modules/pages/product_info/main_template_vars_attributes.php
This was something that I found very useful as customers knew what to expect when it comes to delivery time even before adding the product to the cart.Code:if ($products_options->fields['quantity'] > 0) {
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name'] .' [ '. TEXT_ATTRIBUTES_IN_STOCK . ' ]');
} else {
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name'] .' [ '. TEXT_ATTRIBUTES_NOT_IN_STOCK . ' ]');
}
Anyone who has implemented something like this to stockAttribute3.01?
That was a very good idea to maybe have as an option from Admin. I hope it will be implemented also...Quote:
Originally Posted by Svanis
/Typhoon
Note:
By adding the above mentioned code in [b]includes/modules/attributes.php[/]
makes the "Not in stock- message" appear.. This is on all attributes though.. :|
I'm looking at it right now :smartass:. It's certainly a candidate. It may not need an admin switch as you could turn it off by setting the text to NULL. I'm also considering three levels equivalent to "in stock", "low stock" and "out of stock".
Downsides - I can see how it would work if there were just one attribute, but how would it work if there were two or more. I'd be interested to hear what you stock experts think :unsure:.
I'm pretty sure that it would be in need of either ajaxification or javascript for it to update and match the different attributes.Quote:
Originally Posted by kuroi
I think that this has been discussed before. Since I'm not that much of a coder myself I don't know how to do it but similar has been done in the admin part of the site.. I think it's called Improved attributes controller..
Hey,
I'm starting up a new shop with newest ZC version 1.3.5 and I would love to use and beta-test this Stocks By attributes newest beta! :)
I've already downloaded the one from the Downloads but since reading here so much warning it is better to start being a beta tester. Great!
Elli
I'd like to be a beta tester too :DQuote:
Originally Posted by kuroi
Here's another candidate for the beta-force!
I've tested the code with php 5 and there are some '<?' php tags in the main php file that needs to be changed to '<?php'.
Is this module available for beta testing yet? I would like to work with it as well. I am trying to start with my first zen cart store which requires this module.
I'm hoping to be able to start with version 1.3.5 from the beginning, but I absolutely need the stock by attribute for this store.
Thanx,
Steven
:wacko:
Will the new (beta) version enable customers to search attributes?
art03: as you're not in the beta testing the current version (to my knowledge), I assume that you are referring to the current version. However, this has been fixed for the 1.3.5 version due for release shortly.
davale: No. I'm afraid that the new version will no provide additional functionality to allow customers to search attributes
beta testers: please remember to send feedback via beta AT kuroi DOT co DOT uk rather than by PM as my mailbox is getting overwhelmed at the moment and I'd hate to see your carefully constructed feeback lost because it can't get delivered. If you have feedback and haven't yet sent it, please do so ASAP.
prospective beta testers: WOW. There are a lot of you. This is clearly going to be a much used add-on. As managing requests to beta test is now taking more of my time than actually preparing this add-on for formal release and more importantly (for me at least) blocking my mailbox for people with whom I am discussing paid work, I am closing beta testing to new participants. However, I will make exceptions for people actually running multi-lingual or non-English stores who promise faithfully to give me feedback. For everybody else, a little patience please, the finished add-on should be along shortly.
Well after upgrading my old zen to the latest new one, i thought that everything was in order... until my brother asked me how he could change the "attributes with stock" so Loh and Behold, it wasn't there! The way our stock works at the moment is different to most;
ive written a php program to retrieve xml product information from our suppliers server, which then updates our stock counts, whether they have attributes or not... Though our products will need attribute stock levels soon because we're going to start buying products and holding real stock!
I tried the function rewrites as with the old version of the attributes with stock contribution, but it failed miserably, as stock levels did not reduce when products were purchased.
I wish you the best of luck with writing this, its quite a shame really that the zencart developers didnt write this functionality into the core of their fantastic program.
Will be following this thread eagerly for progress :-) :-)
I have read through every page and am still not sure how to upload the files for the attributes by stock module. In phpmyadmin i accessed the database and found a table called zen_products_with_attributes_stock but am not sure what to do with it. All the settings for each component are correct ie stock_id but when i click on import, im not sure which files I am supposed to upload so i have tried the complete zip which obviously has not worked. Any ideas please?
This will actually be part of the core code in an upcoming version, I believe it will be in 1.4 :clap:Quote:
Originally Posted by pro_2k
You have to upload the files in the zip file to your website, usually via FTP, making sure to upload them to the correct folders for your template. The readme.txt file that is part of the zip file should help with that. The sql file is the one you upload to the database, you can do this by going into your zen admin, clicking Tools-Install SQL Patches, and then uploading the sql file from your computer.Quote:
Originally Posted by fashionistawear
Quote:
Originally Posted by Danielle
woooohoooo!! I'm sure I read that somewhere a long long time ago, back in the days of version 1.2.x!! :book: Does anyone have any idea on the "timescale" (dare I say? :lamo: ) of zencart 1.4?
i want to change these color, see attachments! any idea?
I would like to be a beta tester. Where do I sign up?Quote:
Originally Posted by kuroi
in the file "admin/products_with_attributes_stock.php" around line 416Quote:
Originally Posted by tajul_ashyqin
change "background: #ccc" to your desired hex colour code :smartass:PHP Code:
while(!$products->EOF)
{
echo '<tr style="background: #ccc">'."\n";
echo '<td>'.$products->fields['products_id'].'</td>';
see the attachment for and example of how it looks :wink2:
Attachment 656
hope this helps!
kuroi
the fixes and additions sound great would love to get my hands on a copy.
Just one thing which has been bugging me on an earlier version is that I added gift wrapping as an attribute, which the customer can select with different papers, to all products but this then mean that all my products in the products with attributes stock table were wrong ie. the table has the field which is comma delimited and is looking for a combination of attributes id including the gift wrap id for each paper.
by the current process for the stock with attributes I manually have to add every line to every product. But I don't hold stock of a t-shirt wrapped in red paper I just hold a t-shirt.
Can you turn off an attribute like this from effecting the table and the stock with attributes process.
This would be a great fix. Has anyone else got a solution?
Thanks
MG
There is a fix for this somewhere in this thread: http://www.zen-cart.com/forum/showthread.php?t=25987. I'm not sure what page it's on though, but I think it's around half way through or maybe a bit further. I haven't tried it so I don't know how it works, but I'm planning to try and get it working on a 1.3.5 shop...Quote:
Originally Posted by MikeyG
Tajul: Thanks for drawing my attention to all this inline CSS. I've taken it all out of the 1.3.5 version.
pro_2K: No we have no idea when 1.4 will arrive, probably tomorrow since I've just finished the Stock by Attribute upgrade for 1.3.5.
shannda: Beta testing closed several days back, but not to worry, the release version should be available from the downloads section within the next 24 hours or so.
MikeyG: you don't say which version of Zen Cart you are using, but when I took a look at your problem to see whether there was a quick fix that I could put into the 1.3.5 version, I found that it wasn't necessary. Although text fields show up, it's not necessary to give them a value when creating a variant for stock purposes. So they take up space on the screen (a pain) but don't force you to proliferate variants. As I did nothing particular to make this so, I rather suspect that it was already present in the Danielcor version from which the latest one has been built.
All beta testers: I received a lot of feedback, in many cases the same question or comment arrived several times with the only change being the words used to express it. Rather than respond to every tester individually, I have constructed a Q&A type response to all the points raised and popped it in the Wiki. You can find it at the bottom of this page.
nice piece of job, kuroi! :yes:
Great job indeed kuroi. Working my way through it right now.
Don't want to sound ungrateful but I still have something to wish for.
As stated in the Wiki:
Quote: - Could attributes for which there is no stock be suppressed from the product information page?
Another one that works best when each product has at most one attribute, but is much more complex when conbinations of product are involved. Let's hope that this is included in the official Zen Cart development.
+ Question: I have only one attribute; size. But there are over 20 options for size and that looks terrible on the product info especially when only 2 or three sizes are in stock.
Is it possible to publish some code that enables me to suppress options without stock and patch AwS for my specific needs with only one attribute?
Quote: - Could we have a quicker way of adding attributes?
I'd love one too. Bunyip's Improved Attributes Controller contributes. However, this is rather beyond the limited scope of Stock by Attributes.
+ Question: Adding 20 options to a couple of hundred products one by one is killing me. Bunyip, would you be willing to look at kuroi's code and see if it is possible to add the 'multiple select' from Improved Attributes Controller' to 'Attributes by Stock'? Your IAC-contrib is a real timesaver for me and it would be so great to have this incorporated into SbA too! Please, please, please.
The upgrade to this add-on for 1.3.5 deals is now available for download from here.
As it deals with many of the issues mentioned above in this thread, I have created a new support thread specifically for the new version and suggest that we now leave this thread to those users still using danielcor's version for 1.3.0-1.3.02.
The new support thread may be found here.
If you go this archive thread and seek out post #110 by Grayson, and her correction in #132, she proposes some code that may work for you. She's proposes code to show quantities for each attribute (though it will only work when there is at most one attribute per product), which could easily be adapted to supress display instead when the quantity is 0.Quote:
Originally Posted by davale
Thanks kuroi for pointing me to these posts. But I'm afraid this a little out of my league. I'm having trouble reading the code let alone editing it to fit my own needs.
I'll give it a go but maybe Grayson is willing to help me out here.
Kuroi
Many thanks for yor reply. Using 1.2.7d at moment as Iam still testing the new version before going live. For the wrapping option for customers I am using a drop down for them to select the paper type so if there is a way to turn off this as being part of the stock by attribute table so that any product with gift wrap will work that would be great. Thank you for pointing out that text fields don't effect the table.
This miighht be an option but would prefer a solution for wiorking with drop downs
Regards
MG
Understood. I believe that the specific posts in the archive thread to which Danielle was referring you above were a group starting from post #199, though I'm afriad that I haven't at them closely enough to see if they offer anything for your preferred approach.Quote:
Originally Posted by MikeyG
kuroi,
many thanks sounds like exactly what I need just need to get hold of the code. Not too sure if seizer ever posted it. Have sent mail to see if it is available. Does any one else have this solution?
Thanks in advance for all your help.
Best wishes
MG
thank you very much, pro! that should do it... you are really pro! :DQuote:
Originally Posted by pro_2k
the code that Grayson (http://www.zen-cart.com/forum/showth...=25987&page=11) posted refers to "includes/modules/pages/product_info/main_template_vars_attributes.php" I am assuming this is for an older version than I am running right now because I can't find that file. Is there a solution for 1.3.5? ultimately this (http://www.zencart.jadetrue.com/test...oduct-p-1.html) is what I would like.
Thank you,
-Jacob.
That file is there in 1.3.5 :) I got it to work on my 1.3.5 site following Grayson's directions, however, it only works if you only have one attribute, like on that site you posted the link to. If you have, for example, color and size seperately, it does not work.Quote:
Originally Posted by surlyjake
thanks for the quick reply, but i cant even find it in the original zip for zencart 1.3.5. or for products with atributes v4.1 I'm probably missing something, any light?
Oh my goodness, I'm so sorry, I should be in bed :blush: When I looked for the file, I looked in my live site, which is 1.2.6 lol. Sorry! In 1.3.5, the file you need to edit is includes/modules/attributes.php. The changes are exactly the same as Grayson's though :)
thanks again. I will say for the record that the "includes/languages/english/your_template/product_info.php" file is at "/store/includes/languages/english/product_info" in 1.3.5. Just one last question... what change do I make to allow dropdowns, or have it display
"in stock" if qty>0 or
"out of stock" if qty <=0
instead of the actual inventory level.
Great job, Kuroi !!
I have one small problem though, don't know if it's a big job or not but it's good to know that it exisis. If I delete an order (nothing that will happen very often, I hope :D), the items on the order won't re-stock, I have to add them manually.
Anyone else that have this "problem" or is there something wrong with my installation maybe ?
It's not a big problem maybe but if it's fixable, it would be super...
Regards,
/Typhoon
Typhoon: That functionality was not built into the original version either. I do not believe it has been "fixed" in this version.Quote:
Originally Posted by Typhoon
Yes, but the one that you would amend would be the over-ride copy that you create at "includes/languages/english/YOUR_TEMPLATE/product_info.php", otherwise you risk over-writing your changes next time you upgrade or patch your system.Quote:
Originally Posted by surlyjake
Thanks Typhoon, but I'm afraid that woodlandsprite is right. This functionality was not part of the previous version and has deliberately not been added to this one. This is throwaway code that will hopefully have a lifetime of jut a few months before the Zen Cart team produce their own (and better) solution. I therefore took a conscious decision not to expend time expanding the functionality, or to build functions that would intrude as deeply as this into core Zen Cart code and risk creating a headache for users when they upgrade to version 1.4. But by all means post this in the Zen Cart Support Forum :: Code Matters :: Features Wish List section of the forum (if it's not already there).Quote:
Originally Posted by Typhoon
Hi kuroi
Really good work but I found a bug I think ..
If I install Stocks by attributes module everything works fine but if I change Order Total Modules sorting on Tax ot_tax from default 300 to 980 I get error
Warning: Invalid argument supplied for foreach() in /var/www/web49/web/includes/classes/order.php on line 750
Warning: Cannot modify header information - headers already sent by (output started at /var/www/web49/web/includes/classes/order.php:750) in /var/www/web49/web/includes/functions/functions_general.php on line 41
on checkout_process.html page (when I finishing shopping).
If I delete your order.php and put there a original file everything works well.
Any suggestion please?
Unfortunately, it's not at all obvious how changing the sort order of the order total tax could have any effect on Stock by Attributes, and although I have tried several different approaches, I haven't been able to replicate your problem.Quote:
Originally Posted by SupuS
Please can you tell me some more about how you have set up your taxes and also about any other add-ons that you have installed.
My taxes are:
geo-zones: SK
tax-classes: Bezna DPH
tax-rates: 19%
(I don't know what you need to know .. I can post my configuration table from database if it helps)
In orders I have:
ot_cod_fee 950
ot_group_pricing 290
ot_round 990
ot_shipping 200
ot_subtotal 100
ot_tax 980 (if this is on default 300 error disappear)
ot_total 999
I have installed this modules:
Stocks by attributes
Image Handler
XML generator
Quick Contact Sidebox
Ultimate SEO URL's
ot_round
Tabbed Products Lite
Only one of these is in orders modules ... ot_total .. but if I uninstall it in zencart admin the error remains.
As I said .. with original order.php everything is ok ..
thank you for your help
Thanks for the extra info SupuS. It's very helpful.
I have a second report of this same error at the same line but under very different circumstances so I will be taking a very close look at it over the next couple of days. It looks interesting :yes:
To answer your question to get it to display if its in stock or not, look at post 113 here - http://www.zen-cart.com/forum/showth...=25987&page=12
For dropdown, post 188 - http://www.zen-cart.com/forum/showth...=25987&page=19
I've just put both on my site. Unfortuantely they don't seem to work together. Radio ones will show 'in stock' & 'out of stock', while drop downs still show stock quantities.
Does anyone have a remedy for this? - I'm guessing the new dropdown code ignores all the previous and reads it from elsewhere.
In answer to my previous question, here the remedy. Many thanks to my flatmate is is somewhate more php literate than I am.
Instead of changing
withPHP Code:
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name']);
as per http://www.zen-cart.com/forum/showth...=25987&page=19 post 188, change it to this instead.PHP Code:
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name'] .' [' . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . ']');
PHP Code:
if ($products_options->fields['quantity'] >0){
$dropdown_instock = TEXT_ATTRIBUTES_IN_STOCK;
} else {
$dropdown_instock = TEXT_ATTRIBUTES_NOT_IN_STOCK;
}
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name'] .' [' . $dropdown_instock . ' '. TEXT_ATTRIBUTES_PIECES . ']');
In answer to my previous question, here the remedy. Many thanks to my flatmate is is somewhate more php literate than I am.
Instead of changing
withPHP Code:
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name']);
as per http://www.zen-cart.com/forum/showth...=25987&page=19 post 188, change it to this instead.PHP Code:
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name'] .' [' . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . ']');
PHP Code:
if ($products_options->fields['quantity'] >0){
$dropdown_instock = TEXT_ATTRIBUTES_IN_STOCK;
} else {
$dropdown_instock = TEXT_ATTRIBUTES_NOT_IN_STOCK;
}
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name'] .' [' . $dropdown_instock . ' '. TEXT_ATTRIBUTES_PIECES . ']');
hi,
i am having a major problem for these mod. i just do the admin activity reseting this morning and now i cannot set my stocks attributes like before!:cry: see my admin_attributes attachments! this is how it looks from the admin after i try to define the stocks for respective attributes! :cry: when i go to my cpanel to check the entries for the attributes, i am surprised as the entries for the just-new-added attributes (after the reseting session) in stock_attributes fields, only 'A' appears!!! :cry: see the second attachment!
i hope somebody have a fix to it...
4u info, i am using danielcor stocks by attributes mod!
Well that's not the way it's supposed to work :no: Firstly to make sure I have understood correctly ... you reset the admin activity log and then entered new attribute stock values? The values entered before the reset are OK, those entered after have this stock_attribute value of "A"? Is this the first time that you have done an activity log reset with stock by attribute installed and in use?
The blank value on your screen is no surprise as the data that would normally be in the field where the As are appearing is obtained via an integer index into another table - obviously As can't do that. So the real issue is how did the As get there.
As an aside this is a direct result of the $*#~@! database structure that this mod has. If integer indexes weren't held as strings in the first place, this simply couldn't happen. Not Danielcor's fault either - like me, he has inherited a structure that goes right back (I suspect) to the original osCommerce mod which spawned this one. Happily Zen Cart does it better and this will be fixed in 1.4.
Hopefully somebody will come up with a solution to this today. But if not, I have time set aside tomorrow to investigate the problem in my later version of this mod reported by SupuS above and mikajlo on another thread, and I will also look at your problem to see if I might have carried it into my version or if it is already dealt with by one of my fixes and can be retrofitted.
Supus, I have tried twice (several days apart) but not succeeded in replicating the bug that you describe in the way that you describe it. However, I can replicate it in a different way for which the fix is ...
In includes/classes/order.php find line 696and immediately afterwards insertQuote:
$attribute_search array();
I believe that there is a high chance that this will fix your problem also. Please try it and let me know.Quote:
$attribute_stock_left = STOCK_REORDER_LEVEL + 1; // kuroi: prevent false low stock triggers
If it doesn't work for you, please provide more specific information about the products that you are buting, the attributes that they have (if any) and their attribute stock level. Thanks.
Tajul, Could you backup the following tables (ideally with phpMyAdmin) and email a copy to me at the email address using for Stocky by Attributes 1.3.5 beta testing?ThanksQuote:
products,
product attributes,
products_options,
products_options_types,
products_options_values,
product_options_values_to_products_options,
products_with_stock_attributes
yup, that was had happened! it just happened after I reset the admin activity log and entered a new values! before this, I did reset the log but without stock by attributes installed and this was my first time having it after few months of my live site... thanx kuroi for helping me out! I;ll email what ever you need...
OK. I've tracked down the bug and have a fix. It applies to both Danielcor's 3.0.1 version and my 4.1 version. A 4.2 version for Zen Cart 1.3.5 users has been submitted to the downloads area containing this, the resolution of Supus's issue a few posts back and some improvements to the alignment of data on the stock page.
If you're running an older version of Zen Cart and are therefore still using Danielcor's version, you will need to apply the first change by hand, but it's fairly straightforward.
All the changes take place in admin/products_with_attributes_stock.php. Make sure you have the right file (there are several with this name).
Find the following line (probably 149) and delete itFind the following block (probably 155-163)Quote:
$s_mack_noconfirm .="attributes[]=" . $attribute_id . "&"; //s_mack:noconfirm
and immediately afterwards addQuote:
if(sizeof($attributes) > 1)
{
sort($attributes);
$stock_attributes = implode(',',$attributes);
}
else
{
$stock_attributes = $attributes[0];
}
Find the second instance of the block above (around about 202-210) and delete it.Quote:
$s_mack_noconfirm .='attributes=' . $stock_attributes . '&'; //kuroi: to pass string not array
Find the following line (now about 205) and delete the bit marked in redQuote:
$query = 'insert into `'.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.'` (`products_id`,`stock_attributes`,`quantity`) values ('.$products_id.',"'.$stock_attributes.'",'.$quantity.')';
Help:::
I have installed the contribution on a 1.3.5. version and it works really good EXCEPT that the variant stock levels are not updated after an order i.e. remain the same when I purchase stock, the main product "Quantity" reduces correctly, and sync brings it back to the original level, Anyone know how to fix this or can anyone point me to the code that should do this so I can try. Thanks for any help.
Hi Again
Your reply got me thinking and so I just got the latest version and it now works fine, my eyes must be getting bad as I didn't see the updated download link. Many thanks for the help.
So, I've installed version 4.2, made the changes described in this thread: http://www.zen-cart.com/forum/showthread.php?t=25987 by grayson on post 110 and 132. And I'm still not able to have quantities show up on the product info page.
help?
thank you.
Version 4.3 of this mod for Zen Cart 1.3.6 is now available in the downloads section. Due to my other commitments it's less extensively tested than previous releases. The changes shouldn't have introduced any new problems, but if you find any please post them in the following thread: http://www.zen-cart.com/forum/showthread.php?t=47180
Hello All,
OK - let's see if i can explain this:
i installed the mod (i'm running zen version 1.3.0.2) works great.
However, i have some products in which i would rather not be controlled by the stock by attributes mod.
i figured that if i just didn't add a varient, the "Main" inventory stock would be used...not the case. it seems that if a product has attributes, the stock MUST be controlled by the mod, otherwise i get an "out of stock" error.
is there anyway i can have some products with attributes controlled by the mod, and at the same time have products with attributes rely on the "Main" inventory level?
Please let me know, i couldn't find anyone else in the forums with this question, so something may be screwy with my cart....
Thanks!
s.
I have downloaded the module by kuroi but I'm not sure how to tell Zen Cart what stock I have in each size. My products have size attributes on them but I still only see one Product Quanity box on the product not one for each size. Sorry can you help. Are there any instructions anywhere. Sorry first time zen cart user so its a steap learning curve.
Hi s.
As far as I know, this cannot be done with the current mod. If your issue is simply that you do not want stock controlled for these products then you can set the level (in the products with attributes stock area) to an obscenely high number, so that you only have to go through and input the stock for those products once.
Sorry I don't have a better answer for you.
Audra