Zen Cart Logo
Forums / All Other Contributions/Addons / Stocks by attributes

Stocks by attributes

Locked

Views: 251,296

Results 601 to 620 of 1,126
This thread is locked. New replies are disabled.
21 Feb 2009, 3:24 AM
#601
kellan4459 avatar

kellan4459

New Zenner

Join Date:
Dec 2008
Posts:
79
Plugin Contributions:
0

Stocks by attributes

kuroi:

No they're not. They're still available for inclusion and even if a .php extension is tested for in this specific instance thus excluding them, mixing backup and live files is bad practise and has the potential to get you into trouble elsewhere in Zen Cart (or any other app).

I agree with kuroi. Leaving them out there only asks for trouble.

Before I do a mod I copy the current working state over to a directory on my system named zencartbackup and then install the mod to my zencart directory. If I have any issues I can delete zencart directory and rename zencartbackup directory to reinstate my system to where it was. I then have no worries that any file changed to .php.old or .php1 is somehow grabbed or mistakenly renamed or any other slip up that puts them into the mix and causes me headaches.

I also only install one module at a time so it is easier to debug.

22 Feb 2009, 10:04 PM
#602
cropinstop avatar

cropinstop

New Zenner

Join Date:
Oct 2006
Location:
Surprise Arizona
Posts:
73
Plugin Contributions:
0

Re: Stocks by attributes

In a previous post, I discussed in passing a problem relating to being able to purchase out of stock inventory when using Stock by Attributes. If the solution is discussed elsewhere, I apologize.

Specifically, if a product is set up for Stock by Attributes, it is possible to buy a subproduct that is out of stock after receiving a warning at the shopping cart that the selection is out of stock. But this behavior only happens if the quantity ordered is more than the quantity available for the subproduct, but less than the total stock available for all subproducts. Here is an example:

Item= scrapbook, available in red, green, black. Set up using Stock by attributes as follows:

  • attribute= red, quantity = 4
  • attribute = green, quantity = 3
  • attribute = black, quantity = 3
  • total stock for all colors = 10
    If I try to buy 5 of the red scrapbooks, I get the message at the shopping cart that the item is out of stock, but I can then proceed to checkout and successfully purchase 5 red scrapbooks.

If I try to buy 11 of the red scrapbook (more than the total stock for all colors), I am again warned that the item is out of stock, and I can not proceed to checkout.

This problem has occurred prior to the latest patch that blocks display of out of stock attributes at the product page.

23 Feb 2009, 2:37 AM
#603
kellan4459 avatar

kellan4459

New Zenner

Join Date:
Dec 2008
Posts:
79
Plugin Contributions:
0

Re: Stocks by attributes

is there a way to have an attribute update multiple stocks

say I want
Attribute A qty 20
Attribute B qty 20
Attribute C is both A&B and I want it to deduct from both A&B's qty?

23 Feb 2009, 9:20 AM
#604
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

cropinstop:

In a previous post, I discussed in passing a problem relating to being able to purchase out of stock inventory when using Stock by Attributes. If the solution is discussed elsewhere, I apologize.

Specifically, if a product is set up for Stock by Attributes, it is possible to buy a subproduct that is out of stock after receiving a warning at the shopping cart that the selection is out of stock. But this behavior only happens if the quantity ordered is more than the quantity available for the subproduct, but less than the total stock available for all subproducts.This indicates that the mod hasn't been installed properly and the stock calc code that was supposed to have been replaced isn't being executed. This can happen because a key file hasn't been uploaded (some FTP programs only replace existing files if you explicitly tell them to) or because a backup file has been created (by hand or by FTP program) and is over-riding the new code.

23 Feb 2009, 9:23 AM
#605
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

kellan4459:

is there a way to have an attribute update multiple stocks

say I want
Attribute A qty 20
Attribute B qty 20
Attribute C is both A&B and I want it to deduct from both A&B's qty?No since the quantities aren't held against individual attributes but against product variants, i.e. a product and a specific collection of attributes.

24 Feb 2009, 12:06 AM
#606
kellan4459 avatar

kellan4459

New Zenner

Join Date:
Dec 2008
Posts:
79
Plugin Contributions:
0

Re: Stocks by attributes

kuroi:

No since the quantities aren't held against individual attributes but against product variants, i.e. a product and a specific collection of attributes.

Thanks Kuroi, I promised my customer I would ask but
this is what I figured and so I had already suggested using the Better Together mod or whatever the name is so if any attrib option for A&B are purchased they can have the discount that my customer was trying to accomplish with using the BothA&B attribute option

so they will have
prod1
->attrib a
->attrib a2

prod2
->attrib b
->attrib b2

and if they purchase any variant of prod1 or prod2 the appropriate prod count will be adjusted but if the customer purchases both prod1 and prod2 they will receive a discount.

24 Feb 2009, 9:10 AM
#607
cropinstop avatar

cropinstop

New Zenner

Join Date:
Oct 2006
Location:
Surprise Arizona
Posts:
73
Plugin Contributions:
0

Re: Stocks by attributes

kuroi:

This indicates that the mod hasn't been installed properly and the stock calc code that was supposed to have been replaced isn't being executed. This can happen because a key file hasn't been uploaded (some FTP programs only replace existing files if you explicitly tell them to) or because a backup file has been created (by hand or by FTP program) and is over-riding the new code.

Compared all of my code with the 4.7multiadd version using "Beyond Compare", and could not find any errors. Are you sure the code is comparing the item order quantity to the stock quantity for the attribute being ordered?:huh:

Can you point me to the line in the code that does the comparison? perhaps I have a variable naming problem due to another installed enhancement.

24 Feb 2009, 10:12 AM
#608
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

@cropinstop

  1. Did you compare the code actually on your server, or to that which you believe you uploaded.
  2. It's possible, though unlikely, that MULTADD operates differently. I haven't reviewed it in depth and can only speak to versions prior to that.
24 Feb 2009, 5:14 PM
#609
cropinstop avatar

cropinstop

New Zenner

Join Date:
Oct 2006
Location:
Surprise Arizona
Posts:
73
Plugin Contributions:
0

Re: Stocks by attributes

kuroi:

@cropinstop

  1. Did you compare the code actually on your server, or to that which you believe you uploaded.
  1. It's possible, though unlikely, that MULTADD operates differently. I haven't reviewed it in depth and can only speak to versions prior to that.
  • Compared to code on online web. Have 3 copies (online, offline web, offline pc), all do the same. But since they have the same code for this feature, that is no surprise.
  • I tested with both 4.7, and 4.7multiadd. Was running 4.7 until yesterday, updated to multiadd and no difference.
25 Feb 2009, 3:08 AM
#610
kellan4459 avatar

kellan4459

New Zenner

Join Date:
Dec 2008
Posts:
79
Plugin Contributions:
0

Re: Stocks by attributes

cropinstop

this mod may get you started on being able to only show the attributes in stock. I haven't looked at it but it looks like a dynamic display of dropdowns for attributes

http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=953

the description of the mod is
"Dynamic drop downs based on stock values for the Stock by Attribute mod. Includes sequenced drop downs based on available stock."

25 Feb 2009, 7:40 AM
#611
cropinstop avatar

cropinstop

New Zenner

Join Date:
Oct 2006
Location:
Surprise Arizona
Posts:
73
Plugin Contributions:
0

Re: Stocks by attributes

cropinstop:

  • Compared to code on online web. Have 3 copies (online, offline web, offline pc), all do the same. But since they have the same code for this feature, that is no surprise.
  • I tested with both 4.7, and 4.7multiadd. Was running 4.7 until yesterday, updated to multiadd and no difference.

Followup - a barebones VC1.3.8 test web with only Stock by Attributes added to the base does NOT allow purchasing of Out of Stock merchandise. Doing a compare of online site to test web to find the problem.

25 Feb 2009, 7:43 AM
#612
cropinstop avatar

cropinstop

New Zenner

Join Date:
Oct 2006
Location:
Surprise Arizona
Posts:
73
Plugin Contributions:
0

Re: Stocks by attributes

kellan4459:

cropinstop

this mod may get you started on being able to only show the attributes in stock. I haven't looked at it but it looks like a dynamic display of dropdowns for attributes

http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=953

the description of the mod is
"Dynamic drop downs based on stock values for the Stock by Attribute mod. Includes sequenced drop downs based on available stock."

Took a look at it. The Readme cites three problems, so I am hesitant to install a "Work in Progress" on my online site, and do not have the expertise to debug it.

Thanks anyway...:cool:

26 Feb 2009, 7:17 AM
#613
cropinstop avatar

cropinstop

New Zenner

Join Date:
Oct 2006
Location:
Surprise Arizona
Posts:
73
Plugin Contributions:
0

Re: Stocks by attributes

cropinstop:

Followup - a barebones VC1.3.8 test web with only Stock by Attributes added to the base does NOT allow purchasing of Out of Stock merchandise. Doing a compare of online site to test web to find the problem.

Found the problem (or more correctly the cause of the problem)

If "Quick and Easy Checkout"is installed when running Stock by Attributes, the shopping cart will proceed to successful checkout when the quantity of an attribute ordered exceeds the quantity provisioned with Stock by Attributes.

The exact interaction and correction is beyond my level of expertise...

28 Feb 2009, 2:22 AM
#614
kellan4459 avatar

kellan4459

New Zenner

Join Date:
Dec 2008
Posts:
79
Plugin Contributions:
0

Re: Stocks by attributes

cropinstop:

Took a look at it. The Readme cites three problems, so I am hesitant to install a "Work in Progress" on my online site, and do not have the expertise to debug it.

Thanks anyway...:cool:

I wasn't sure if it would help you or not but wanted to throw it out just in case.

28 Feb 2009, 2:23 AM
#615
kellan4459 avatar

kellan4459

New Zenner

Join Date:
Dec 2008
Posts:
79
Plugin Contributions:
0

Re: Stocks by attributes

cropinstop:

Found the problem (or more correctly the cause of the problem)

If "Quick and Easy Checkout"is installed when running Stock by Attributes, the shopping cart will proceed to successful checkout when the quantity of an attribute ordered exceeds the quantity provisioned with Stock by Attributes.

The exact interaction and correction is beyond my level of expertise...

Is there a solution posted. Something someone might be able to help you work through?

28 Feb 2009, 4:58 PM
#616
cropinstop avatar

cropinstop

New Zenner

Join Date:
Oct 2006
Location:
Surprise Arizona
Posts:
73
Plugin Contributions:
0

Re: Stocks by attributes

kellan4459:

Is there a solution posted.
No.. I am a systems designer, not a coder.

kellan4459:

Something someone might be able to help you work through?

Hope so. My knowledge of PHP is one notch above zero.

1 Mar 2009, 9:03 PM
#617
s58smith avatar

s58smith

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Stocks by attributes

kellan4459:

You can see the example at
http://www.tks-atl.com/index.php?main_page=product_info&cPath=8&products_id=68

Hopefully that clears it up a little and is what Cropinstop is also trying to accomplish

I'm trying accomplish the exact same dropdown as displayed in the example above. I believe I modified the sql successfully on attributes.php.

My question is what php was changed to get the quanity to display inside the dropdown next to selection?

Thanks

2 Mar 2009, 10:22 PM
#618
karimm avatar

karimm

New Zenner

Join Date:
Nov 2008
Posts:
53
Plugin Contributions:
0

Re: Stocks by attributes

Hello Kellan,

Were does this peace of code have to go, were do i put it ?

regards,

kellan4459:

I added the following to make the quantity show in select boxes if a quantity is specified for the individual attribute since some of my products will use the Item Quantity and not an individual item attribute quantity.

if($products_options->fields['quantity'])
{
$products_text_to_use = $products_options->fields['products_options_values_name'] . " (" . $products_options->fields['quantity'] . " Available)"; //yes Available is improperly hard coded
}
else
{
$products_text_to_use = $products_options->fields['products_options_values_name'];
}
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_text_to_use);

3 Mar 2009, 3:18 PM
#619
s58smith avatar

s58smith

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Stocks by attributes

karimm:

Were does this peace of code have to go, were do i put it ?

Thanks for the post karimm, I must have missed seeing that code in earlier post. It was the missing item text/code I was just asking about above.

It goes into attributes.php right around line 105, depends if already made the change for the sql statement in same file, also posted by kellan.

Thanks

3 Mar 2009, 4:44 PM
#620
karimm avatar

karimm

New Zenner

Join Date:
Nov 2008
Posts:
53
Plugin Contributions:
0

Re: Stocks by attributes

i have this code around line 105.

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


do i have to overwrite it or just put i in ?

please send me a peace of your code with the adjustment.

Thanks