Page 130 of 359 FirstFirst ... 3080120128129130131132140180230 ... LastLast
Results 1,291 to 1,300 of 3589
  1. #1291
    Join Date
    Feb 2006
    Location
    NM
    Posts
    750
    Plugin Contributions
    1

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

    I had this same issue, WiccanWitch, as have most here, with this mod when I upgraded from 1.3.8a to 1.3.9h because this mod is flawed.

    The fix was not perfect but simple and is explained in earlier posts. I don't know about the "seo urls" problem.

    Here is the fix for Stock By Attributes - replace includes/modules/pages/shopping_cart/header_php.php with the one below from an earlier version of stock by attributes, namely stock_by_attributes_4-7MULTIADD. :

    Code:
    <?php
    /**
     * shopping_cart header_php.php
     *
     * @package page
     * @copyright Copyright 2003-2007 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: header_php.php 0000 2007-12-02 00:00:00Z kuroi $
     */
    
    // This should be first line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_START_SHOPPING_CART');
    
    require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    $breadcrumb->add(NAVBAR_TITLE);
    
    // Validate Cart for checkout
    $_SESSION['valid_to_checkout'] = true;
    $_SESSION['cart_errors'] = '';
    $_SESSION['cart']->get_products(true);
    
    if (!$_SESSION['valid_to_checkout']) {
      $messageStack->add('shopping_cart', ERROR_CART_UPDATE . $_SESSION['cart_errors'] , 'caution');
    }
    
    // build shipping with Tare included
    $shipping_weight = $_SESSION['cart']->show_weight();
    /*
      $shipping_weight = 0;
      require(DIR_WS_CLASSES . 'order.php');
      $order = new order;
      require_once('includes/classes/http_client.php'); // shipping in basket
      $total_weight = $_SESSION['cart']->show_weight();
      $total_count = $_SESSION['cart']->count_contents();
      require(DIR_WS_CLASSES . 'shipping.php');
      $shipping_modules = new shipping;
      $quotes = $shipping_modules->quote();
    */
    $totalsDisplay = '';
    switch (true) {
      case (SHOW_TOTALS_IN_CART == '1'):
      $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_WEIGHT . $shipping_weight . TEXT_PRODUCT_WEIGHT_UNIT . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
      case (SHOW_TOTALS_IN_CART == '2'):
      $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($shipping_weight > 0 ? TEXT_TOTAL_WEIGHT . $shipping_weight . TEXT_PRODUCT_WEIGHT_UNIT : '') . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
      case (SHOW_TOTALS_IN_CART == '3'):
      $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
    }
    
    // testing/debugging
    //  require(DIR_WS_MODULES . 'debug_blocks/shopping_cart_contents.php');
    
    $flagHasCartContents = ($_SESSION['cart']->count_contents() > 0);
    $cartShowTotal = $currencies->format($_SESSION['cart']->show_total());
    
    $flagAnyOutOfStock = false;
    $products = $_SESSION['cart']->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
      if (($i/2) == floor($i/2)) {
        $rowClass="rowEven";
      } else {
        $rowClass="rowOdd";
      }
      switch (true) {
        case (SHOW_SHOPPING_CART_DELETE == 1):
        $buttonDelete = true;
        $checkBoxDelete = false;
        break;
        case (SHOW_SHOPPING_CART_DELETE == 2):
        $buttonDelete = false;
        $checkBoxDelete = true;
        break;
        default:
        $buttonDelete = true;
        $checkBoxDelete = true;
        break;
        $cur_row++;
      } // end switch
      $attributeHiddenField = "";
      $attrArray = false;
      $productsName = $products[$i]['name'];
    
      if (STOCK_CHECK == 'true') {
        $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
        if ($flagStockCheck == true) {
          $flagAnyOutOfStock = true;
        }
    	  $stockAvailable = zen_get_products_stock($products[$i]['id']);
      }
    
      // Push all attributes information in an array
      if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
        if (PRODUCTS_OPTIONS_SORT_ORDER=='0') {
          $options_order_by= ' ORDER BY LPAD(popt.products_options_sort_order,11,"0")';
        } else {
          $options_order_by= ' ORDER BY popt.products_options_name';
        }
        foreach ($products[$i]['attributes'] as $option => $value) {
          $attributes = "SELECT popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
                         FROM " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                         WHERE pa.products_id = :productsID
                         AND pa.options_id = :optionsID
                         AND pa.options_id = popt.products_options_id
                         AND pa.options_values_id = :optionsValuesID
                         AND pa.options_values_id = poval.products_options_values_id
                         AND popt.language_id = :languageID
                         AND poval.language_id = :languageID " . $options_order_by;
    
          $attributes = $db->bindVars($attributes, ':productsID', $products[$i]['id'], 'integer');
          $attributes = $db->bindVars($attributes, ':optionsID', $option, 'integer');
          $attributes = $db->bindVars($attributes, ':optionsValuesID', $value, 'integer');
          $attributes = $db->bindVars($attributes, ':languageID', $_SESSION['languages_id'], 'integer');
          $attributes_values = $db->Execute($attributes);
          //clr 030714 determine if attribute is a text attribute and assign to $attr_value temporarily
          if ($value == PRODUCTS_OPTIONS_VALUES_TEXT_ID) {
            $attributeHiddenField .= zen_draw_hidden_field('id[' . $products[$i]['id'] . '][' . TEXT_PREFIX . $option . ']',  $products[$i]['attributes_values'][$option]);
            $attr_value = $products[$i]['attributes_values'][$option];
          } else {
            $attributeHiddenField .= zen_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
            $attr_value = $attributes_values->fields['products_options_values_name'];
          }
    
          $attrArray[$option]['products_options_name'] = $attributes_values->fields['products_options_name'];
          $attrArray[$option]['options_values_id'] = $value;
          $attrArray[$option]['products_options_values_name'] = zen_output_string_protected($attr_value) ;
          $attrArray[$option]['options_values_price'] = $attributes_values->fields['options_values_price'];
          $attrArray[$option]['price_prefix'] = $attributes_values->fields['price_prefix'];
        }
    
    		if ( STOCK_CHECK == 'true' ) {
    
    			// Added to allow individual stock of different attributes
    			unset($attributes);
    			if(is_array($products[$i]['attributes'])){
    				$attributes = $products[$i]['attributes'];
    			} else {
    				$attributes = '';
    			}
    
    			// End change
    
    			$stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
    	
    			if (zen_not_null($stock_check))
    			{
    				$flagAnyOutOfStock = true;
    				$flagStockCheck = $stock_check;
    			  $stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);		
    			}
    		}
      } //end foreach [attributes]
      $linkProductsImage = zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']);
      $linkProductsName = zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']);
      $productsImage = (IMAGE_SHOPPING_CART_STATUS == 1 ? zen_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) : '');
      $show_products_quantity_max = zen_get_products_quantity_order_max($products[$i]['id']);
      $showFixedQuantity = (($show_products_quantity_max == 1 or zen_get_products_qty_box_status($products[$i]['id']) == 0) ? true : false);
    //  $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('products_id[]', $products[$i]['id']) . zen_draw_hidden_field('cart_quantity[]', 1);
    //  $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('cart_quantity[]', 1);
      $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('cart_quantity[]', $products[$i]['quantity']);
      $showMinUnits = zen_get_products_quantity_min_units_display($products[$i]['id']);
      $quantityField = zen_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"');
      $buttonUpdate = ((SHOW_SHOPPING_CART_UPDATE == 1 or SHOW_SHOPPING_CART_UPDATE == 3) ? zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT) : '') . zen_draw_hidden_field('products_id[]', $products[$i]['id']);
      $productsPrice = $currencies->display_price($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
      $productsPriceEach = $currencies->display_price($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
      $productArray[$i] = array('attributeHiddenField'=>$attributeHiddenField,
                                'flagStockCheck'=>$flagStockCheck,
                                'flagShowFixedQuantity'=>$showFixedQuantity,
                                'linkProductsImage'=>$linkProductsImage,
                                'linkProductsName'=>$linkProductsName,
                                'stockAvailable'=>$stockAvailable,
                                'productsImage'=>$productsImage,
                                'productsName'=>$productsName,
                                'showFixedQuantity'=>$showFixedQuantity,
                                'showFixedQuantityAmount'=>$showFixedQuantityAmount,
                                'showMinUnits'=>$showMinUnits,
                                'quantityField'=>$quantityField,
                                'buttonUpdate'=>$buttonUpdate,
                                'productsPrice'=>$productsPrice,
                                'productsPriceEach'=>$productsPriceEach,
                                'rowClass'=>$rowClass,
                                'buttonDelete'=>$buttonDelete,
                                'checkBoxDelete'=>$checkBoxDelete,
                                'id'=>$products[$i]['id'],
                                'attributes'=>$attrArray);
    } // end FOR loop
    
    
    // This should be last line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_END_SHOPPING_CART');
    ?>
    Quote Originally Posted by WiccanWitch420 View Post
    Also, I just noticed that on the regular stock items that dont have attributes that it will let you add more than available to your cart and will not let you check out but it will not give you the normal message of
    I found another problem. With regular products when you put them in the cart, you can put more in the cart than it tells you are available, It will not let you check out, but it will not give you the message of

    Products marked with *** are out of stock or there are not enough in stock to fill your order.
    Please change the quantity of products marked with (***). Thank you

    These are for the products that dont have the attributes. =( '

    So the customer could potentially put 2 items in their cart, when there are only 1 left and instead of the cart telling them that they Products marked with *** are out of stock or there are not enough in stock to fill your order.
    Please change the quantity of products marked with (***). Thank you


    It will not say anything.

  2. #1292
    Join Date
    Nov 2008
    Posts
    196
    Plugin Contributions
    0

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

    Athena I could kiss you! That worked! Thank you Thank you Thank you!


    We just have the one remaining problem with the ultimate seo urls where if we have them turned on and we put a product with attributes stock in the cart, When we click on the item when it is in the cart, instead of being directed to the actual product page when you click on the link it gets directed to this page http://www.mysticcrypt.com/product_info

    And it says this on the page.

    Not Found
    The requested document was not found on this server.

    Web Server at mysticcrypt.com

    This is only happening when you put an item in your shopping cart that has a products with attributes stock, if you put an item in your shopping cart that does not have attributes, then it will let you click on the item in your cart and you will be directed to the correct page of the product.

  3. #1293
    Join Date
    Sep 2011
    Posts
    2
    Plugin Contributions
    0

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

    I'm using ZC v1.3.9 and the latest 1.4.13 version of Stock by Attribute. I have gone thru almost every post in this and other threads and can't find a solution so hoping someone can please help.

    The only, but significant, problem is that products with variant attributes always appear as out of stock in the shopping cart (available: 0 and the error message to reduce quantity) regardless of the stock quantity I have added to the variant in the Products with Attributes Stock page that comes with the add-on. I created a test product with only one variable attribute and set-up the stock quantities and all was fine until I added some other non-selectable text attributes (country of origin, materials used etc) which I use for all the other products, and then the error occured as before. I deleted the text attributes and that didn't fix the problem but when I deleted and reinstalled the first stock based attribute and reset the stock it worked again. I can't do this for all the products but just thought it was weird that other text attributes for the product had that impact.

    I have installed, backed out and reinstalled, and rechecked that files are in the correct locations, deleted backups and replaced the header_php.php file as suggested by Athena in older posts. Thanks for the tip! But still have the same problem.

    Products without attributes behave correctly now - I previously had a similar problem to many others, in that I was able to put more in the cart than I had in stock. But that is now resolved since replacing the header_php.php file in includes/modules/pages/shopping_cart.

    I have no other add-ons and this is a clean install with no upgrades.

    Any help would be really appreciated.
    Last edited by CazzaB; 12 Sep 2011 at 11:56 PM.

  4. #1294
    Join Date
    Feb 2006
    Location
    NM
    Posts
    750
    Plugin Contributions
    1

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

    My ignorance will show here as I"ve been trying to duplicate your problem in my test store.

    I wonder if you can give me a bullet list of a procedure for what you did to insert a
    Code:
    "non-selectable text attributes (country of origin, materials used etc) which I use for all the other products"
    If I understand, you added an OPTION NAME: text

    What is the option value?

  5. #1295
    Join Date
    Sep 2011
    Posts
    2
    Plugin Contributions
    0

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

    Hi Athena

    Thanks for offering to help with this.

    For each product I usually have 4 attributes - one is colour using radio buttons which is what we are basing the stock quantity on. The others are just set-up in the same way via the Option Name Manager/Option Value Manager with an Option Type of Read-only, for example:

    Name - Size Details / Value - 30 cm

    Name - Materials Used / Value - Cotton & Thread

    Name - Country of Origin / Value - Morocco (with an image)

    I usually set-up the values in advance and just select the ones I need from the Option Name/Values list as I create each product. They are just to provide info for the customer so they just need to be displayed as text.

    For the test product I just used the Colour attribute and just added the required info to the description instead and that seems to be ok.

    Test product is here - http://www.craftsoftheworldonline.co...roducts_id=105

    Stock amounts are:
    Fuchsia x 3
    Orange x 2
    Azure 1

    Example of product that uses attributes as described above but isn't working - http://www.craftsoftheworldonline.co...910f80771f16a0

    Stock is 2 per colour but when added to cart shows as Stock Available: 0.

    Any ideas? Thanks in advance!

  6. #1296
    Join Date
    Feb 2006
    Location
    NM
    Posts
    750
    Plugin Contributions
    1

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

    Hi CassaB
    Happy to help.
    I've duplicated your process - it works in my test cart - and have played around with the cart on your site and it seems to be just fine. I agree, keeping the option type read-only is more attractive and appropriate for those attributes.

    The second link you provided that you said keeps defaulting to "0" with the radio buttons preselected is showing stock quantities adjusting as I change them in the shopping cart. Did you solve the issue or am I missing something. Let me know.

  7. #1297
    Join Date
    Aug 2011
    Posts
    1
    Plugin Contributions
    0

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

    Can somebody please help me with stock by attributes add on? I am usin zc 1.3.9 and I have downloaded and installed the stock by attributes add on as per the instructions to the root directory of my website.
    I renamed the files to match my template where necessary
    (includes/templates/YOUR_TEMPLATE.) There were no such files to rename in the modules folder despite what the instructions stated, am I missing something here?

    I also installed the SQL patches and they seem to have installed correctly but when I go to my ZC admin there is no stock by attributes option in the CATALOGUE> dropdown menu.

    I cant figure out what i am doing wrong and the more I try to figure it out the more confused I get.
    Can anybody help?

    Thanks in advance

  8. #1298
    Join Date
    Feb 2006
    Location
    NM
    Posts
    750
    Plugin Contributions
    1

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

    ----------

    Did you upload the admin folder?

    ----------

    ALSO there should be the following files in includes/modules - if not check over the original downloaded mod files for them:

    pages/checkout_shipping/header_php.php

    pages/checkout_shopping_cart/header_php.php

    ----------
    This mod is flawed and we here have been struggling with it.

    An imperfect but working fix is to substitute as instructed in post #1293

  9. #1299
    Join Date
    Apr 2007
    Location
    Manchester, NH
    Posts
    52
    Plugin Contributions
    0

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

    I hope this helps the people on this thread.

    The store I'm debugging has both items priced by stock attributes and items not priced by stock attributes.

    For items not priced by attributes, if the customer asked for a quantity greater than that in stock, but the "out of stock" message did not display.

    In priced by attributes version 1.4.13, in
    includes/modules/pages/shopping_cart/header_php.php,
    the code to check for "out of stock" on items not priced by attributes is commented out.

    Uncomment these lines at about line 146:
    if (STOCK_CHECK == 'true') {
    $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
    if ($flagStockCheck == true) {
    $flagAnyOutOfStock = true;
    }
    }

  10. #1300
    Join Date
    Feb 2006
    Location
    NM
    Posts
    750
    Plugin Contributions
    1

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

    Can it really be that simple?....I'll run some test on that...thank you so much.

 

 

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