Page 1 of 2 12 LastLast
Results 1 to 10 of 1125

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Location
    Surprise Arizona
    Posts
    76
    Plugin Contributions
    0

    Default Re: Stocks by attributes


    Are you absolutely sure it exists? (Check for prefixes)



    >Should "Join products_with_attributes_stock PWAS" be "join pa.products_with_attributes_stock PWAS" ??

    No - this isn't valid SQL.

    Are you using table prefixes - in which case cactus2_zc2.products_with_attributes_stock may really be something like cactus2_zc2.zen_products_with_attributes_stock.
    yes, am using a table prefix zen. Need to get the glasses fixed
    In fact, to test this theory, I have amended the SQL to use the table define - try this query instead

    select pov.products_options_values_id,
    pov.products_options_values_name,
    pa.*
    from " . TABLE_PRODUCTS_ATTRIBUTES . " pa join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
    on pa.options_values_id = pov.products_options_values_id
    join " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " PWAS
    on PWAS.stock_attributes = pa.products_attributes_id
    where pa.products_id = '" . (int)$_GET['products_id'] . "'
    and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
    and pa.options_values_id = pov.products_options_values_id
    and pov.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and PWAS.quantity > 0 " .
    $order_by;

    Post back with your results.

    Kev
    Tried the revised SQL, and now the out-of stock items are masked from the selection menu, BUT, all selection menus for items that are not "stock by attributes" have the selection list truncated such that no selections are visible. Go to http://offlinestore.azbizp.com/index...products_id=83 for an example.

  2. #2
    Join Date
    Jan 2009
    Posts
    59
    Plugin Contributions
    1

    Default Re: Stocks by attributes

    Hi cropinstop,

    I see what you mean. I only use one attribute so that SQL works great for me. I will try and replicate your issue but I tihnk I may struggle. You could try a left join on PWAS - see sql below - BUT I HAVEN'T TRIED IT!!!

    select pov.products_options_values_id,
    pov.products_options_values_name,
    pa.*
    from " . TABLE_PRODUCTS_ATTRIBUTES . " pa join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
    on pa.options_values_id = pov.products_options_values_id
    LEFT join " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " PWAS
    on PWAS.stock_attributes = pa.products_attributes_id
    where pa.products_id = '" . (int)$_GET['products_id'] . "'
    and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
    and pa.options_values_id = pov.products_options_values_id
    and pov.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and PWAS.quantity > 0 " .
    $order_by;

  3. #3
    Join Date
    Dec 2008
    Posts
    79
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Quote Originally Posted by cropinstop View Post
    yes, am using a table prefix zen. Need to get the glasses fixed


    Tried the revised SQL, and now the out-of stock items are masked from the selection menu, BUT, all selection menus for items that are not "stock by attributes" have the selection list truncated such that no selections are visible. Go to http://offlinestore.azbizp.com/index...products_id=83 for an example.
    cropinstop and kev

    I use the left join with mine and it works across all items with attributes whether they have their own stock value or not.

    example of mine is at

    http://www.zen-cart.com/forum/showpo...&postcount=559

  4. #4
    Join Date
    Oct 2006
    Location
    Surprise Arizona
    Posts
    76
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Change by krazykev did not fix the problem, change by kellan4459 (post 559) seems to be working. Will do more testing offline to see if there are problems.

    Thanks

  5. #5
    Join Date
    Jan 2009
    Posts
    59
    Plugin Contributions
    1

    Default Re: Stocks by attributes

    Cropinstop,

    I guess you have the problem fixed but I would like to understand this better. I am quite new to Zen Cart, so wondered if you could elaborate on your statement

    >BUT, all selection menus for items that are not "stock by attributes"

    What kind of attributes are you using that do not use "stock by attributes" such that they don't get displayed?

    Kev

  6. #6
    Join Date
    Dec 2008
    Posts
    79
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Quote Originally Posted by krazykev View Post
    Cropinstop,

    I guess you have the problem fixed but I would like to understand this better. I am quite new to Zen Cart, so wondered if you could elaborate on your statement

    >BUT, all selection menus for items that are not "stock by attributes"

    What kind of attributes are you using that do not use "stock by attributes" such that they don't get displayed?

    Kev
    Kev
    If I understand him correctly he is using his cart similar to the one I'm doing. In mine their are items that I will allow a qty of 20 no matter which attribute they select so I don't want to limit the cart to
    qty 10 for attribute 1
    qty 10 for attribute 2
    I would prefer a qty 20 for the item as a whole so I could have
    5 attribute 1
    15 attribute 2
    or vice versa

    on the other hand I have other items where only so many per time slot so I want each attribute to have a limited qty. hope this makes sense.

  7. #7
    Join Date
    Jan 2009
    Posts
    59
    Plugin Contributions
    1

    Default Re: Stocks by attributes

    Hi Kellan,

    you lost me a little. I understand what you are trying to achieve, but no idea how you would! So long as everything works I don't suppose it matters!

  8. #8
    Join Date
    Dec 2008
    Posts
    79
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    for example
    we offer a cinderella visit offsite or onsite. The item has a qty of 1000 because it is unlimited. I don't care how many onsite or offsite visits so I want to use the product qty and not specify an individual attribute qty.

    You can see the example at
    http://www.tks-atl.com/index.php?mai...products_id=18



    Then we offer things like Easter Bunny Pictures where each time slot has a maximum number available. Each time slot is a separate attribute with a qty set for the attribute rather than just the product. When a qty is set for the individual attribute I added code to show the available qty for the individual attribute.

    You can see the example at
    http://www.tks-atl.com/index.php?mai...products_id=68

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

  9. #9
    Join Date
    Oct 2006
    Location
    Surprise Arizona
    Posts
    76
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Found a combination of attributes that still have a problem (and probably can't be fixed).

    Have a product with two sets of attributes - color and size.
    setup stock by attributes as follows:

    green, small : qty = 10
    green, large : qty=10
    red, small : qty =10
    red, large : qty = 0

    When I order red, large, the item is added to the shopping cart with the note it is out of stock, but the sale can be completed as if stock was available.

    "configuration:stock:allow checkout" is set to false.

    The problem with being able to order out of stock merchandise existed before this fix, and may be a problem unrelated to Stock by Attributes. Ideally, the red/large combination should not be selectable at all.

  10. #10
    Join Date
    Feb 2006
    Location
    Orbost Vic Australia
    Posts
    25
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    http://eastgippslandsports.com.au/in...ckout_shipping

    I get a blank page. Error tracking gives this error.

    [19-Feb-2009 11:10:26] PHP Fatal error: Cannot redeclare class order in /home/eastgipp/public_html/includes/classes/order.php on line 20

    I have checked the uploaded files and I can't see what the problem is. Can we get some help please
    PrivateTrader.Biz My Webpage

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Stocks of certain products disappearing automatically
    By Lowwi in forum General Questions
    Replies: 4
    Last Post: 11 Aug 2015, 09:09 PM
  2. Installing Stocks by Attribute
    By dragon03kf in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 26 Oct 2008, 07:42 PM
  3. Stocks by attributes
    By hcd888 in forum General Questions
    Replies: 1
    Last Post: 12 May 2008, 08:52 AM
  4. Multiple stocks per product
    By jaycode in forum General Questions
    Replies: 4
    Last Post: 5 Aug 2007, 11:55 AM
  5. Products with attribute stocks
    By Svanis in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 5 Jul 2006, 03:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg