Page 6 of 356 FirstFirst ... 456781656106 ... LastLast
Results 51 to 60 of 3558
  1. #51
    Join Date
    Sep 2006
    Posts
    38
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by tajul_ashyqin View Post
    Hi Frank,

    Thanx for your posted fixes... and actually, instead of showing the stock values beside the respective attributes option, I just want to show the 'Out of Stock' remark to only for those attributes that has reach to 0 in quantity BUT no remarks to the one that still have stock. So that next time the online shoppers no need to 'choose' and 'add to cart' the attributes and then find that no stock available to order!!! Do you have any idea how to code that?! or anyone out there?!
    In my situation, I have very limited stock level on each attribue. So, I wanted customers to see the quantities on each attribute, so that they would not add more than what's available. I also turned "show stock when low" in admin under Configuration/Stock, so that if my customers did add more than available quantities, they would get an warning message and show available stock in shopping cart.

    In your situation, I assume that you have plenty merchandise in stock and you have a very tight stock level control in place. I would suggest another fix posted by Grayson before:

    1. Switch back to original attributes.php by kuroi
    2. If you want to force attribute selection, add a "display only" attribute as "default" selection
    3. In attribute.php find
    [FONT=Times New Roman]$products_options_details = $products_options->fields['products_options_values_name'];[/FONT]
    replace it with:
    if ($products_options->fields['quantity'] > 0) { $products_options_details = $products_options->fields['products_options_values_name']; } else { $products_options_details = $products_options->fields['products_options_values_name'] . ' [' . TEXT_ATTRIBUTES_NOT_IN_STOCK . ']'; }
    next replace
    [FONT=Times New Roman]$products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');[/FONT]
    with
    if ($products_options->fields['quantity'] > 0) { $products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : ''); } else { $products_options_details_noname = ' [' . TEXT_ATTRIBUTES_NOT_IN_STOCK . ']' . $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : ''); }
    A few lines below this, find
    [FONT=Times New Roman]
    [FONT=Times New Roman]$products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');[/FONT]
    [/FONT]

    Replace with:
    if ($products_options->fields['quantity'] > 0) { $products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : ''); } else { $products_options_details_noname = ' [' . TEXT_ATTRIBUTES_NOT_IN_STOCK . '] ' . $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');}
    Do NOT forget to add a define of [FONT=Verdana]TEXT_ATTRIBUTES_NOT_IN_STOCK[/FONT] in product_info.php in includes/languages/english/your_template folder!!

  2. #52
    Join Date
    Sep 2006
    Posts
    38
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    By the way, the fix suggested above works for single attribute product only and for radio, checkbox options.

    For default dropdown display, you need to modify:
    $products_options_array[] = array()
    statements in attributes.php and add a if{}else{} conditon, which is a little harder to achieve and I have not enough time to play with it.

  3. #53
    Join Date
    Apr 2006
    Location
    Labuan Island
    Posts
    361
    Plugin Contributions
    2

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by frank_lyy View Post

    ...In your situation, I assume that you have plenty merchandise in stock and you have a very tight stock level control in place. I would suggest another fix posted by Grayson before...
    Yup, you are correct as it reflects the real situation in my shops! I tried to insert the fixes posted but it didn't work as it shows the remarks to all the attributes defined even the stock has 0 quantity in it. I tried to change the logic though but when I define $products_options->fields['quantity'] = 0, no remarks shown instead! BTW, thanx for your help, much appreciated!
    Last edited by tajul_ashyqin; 22 Nov 2006 at 02:34 AM.
    [FONT=Comic Sans MS]"Whether you think you can, or you think you can't... YOU ARE RIGHT."[/FONT]
    [FONT=Comic Sans MS]GOOD LUCK !!![/FONT]

  4. #54
    Join Date
    Sep 2006
    Posts
    38
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by tajul_ashyqin View Post
    Yup, you are correct as it reflects the real situation in my shops! I tried to insert the fixes posted but it didn't work as it shows the remarks to all the attributes defined even the stock has 0 quantity in it. I tried to change the logic though but when I define $products_options->fields['quantity'] = 0, no remarks shown instead! BTW, thanx for your help, much appreciated!
    Sorry, my bad. I forgot to include the DB query change by Grayson. You need to change part of the DB query in attributes.php by kuori to ferry "quantity" from your DB first, then apply the fix I posted yesterday.

    Here is the query change:

    find this block of code:
    $sql = "select pov.products_options_values_id,
    pov.products_options_values_name,
    pa.*
    from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
    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'] . "' " .
    $order_by;
    change it to:
    if ($products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_TEXT && $products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_FILE && $products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_READONLY) {
    $sql = "select pov.products_options_values_id,
    pov.products_options_values_name,
    pwas.quantity,
    pa.*
    from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " pwas
    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 pwas.stock_attributes = pa.products_attributes_id
    and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
    $order_by;
    } else {
    $sql = "select pov.products_options_values_id,
    pov.products_options_values_name,
    pa.*
    from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
    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'] . "' " .
    $order_by;
    }
    This way, you got your quantities for each attribute then you can apply if {}else{}condition I suggested yesterday.

    Keep in mind, these fix will only work for products have one attribute, and product attribute display style is radio buttons or check boxes.

    In case of default dropdown display, you need to modify the $products_options_array[], such as:

    [FONT=Times New Roman]if ($products_options->fields['quantity']) > 0) {[FONT=Verdana]$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],[/FONT]
    [FONT=Times New Roman]'text' => $products_options->fields['products_options_values_name'] .' [' . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_NOT_In_Stock . ']');[/FONT]
    [FONT=Times New Roman]}[/FONT][/FONT]

  5. #55
    Join Date
    Apr 2006
    Location
    Labuan Island
    Posts
    361
    Plugin Contributions
    2

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by frank_lyy View Post
    ...Sorry, my bad. I forgot to include the DB query change by Grayson. You need to change part of the DB query in attributes.php by kuori to ferry "quantity" from your DB first, then apply the fix I posted yesterday...
    Why I didn't think of that! thank you very much Frank! that should fix it...
    [FONT=Comic Sans MS]"Whether you think you can, or you think you can't... YOU ARE RIGHT."[/FONT]
    [FONT=Comic Sans MS]GOOD LUCK !!![/FONT]

  6. #56
    Join Date
    Aug 2005
    Posts
    62
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Hi, I'm not sure if the error I'm experiencing has to do with Stock by Attribute or not. My client had this add-on installed for Zen Cart 1.2. We then installed 1.3.6 for her in a test directory. I do not see the error on her old cart, only on the new one.

    I noticed the following error happening in the Attributes Controller on her new site. When I try to copy the attributes from one product to another item or to a category, this message comes up:

    1136 Column count doesn't match value count at row 1
    in:
    [insert into products_attributes values (0, '237', '70', '480', '1.5000', '+', '0', '1', '0', '+', '0', '0', '1', '', '1', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '', '', '0.0000', '0', '0.0000', '0', '0')]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

    I thought that maybe installing the add-on would help, so I did, but it hasn't made any difference. There's no products_attributes_values table in my database...should there be?

    Does this seem like an error that is somehow related to Stock by Attribute?

    Thanks!
    Shoshanna

  7. #57
    Join Date
    Nov 2006
    Posts
    2
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Ok this is a simple question not really related to the functionality of the script so much as the location of the output on the products page --

    if you look at the product page at - http://marylandcycling.com/shopping/...&products_id=1

    The attributes selection box seems to be much lower and out of place as compared to the add item to cart screen. I am afraid users will not see the size selection... and I can't for the life of me find out where this attributes box is scripted into each zen cart product page.

    Can someone direct me to where or how I can modify the location of the output of the attributes slection "please choose" on the product page?

    Ideally I would like to get it above the "add to cart" box.

  8. #58
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by lemuria View Post
    Does this seem like an error that is somehow related to Stock by Attribute?
    Hi Shoshanna

    It's right that you have no products_attributes_values table. What this sql is doing is inserting values into the products_attributes table.

    I'm afraid that I can see no link between this problem and Stock by Attribute. I think that your assessment is most likely correct and that the problem occurs in a database inset in the attributes controller. Stock by Attributes steers well clear of there.

    I have a hypothesis however, about your problem. What version of MySQL are you running?
    Kuroi Web Design and Development | Twitter

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

  9. #59
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by nickmd View Post
    Ok this is a simple question not really related to the functionality of the script so much as the location of the output on the products page
    Actually this is even further off topic than that since this add-on does not actually output anything to the products page (though a lot of people wish it would ).

    Although I wouldn't want to see this thread wander off into a discussion about reworking the products page (a rather common request) here's a quick pointer in the right direction ... some of the formating is achieving through CSS, but to make the change you want to do would require some editing of the includes/templates/YOUR_TEMPLATE/templates/tpl_product_info.php file which determines the order in which content is served to the products page.
    Kuroi Web Design and Development | Twitter

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

  10. #60
    Join Date
    Nov 2006
    Posts
    2
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5

    Quote Originally Posted by kuroi View Post
    Actually this is even further off topic than that since this add-on does not actually output anything to the products page (though a lot of people wish it would ).
    Great thank you! After looking in the correct forum I found an answer -- (http://www.zen-cart.com/forum/showthread.php?t=51697) for some reason I thought this module created the attributes, but now I understand. Thanks!

 

 
Page 6 of 356 FirstFirst ... 456781656106 ... LastLast

Similar Threads

  1. Problems with addon: Dynamic Drop Downs for Stock By Attribute
    By Dunk in forum All Other Contributions/Addons
    Replies: 56
    Last Post: 30 Apr 2014, 07:55 PM
  2. MySQL Problem with Product with Attribute Stock addon
    By rtwingfield in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 Sep 2011, 03:35 PM
  3. Hide Zero Quantity Attributes with attribute-stock addon
    By leevil123 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Feb 2010, 05:06 PM
  4. Replies: 4
    Last Post: 22 Jan 2010, 10:43 PM
  5. Price Products in the grid by 'Stock by Attribute' addon?
    By Salixia in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 27 Oct 2009, 06:03 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR