Results 1 to 10 of 3599

Threaded View

  1. #11
    Join Date
    Sep 2006
    Posts
    38
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.3 for Zen Cart 1.3.6

    Quote Originally Posted by kuroi View Post
    Hi Frank. Glad you solved the problem, and thanks for posting the answer. It's always helpful when people do that as Zen Cart now has such a large base that sooner or later somebody else will probably do something similar.

    The Zen Cart 1.3.6 version (mod version 4.3) is now available in the download section. Due to my other commitments it's less extensively tested than previous releases. The changes shouldn't have introduced any new problems, but if you find any please post them.

    I strongly recommend upgrading to this version as it incorporates some of the security changes added to Zen Cart 1.3.6.

    If you are using languages other than English or French, you will need to make some minor adjustments to the language files, otherwise upgrading is simply a matter of overwriting your existing mod files.
    First, a little bug that I found in your new release by using beyond compare with older ones.

    In functions_lookups.php on line 163:
    function zen_get_products_stock($products_id) {
    should've been:
    /* function zen_get_products_stock($products_id) {
    Next, I applied a fix by Grayson posted in archived threads to show qty of attributes on product info page. For those who still having trouble with this fix, I am including the attributes.php file here. You may drop it in includes/modules/your_template/ folder.

    I am also including another alternative version of this fix (I take no credit whatsoever on this), which shows attribute stock after price_fix and weight etc. display, which makes more sense to myself, becasue this way customer won't confuse stock level with quantity discounts/surcharges. This alternative file is called attributes_Alternative.php. You need to rename it to attributes.php to overwrite the existing one when using.

    Don't forget to add a define to the product_info.php in includes/languages/english/your_template folder, such as:
    [quote][define('TEXT_ATTRIBUTES_PIECES','pieces');/QUOTE]. I use 'in stock' instead of 'pieces', for it makes more sense.

    Now, I need help for myself!! I tried hard to set a "display only" option value such as " select from below" to NOT show stock level, which is a conditional undone of the above fix in attributes.php. I tried codes as follows, but no luck:

    /*
    * check if attribute is display only
    */
    global $db;
    $check_attributes = $db->Execute("select *
    from " . TABLE_PRODUCTS_ATTRIBUTES . "
    where products_id = '" . (int)$products_id . "'
    and options_id = '" . (int)$option . "'
    and options_values_id = '" . (int)$value . "'");

    if ($check_attributes->fields['attributes_display_only'] == '1') {
    $products_options_value_id = $products_options->fields['products_options_values_id'];
    $products_options_details = $products_options->fields['products_options_values_name'];
    $products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
    }
    This block of codes were applied after the "// prepare product options details" section and before "//radio buttons" section.

    Any help on this would be greatly appreciated!
    Attached Files Attached Files
    Last edited by frank_lyy; 20 Nov 2006 at 11:19 AM.

 

 

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