Forums / All Other Contributions/Addons / Stocks by attributes

Stocks by attributes

Locked

Views: 251,699

Results 161 to 180 of 1,126
This thread is locked. New replies are disabled.
25 Sep 2006, 12:36 PM
#161
davale avatar

davale

Zen Follower

Join Date:
Apr 2006
Posts:
117
Plugin Contributions:
0

Stocks by attributes

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.

25 Sep 2006, 11:28 PM
#162
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Re: Stocks by attributes

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

25 Sep 2006, 11:33 PM
#163
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stocks by attributes

MikeyG:

would prefer a solution for wiorking with drop downs
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.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

26 Sep 2006, 10:59 PM
#164
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Re: Stocks by attributes

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

28 Sep 2006, 12:14 AM
#165
tajul_ashyqin avatar

tajul_ashyqin

Zen Follower

Join Date:
Apr 2006
Location:
Labuan Island
Posts:
362
Plugin Contributions:
1

Re: Stocks by attributes

pro_2k:

in the file "admin/products_with_attributes_stock.php" around line 416

while(!$products->EOF)
{
echo '<tr style="background: #ccc">'."\n";
echo '<td>'.$products->fields['products_id'].'</td>';

> 
> change "**background: #ccc"** to your desired hex colour code :smartass: 
> 
> see the attachment for and example of how it looks :wink2: 
> Attachment #656
> 
> hope this helps!

thank you very much, pro! that should do it... you are really pro! :D

"Whether you think you can, or you think you can't... YOU ARE RIGHT."
GOOD LUCK !!!

4 Oct 2006, 3:08 AM
#166
surlyjake avatar

surlyjake

New Zenner

Join Date:
Sep 2006
Posts:
17
Plugin Contributions:
0

Re: Stocks by attributes

the code that Grayson (http://www.zen-cart.com/forum/showthread.php?t=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/testing-product-p-1.html) is what I would like.

Thank you,

-Jacob.

4 Oct 2006, 4:40 AM
#167
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: Stocks by attributes

surlyjake:

the code that Grayson (http://www.zen-cart.com/forum/showthread.php?t=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/testing-product-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.

Danielle

4 Oct 2006, 5:10 AM
#168
surlyjake avatar

surlyjake

New Zenner

Join Date:
Sep 2006
Posts:
17
Plugin Contributions:
0

Re: Stocks by attributes

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?

4 Oct 2006, 5:47 AM
#169
danielle avatar

danielle

Totally Zenned

Join Date:
Oct 2004
Posts:
973
Plugin Contributions:
0

Re: Stocks by attributes

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 :)

Danielle

4 Oct 2006, 9:27 PM
#170
surlyjake avatar

surlyjake

New Zenner

Join Date:
Sep 2006
Posts:
17
Plugin Contributions:
0

Re: Stocks by attributes

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.

5 Oct 2006, 12:37 PM
#171
typhoon avatar

typhoon

Zen Follower

Join Date:
Jul 2006
Posts:
144
Plugin Contributions:
0

Re: Stocks by attributes

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

5 Oct 2006, 3:16 PM
#172
woodlandsprite avatar

woodlandsprite

Zen Follower

Join Date:
May 2006
Posts:
307
Plugin Contributions:
0

Re: Stocks by attributes

Typhoon:

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.

Live again! http://spritelygoods.com Rebuilt on ZC v 1.5.1 from 1.3.0.2

5 Oct 2006, 3:26 PM
#173
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stocks by attributes

surlyjake:

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.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.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

5 Oct 2006, 3:34 PM
#174
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stocks by attributes

Typhoon:

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,
/TyphoonThanks 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).

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

7 Oct 2006, 12:41 PM
#175
supus avatar

supus

New Zenner

Join Date:
Apr 2006
Posts:
12
Plugin Contributions:
0

Re: Stocks by attributes

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?

7 Oct 2006, 10:16 PM
#176
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stocks by attributes

SupuS:

I found a bug I think ...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.

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.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

9 Oct 2006, 9:54 AM
#177
supus avatar

supus

New Zenner

Join Date:
Apr 2006
Posts:
12
Plugin Contributions:
0

Re: Stocks by attributes

kuroi:

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

9 Oct 2006, 11:32 PM
#178
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stocks by attributes

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:

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

10 Oct 2006, 11:26 PM
#179
royalgemsnz avatar

royalgemsnz

New Zenner

Join Date:
Apr 2006
Posts:
74
Plugin Contributions:
0

Re: Stocks by attributes

surlyjake:

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.

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/showthread.php?t=25987&page=12

For dropdown, post 188 - http://www.zen-cart.com/forum/showthread.php?t=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.

11 Oct 2006, 8:27 AM
#180
royalgemsnz avatar

royalgemsnz

New Zenner

Join Date:
Apr 2006
Posts:
74
Plugin Contributions:
0

Re: Stocks by attributes

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

 $products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
                      'text' => $products_options->fields['products_options_values_name']); 

with

 $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 . ']'); 

as per http://www.zen-cart.com/forum/showthread.php?t=25987&page=19 post 188, change it to this instead.

                  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 . ']');