Forums / All Other Contributions/Addons / Stock For Product With Different Attributes (OLD)

Stock For Product With Different Attributes (OLD)

Locked

Started by dafonz on 30 Nov 2005, 8:52 PM · Views: 80,867

Results 241 to 260 of 273
This thread is locked. New replies are disabled.
25 Mar 2006, 5:34 AM
#241
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Stock For Product With Different Attributes (OLD)

Well... right in the first quote your wrote it says he's figured it out and will post when he can :)

26 Mar 2006, 5:20 PM
#242
solutionsfast avatar

solutionsfast

New Zenner

Join Date:
Mar 2006
Posts:
2
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

I have created the database table and uploaded all the files as per the instructions given with the zip file.

However, I am not sure what needs to be amended. The readme.txt it mentions an amendment will need to be made to orders.php but I cannot see what needs to be amended.

Please can anyone advise?

I have checked the database and a table has been created with the standard prefix zen_products_with_attributes_stock and all the fields are showing.

However I am also getting the 1146 Table 'fancynt1.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK' doesn't exist error when i go in to the admin program and try to use Products with attribute Stock.

27 Mar 2006, 8:16 PM
#243
diode avatar

diode

New Zenner

Join Date:
Feb 2006
Posts:
3
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

I have read through this entire thread and I am encountering some of the same problems people are having. I have installed this module and all is working well. One question remains though. We have recieved alot of orders from people who are continuing with the checkout process even though the message displays that we are out of stock on that particular attribute combination. For instance.

Sweatshirt:

Attribute Size: Small, Large, X-Large

Color: Red, Green, Blue

If our stock of Small Red sweatshirts is 0 and someone selects it, it displays the correct message that we are out of stock in the cart. However, the customer either doesn't see the message, or doesn't bother reading it and places the order anyway.

Is there an easy way to remove or disable the "Checkout" button when such message/error is shown to prevent them from continuing and processing the order?

This will circumvent the hassels and headaches we are currently having to deal with.

You can see the example here: http://www.shippingonly.com/index.php?main...products_id=746

try ordering in size 6. The message will appear, but you can continue your order if you don't read it.

The Configuration-->Stock-->Allow Checkout setting is already set to false

28 Mar 2006, 8:31 AM
#244
solutionsfast avatar

solutionsfast

New Zenner

Join Date:
Mar 2006
Posts:
2
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

Diode, i have to ask a quick question about the install process if you have got the module working well can you advise what needs to be done other than copying the files down to the relevant locations?

I added the database and copied the files down as per the instructions but still get errors although i know the table has been added correctly with the zen prefix.

28 Mar 2006, 3:06 PM
#245
diode avatar

diode

New Zenner

Join Date:
Feb 2006
Posts:
3
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

solutionsfast, that is pretty much all that was done. Copied the files into the relative locations, added the table. Then I added a product, gave it a few attributes.

In the admin section under categories-->Products With Attributes Stock section, the product appears. Then all you have to do is "Add Quantity For Product Variant" selection the correct attributes, add the quantity for that choice and its done.

Works fine except for my question.

28 Mar 2006, 4:50 PM
#246
diode avatar

diode

New Zenner

Join Date:
Feb 2006
Posts:
3
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

After a little tinkering around, I believe that I fixed the "problem" that I was having. I edited the cart code, so now if anything that shows out of stock, it removes the button and link to proceed with the cart.

For those that would like to know, or anyone with any better ideas, here is what i edited.

includes-->templates-->template_default-->templates-->tpl_shopping_cart_default.php

The original code on line 270 was

<td class="main" align="right"><? echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>'; ?></td>

I changed the code as follows

<?
  if ($any_out_of_stock == 0) {
?>
 <td class="main" align="right"><? echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>'; ?></td>
<?
   } else {
?>
 <td class="main" align="right"></td>
<?
   }
?> 

It seems to work so far. Anybody with a better suggestion?

28 Mar 2006, 5:49 PM
#247
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Stock For Product With Different Attributes (OLD)

All that should be taken care of with the core files... if you have the option to not allow checkout on out-of-stock items set, then that should be that. I'm not sure why yours wasn't working but I don't think it had anything to do with this mod.

  • Steven
28 Mar 2006, 5:50 PM
#248
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Stock For Product With Different Attributes (OLD)

[deleted... dang duplicate posts!]

30 Mar 2006, 4:59 PM
#249
yahaira avatar

yahaira

New Zenner

Join Date:
Feb 2006
Posts:
77
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

has anyone upgraded yet to 1.3?
I just installed a demo store to see what the diff's are, but haven't "upgraded" yet. I was just wondering if anyone had any problems with this mod.

30 Mar 2006, 6:36 PM
#250
cslhypnotech avatar

cslhypnotech

Zen Follower

Join Date:
Aug 2005
Posts:
133
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

Not sure if anyone has posted this or not, but if you provide downloads on your cart (1.2.x) remember to add stock for the downlolad in your stockbyattributes otherwise the download won't work. Customers will be charged and unable to download the product.

9 Apr 2006, 10:43 PM
#251
cg3001 avatar

cg3001

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

I know, I am looking for the updated version of this contribution that works with Zen Cart 1.3.0 release. I know for a fact it works with all older versions as I got it to work in those(1.2.5 = 1.2.6.d), but getting it to work in 1.3.0 is a much harder problem when you follow the readme install you should quickly discover a nasty error once you upload the functions_lookups.php file, to a 1.3.0 store.

If you skip that part and leave the older version in place, you will find when the products with assigned attributes do not update to notify the customer the product is not available.

I know it suppose to be released with Zen 1.4 but that could be ages**..Is there anyone, who got it to work with 1.3.0 standard install ???? **:(

I do not need all the bells and whistles, just this basic contribution to work in 1.3.0, as this version of Zen actually validates and is much friendlier to search engines then the older version of zen stores.

9 Apr 2006, 11:43 PM
#252
mikeyg avatar

mikeyg

Totally Zenned

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

Re: Stock For Product With Different Attributes (OLD)

Can anyone tell me if you delete an order should the stock get populated back into the right stock by attribute.

If not what would it take to get this to happen as it is not happening with me.

I have asked a similar thing within the super orders thread - if you edit and delete a line using the SO mods functionallity can it re-populate the stock back into the right place in the Stock by attribute table.

I am not a programmer but if a solution can be found this would be fantastic.

many thanks

MG

13 Apr 2006, 7:10 AM
#253
tigertail avatar

tigertail

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

cg3001 - I didn't have a problem with the functions_lookups file - I used winmerge to make sure the original 1.3 script was all included.

The problem comes with the **tpl_shopping_cart_default.php **in includes/templates/template_detault/templates/ This file seems to have been completely 'emptied' in 1.3. Adding the snippet of code from the stock_with_attributes file causes an error, so I've left it out for now...

I've got the mod 'working' up to a point (ie it doesn't crash) - the admin side works find, and the attributes show up next to the product. But it doesn't update the attributes stock, or check attribute stock quantities.

My feeling is that this isn't going to work without some serious digging around in the 1.3 code - it would be nice, as a starter, to know where all that shopping-cart code has gone!? You walk into that file and you get the feeling that someone has been at it with a large vacuum cleaner :huh:

Does anyone else have a handle on this, or have they got this mod to work on 1.3? Any help greatly appreciated.

JJ

13 Apr 2006, 4:53 PM
#254
cherylkemp avatar

cherylkemp

Zen Follower

Join Date:
Mar 2006
Posts:
179
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

I compared all the files and I think the tpl_shopping cart is the one that is most significantly different.

Unfortunately, I don't know enough to try to get it to work...I could really use it though!

Zen Cart: Diva Knitting

13 Apr 2006, 9:04 PM
#255
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: Stock For Product With Different Attributes (OLD)

I'll preface this by saying I have not yet installed 1.3, nor do I use the contrib you are trying to convert...

But, I know the 1.2x code pretty well and a trick I use a lot when code moves is to find a snipet of code that appears in tpl_shopping_cart_default.php that you know probably still exists but has just been moved in the new version and search the new fileset in your dev environment (I use PhpED) for that code snipet.

Doing that, in this case it looks like the shopping cart code has been moved into includes/modules/pages/shopping_cart/header_php.php

There is also code in includes/classes/order.php that also deals with product attributes (around line 427).

Not sure how much this helps but it may at least get you looking in the right place. ::tup

Jeff

18 Apr 2006, 4:56 AM
#256
camden avatar

camden

New Zenner

Join Date:
Mar 2006
Posts:
25
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

So it seems there is no way to have Stock show up for individual attributes in Zen 1.3?

18 Apr 2006, 4:58 AM
#257
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Stock For Product With Different Attributes (OLD)

camden:

So it seems there is no way to have Stock show up for individual attributes in Zen 1.3?
Not in 1.3.0, no.

1.3.x will see it at some point... ;)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Apr 2006, 5:09 AM
#258
cherylkemp avatar

cherylkemp

Zen Follower

Join Date:
Mar 2006
Posts:
179
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

DrByte:

Not in 1.3.0, no.

1.3.x will see it at some point... ;)
Can't wait for that! :D

Zen Cart: Diva Knitting

29 Apr 2006, 6:08 PM
#259
audradh avatar

audradh

Zen Follower

Join Date:
Oct 2005
Location:
Eastern US
Posts:
429
Plugin Contributions:
0

Re: Stock For Product With Different Attributes (OLD)

I am attempting to utilize s_mac's edits to pre-populate the quantity when adding stock, but I am having no luck w/ it. I see that Joostvdl made some corrections later, and I'm not sure that I am understanding those corrections properly.

Here is my code following each of s_mack's 2 edits:```
foreach($product_attributes as $option_name => $options)

{

echo '<p><strong>'.$option_name.': </strong>';

echo zen_draw_pull_down_menu('attributes[]',$options).'</p>'."\n";

}



echo '<p><strong>Quantity: </strong>'.zen_draw_input_field('quantity', $_GET['q']).'</p>'."\n"; /*s_mack:prefill_quantity*/

}

else

{

echo zen_draw_form('final_refund_exchange', FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK, 'action=add', 'post', '', true)."\n";
and```
 	echo '</td>'."\n";

   echo '<td style="border-bottom: 1px dashed #ccc">'."\n";

   echo '<a href="'.zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK, "action=edit&products_id=".$products->fields['products_id'].'&attributes='.$attribute_products->fields['stock_attributes'].'&q='.$attribute_products->fields['quantity'], 'NONSSL').'">Edit Quantity</a>'; /*s_mack:prefill_quantity*/

   echo '</td>'."\n";

   echo '<td style="border-bottom: 1px dashed #ccc">'."\n";

There is no change in functionality from the original mod. When I choose an attribute array that is already showing stock the quantity field is empty on the next page.

Anybody know what I have done wrong here?

(This was supposed to be the easier of the 2 edits :blink: )

Any help appreciated :)

Thanks,
Audra

29 Apr 2006, 6:15 PM
#260
mikemehiel avatar

mikemehiel

New Zenner

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

Re: Stock For Product With Different Attributes (OLD)

Ok so i think ive just been digging my hole deeper. My store wont load now and i get this error:

Warning: main(DIR_FS_CATALOG_LANGUAGESenglish/meta_tags.php): failed to open stream: No such file or directory in /home/.cassiopeia/mmehiel/titanclothingco.com/store/includes/languages/english.php on line 59

Warning: main(DIR_FS_CATALOG_LANGUAGESenglish/meta_tags.php): failed to open stream: No such file or directory in /home/.cassiopeia/mmehiel/titanclothingco.com/store/includes/languages/english.php on line 59

Fatal error: main(): Failed opening required 'DIR_FS_CATALOG_LANGUAGESenglish/meta_tags.php' (include_path='.:/usr/local/lib/php') in /home/.cassiopeia/mmehiel/titanclothingco.com/store/includes/languages/english.php on line 59

Can anyone help? This module is exactly what i need. Thanks in advance,and for all the help ive already gotten out of this thread.