I have a version for 1.3.6 but haven't had time to test it yet. Apologies to others who have asked questions, I will be back to answer them when pressure of work permits, in the meamtime, hopefully other members of the community can help.
I have a version for 1.3.6 but haven't had time to test it yet. Apologies to others who have asked questions, I will be back to answer them when pressure of work permits, in the meamtime, hopefully other members of the community can help.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
I installed the mod and it seems to work as promised. Nice job. However, my client apparently does not want to deal with adjusting stock levels for every variation of product. Is there a way to disable this and go back to the old way?
Is there a switch or do I need to copy over some "new" files with original ones?
Thanks,
Chris
Anyone???
I replaced all the overwritten files with the original, but am now getting the following error after checkout from the shopping cart:
Fatal error: Cannot redeclare class httpclient in /home/chubby/public_html/shop/includes/classes/http_client.php on line 22
I gotta launch this thing in the next coupla days. Any help is appreciated.
Chris
My fix for this (rather, a workaround) was that I had to KEEP the changed version of header_php.php in the modules/pages/checkout_shipping. The original version of the file was causing the error for some reason.
Anyway, it works and attribute stock is not required. I basically deleted and replaced all the changed files with originals (excepting above) and deleted the new database entries/tables.
PL
I hope that you release your version for 1.3.6 soon. When I installed stock by attribute on 1.3.6, I encountered a minor bug. When you try to change Configuration>'show stock when low', there is a error message:
So I just left this field unchanged. Anyway, I think this is just a minor bug and the problem probably came from admin/products_with_attributes_stock.phpParse error: parse error, unexpected T_STRING, expecting ')' in /home/user/public_html/admin/configuration.php(192) : eval()'d code on line 1
Problem solved!! Sorry, my mistake. The problem was cause by myself. I changed stock_attribute sql syntax when installing the first time in light of my past experience with contribs installations such as super order 2.0.
Now, I simply reinstalled the stock_attribute.sql as it is. Problem solved.
It seems like this contrib is working with 1.3.6 so far.
Hi Frank. Glad you solved the problem, and thanks for posting the answer. It's always helpful when people do that as Zen Cart now has such a large base that sooner or later somebody else will probably do something similar.
The Zen Cart 1.3.6 version (mod version 4.3) is now available in the download 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.
I strongly recommend upgrading to this version as it incorporates some of the security changes added to Zen Cart 1.3.6.
If you are using languages other than English or French, you will need to make some minor adjustments to the language files, otherwise upgrading is simply a matter of overwriting your existing mod files.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
First, a little bug that I found in your new release by using beyond compare with older ones.
In functions_lookups.php on line 163:
should've been:function zen_get_products_stock($products_id) {
Next, I applied a fix by Grayson posted in archived threads to show qty of attributes on product info page. For those who still having trouble with this fix, I am including the attributes.php file here. You may drop it in includes/modules/your_template/ folder./* function zen_get_products_stock($products_id) {
I am also including another alternative version of this fix (I take no credit whatsoever on this), which shows attribute stock after price_fix and weight etc. display, which makes more sense to myself, becasue this way customer won't confuse stock level with quantity discounts/surcharges. This alternative file is called attributes_Alternative.php. You need to rename it to attributes.php to overwrite the existing one when using.
Don't forget to add a define to the product_info.php in includes/languages/english/your_template folder, such as:
[quote][define('TEXT_ATTRIBUTES_PIECES','pieces');/QUOTE]. I use 'in stock' instead of 'pieces', for it makes more sense.
Now, I need help for myself!! I tried hard to set a "display only" option value such as " select from below" to NOT show stock level, which is a conditional undone of the above fix in attributes.php. I tried codes as follows, but no luck:
This block of codes were applied after the "// prepare product options details" section and before "//radio buttons" section./*
* check if attribute is display only
*/
global $db;
$check_attributes = $db->Execute("select *
from " . TABLE_PRODUCTS_ATTRIBUTES . "
where products_id = '" . (int)$products_id . "'
and options_id = '" . (int)$option . "'
and options_values_id = '" . (int)$value . "'");
if ($check_attributes->fields['attributes_display_only'] == '1') {
$products_options_value_id = $products_options->fields['products_options_values_id'];
$products_options_details = $products_options->fields['products_options_values_name'];
$products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
}
Any help on this would be greatly appreciated!
Last edited by frank_lyy; 20 Nov 2006 at 11:19 AM.
Hi Frank
I'm not sure whether the bug that you pointed out would have any functional implications, but it's clearly wrong so I've updated the release pack to 4.3.1. Many thanks for pointing it out.
In respect of the Grayson solution. It clearly works for some people, but comes with the big caveat that it is only suitable for situations where your products have just one attribute (the reason why it has not been incorporated into this or earlier versions of the mod).
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
You are absloutely right. The Grayson solution is for products which have only one attribute! I have two attributes on one of my products. In order to use Grayson's fix, I combined the two attributes into one, and named it (very clumsy looking) something like "Color + Size Combination". I sincerely hope someone could come up with a better solution on multi-attribute stock control as well as product info display on these attributes in the near future!!!!
By the way, I solved my own dilemma. I tried to set a "displayonly" attribute as default selection to force attribute selection when add product to cart. Now, I figured out how to set this particular attribute back to NOT showing stock level (for many reasons, but mostly for a better looking). Here is my solution:
Find attributes.php in includes/modules/your_template floder from Kuroi's contrib( many many thanks to Kuroi! Great mod!). Change this code:
to the following:$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name']);
Next, right above this line://check if attribute is display only
if ($products_options->fields['attributes_display_only'] == '1') {
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name']);
} else {
$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 . ']');
}
add the following://radio buttons
I wish these changes can be of some help to somebody out there who needs it. I am not a programmer and I've got a lot of help from various smart people in this forum before. For that, I am very grateful.//check if attribute is display only
if ($products_options->fields['attributes_display_only'] == '1') {
$products_options_value_id = $products_options->fields['products_options_values_id'];
$products_options_details = $products_options->fields['products_options_values_name'];
$products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
}
//check complete
"Stock by attributes" should be inculded in future zen-cart releases and hopefully has much more intelligent fuctions by then.