Zen Cart Logo
Forums / All Other Contributions/Addons / Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Views: 658,718

Results 1,021 to 1,040 of 3,609
26 Jan 2011, 11:51 AM
#1021
harmeetsandhu avatar

harmeetsandhu

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Dear ChrisD24,

I am having the same problem and after making the change as yo mentioned i still have the problem can you please post the code here so i can see if i am doing everything correct:

// stock by attributes     
                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 = '';
                        }

                        $stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
                        if (zen_not_null($stock_check))
                        $flagStockCheck = NULL; 
                        {
                                $flagAnyOutOfStock = true;
                                $flagStockCheck = $stock_check;
                          $stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);           
                        }

                }

    // end stock by attributes    

this is wat i have and mine still shows out of stock error for item B if Item A is out of stock.

Thank you

26 Jan 2011, 2:06 PM
#1022
chrisd24 avatar

chrisd24

New Zenner

Join Date:
Jan 2011
Posts:
37
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

harmeetsandhu:

Dear ChrisD24,

I am having the same problem and after making the change as yo mentioned i still have the problem can you please post the code here so i can see if i am doing everything correct:

// stock by attributes
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 = '';
                    }

                    $stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
                    if (zen_not_null($stock_check))
                    $flagStockCheck = NULL; 
                    {
                            $flagAnyOutOfStock = true;
                            $flagStockCheck = $stock_check;
                      $stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);           
                    }

            }

// end stock by attributes    
> 
> this is wat i have and mine still shows out of stock error for item B if Item A is out of stock. 
> 
> Thank you

I have $flagStockCheck = NULL; above if (zen_not_null($stock_check))

```php
			$stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
			$flagStockCheck = NULL;
			if (zen_not_null($stock_check))
26 Jan 2011, 2:14 PM
#1023
harmeetsandhu avatar

harmeetsandhu

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

I changed mine to exactly as yours but i still get this again:

item A out of stock but Item B is in stock but get the out of stock message and the stock avilable is same as ITEM A.

pulling my hair out now. You got any idea.

Thanks

26 Jan 2011, 2:18 PM
#1024
harmeetsandhu avatar

harmeetsandhu

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Forgot to mention that ITEM B has no attribute attached to it though but if i add any other item so lets say item C with attributes.

It works as expected.

Not getting anywhere with this.

Regards

26 Jan 2011, 2:20 PM
#1025
chrisd24 avatar

chrisd24

New Zenner

Join Date:
Jan 2011
Posts:
37
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

harmeetsandhu:

Forgot to mention that ITEM B has no attribute attached to it though but if i add any other item so lets say item C with attributes.

It works as expected.

Not getting anywhere with this.

Regards

Exactly, I am still waiting on an answer for products without attributes. :frusty:

26 Jan 2011, 2:25 PM
#1026
harmeetsandhu avatar

harmeetsandhu

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

I read before that you tried uncommenting the

/*
  if (STOCK_CHECK == 'true') {
    $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
    if ($flagStockCheck == true) {
      $flagAnyOutOfStock = true;
    }
  }
*/

did that make any difference to you.

Regards

26 Jan 2011, 2:28 PM
#1027
chrisd24 avatar

chrisd24

New Zenner

Join Date:
Jan 2011
Posts:
37
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

harmeetsandhu:

I read before that you tried uncommenting the

/*
if (STOCK_CHECK == 'true') {
$flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
if ($flagStockCheck == true) {
$flagAnyOutOfStock = true;
}
}
*/

> 
> did that make any difference to you. 
> 
> Regards

Only if I want to have the attributes stock break. Hopefully someone out there can figure this bug out - glad I am not the only one!
26 Jan 2011, 2:31 PM
#1028
harmeetsandhu avatar

harmeetsandhu

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Removing the post as the change i mentioned doesnt work.

26 Jan 2011, 2:33 PM
#1029
harmeetsandhu avatar

harmeetsandhu

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Actually wrote to soon:

It doesnt work as the item i choose to test had an attribute. the one without attributes still have this problem :frusty:

will try and sort this out will let u know if i can find the bug.

26 Jan 2011, 2:39 PM
#1030
chrisd24 avatar

chrisd24

New Zenner

Join Date:
Jan 2011
Posts:
37
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

harmeetsandhu:

Actually wrote to soon:

It doesnt work as the item i choose to test had an attribute. the one without attributes still have this problem :frusty:

will try and sort this out will let u know if i can find the bug.

Nope - I don't think it changed anything. It doesn't show the out of stock/low stock warning nor mark the product with ***. But I think it did that before I tried that code.

26 Jan 2011, 2:40 PM
#1031
chrisd24 avatar

chrisd24

New Zenner

Join Date:
Jan 2011
Posts:
37
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

harmeetsandhu:

Actually wrote to soon:

It doesnt work as the item i choose to test had an attribute. the one without attributes still have this problem :frusty:

will try and sort this out will let u know if i can find the bug.

LOL Ok that would be great if you can find a way!

26 Jan 2011, 5:04 PM
#1032
harmeetsandhu avatar

harmeetsandhu

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

ChrisD24,

Read the whole code properly and then decided that the following part of the code is an overkill.

I simply removed this part below :

// stock by attributes
		if ( STOCK_CHECK == 'true' ) {

			// Added to allow individual stock of different attributes
			unset($attributes);
			if(is_array($products[$i]['attributes'])){
				$attributes = $products[$i]['attributes'];
				$stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
				$flagStockCheck = NULL; 
				if (zen_not_null($stock_check))
				{
					$flagAnyOutOfStock = true;
					$flagStockCheck = $stock_check;
					$stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);		
				}
			} else {
				$attributes = '';
				$flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
				if ($flagStockCheck == true) {
					$flagAnyOutOfStock = true;
					$stockAvailable = zen_get_products_stock($products[$i]['id']
				}			
			}
		}

and replaced it with this code:

if (STOCK_CHECK == 'true') {
    $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity'], $attributes);
    if ($flagStockCheck == true) {
      $flagAnyOutOfStock = true;      
      $stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);               
    }
  }

This works perfect for me. Try it out and let me know.

Regards

26 Jan 2011, 5:34 PM
#1033
balticccreations avatar

balticccreations

New Zenner

Join Date:
Jan 2011
Location:
Laguna Vista TX
Posts:
42
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

harmeetsandhu:

ChrisD24,

Read the whole code properly and then decided that the following part of the code is an overkill.

I simply removed this part below :

// stock by attributes
if ( STOCK_CHECK == 'true' ) {

		// Added to allow individual stock of different attributes
		unset($attributes);
		if(is_array($products[$i]['attributes'])){
			$attributes = $products[$i]['attributes'];
			$stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
			$flagStockCheck = NULL; 
			if (zen_not_null($stock_check))
			{
				$flagAnyOutOfStock = true;
				$flagStockCheck = $stock_check;
				$stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);		
			}
		} else {
			$attributes = '';
			$flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
			if ($flagStockCheck == true) {
				$flagAnyOutOfStock = true;
				$stockAvailable = zen_get_products_stock($products[$i]['id']
			}			
		}
	}
> 
> 
> and replaced it with this code: 
> 
> ```php
if (STOCK_CHECK == 'true') {
    $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity'], $attributes);
    if ($flagStockCheck == true) {
      $flagAnyOutOfStock = true;      
      $stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);               
    }
  }

This works perfect for me. Try it out and let me know.

Regards

mine looks like yours does now except I didn't have the last line. Added it in hopes that the stock quantities will show to the customers. Otherwise I'm still stumped.

Nope still not showing them available items for each attribute only how many in total..

26 Jan 2011, 5:45 PM
#1034
harmeetsandhu avatar

harmeetsandhu

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Dear Baltic,

I am not sure if i got ur last post. my cart now works as i wanted it to. It shows no of products avilable if a customer adds in more products then in stock.

Let me know what you refering to and will try to help you out.

Regards

26 Jan 2011, 5:55 PM
#1035
balticccreations avatar

balticccreations

New Zenner

Join Date:
Jan 2011
Location:
Laguna Vista TX
Posts:
42
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

balticccreations:

Mine doesn't even do that. It just won't let them check out. It will show how many they added to their cart but not how many are actually available. But on the product page it gives the total number of products available just not how many of each attribute.

harmeetsandhu:

Dear Baltic,

I am not sure if i got ur last post. my cart now works as i wanted it to. It shows no of products avilable if a customer adds in more products then in stock.

Let me know what you refering to and will try to help you out.

Regards

Above is what mine is doing. It will show how many total units are available but not how many of each is available. Here is a listing to show you what I mean.

http://balticcreations.net/index.php?main_page=product_info&products_id=26:fa7bf49e2363e997cb11f0435eb21058

it won't let them checkout but also won't give them an error message telling them there is insufficient stock. It doesn't tell them how many are in stock at all aside from the total amount...

26 Jan 2011, 9:04 PM
#1036
chrisd24 avatar

chrisd24

New Zenner

Join Date:
Jan 2011
Posts:
37
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

harmeetsandhu:

ChrisD24,

Read the whole code properly and then decided that the following part of the code is an overkill.

I simply removed this part below :

// stock by attributes
if ( STOCK_CHECK == 'true' ) {

		// Added to allow individual stock of different attributes
		unset($attributes);
		if(is_array($products[$i]['attributes'])){
			$attributes = $products[$i]['attributes'];
			$stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
			$flagStockCheck = NULL; 
			if (zen_not_null($stock_check))
			{
				$flagAnyOutOfStock = true;
				$flagStockCheck = $stock_check;
				$stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);		
			}
		} else {
			$attributes = '';
			$flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
			if ($flagStockCheck == true) {
				$flagAnyOutOfStock = true;
				$stockAvailable = zen_get_products_stock($products[$i]['id']
			}			
		}
	}
> 
> 
> and replaced it with this code: 
> 
> ```php
if (STOCK_CHECK == 'true') {
    $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity'], $attributes);
    if ($flagStockCheck == true) {
      $flagAnyOutOfStock = true;      
      $stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);               
    }
  }

This works perfect for me. Try it out and let me know.

Regards

Nope, this doesn't appear to be working for me - just on products without attributes.

27 Jan 2011, 10:18 AM
#1037
sushigal avatar

sushigal

Zen Follower

Join Date:
Mar 2009
Posts:
435
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Has anyone been able to fix this? I don't want to download this mod and then find I get this problem as too as we really need this mod to work properly because we also have different quantities for products that come in different sizes and colours.

Thanks

27 Jan 2011, 12:15 PM
#1038
harmeetsandhu avatar

harmeetsandhu

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

ChrisD24,

Mine works perfect now. if you paste ur code here i can have a look and see wats going on.

Regards

27 Jan 2011, 12:18 PM
#1039
harmeetsandhu avatar

harmeetsandhu

New Zenner

Join Date:
Dec 2008
Posts:
14
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

balticccreations,

if you can also paste the code here and i can have a look.

Will try to sort it out.

Regards

harmeet

27 Jan 2011, 2:22 PM
#1040
chrisd24 avatar

chrisd24

New Zenner

Join Date:
Jan 2011
Posts:
37
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

harmeetsandhu:

ChrisD24,

Mine works perfect now. if you paste ur code here i can have a look and see wats going on.

Regards

Here is my /shopping_cart/header_php.php file:

<?php
/**
 * shopping_cart header_php.php
 *
 * @package page
 * @copyright Copyright 2003-2010 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 15880 2010-04-11 16:24:30Z wilt $
 */

// 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'];
  // 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 = htmlspecialchars($products[$i]['attributes_values'][$option], ENT_COMPAT, CHARSET, TRUE);
      } 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'] = $attr_value;
      $attrArray[$option]['options_values_price'] = $attributes_values->fields['options_values_price'];
      $attrArray[$option]['price_prefix'] = $attributes_values->fields['price_prefix'];
    }
      $attrArray[$option]['products_options_name'] = $attributes_values->fields['products_options_name']; 
      $attrArray[$option]['options_values_id'] = $value; 
      $attrArray[$option]['products_options_values_name'] = $attr_value; 
      $attrArray[$option]['options_values_price'] = $attributes_values->fields['options_values_price']; 
      $attrArray[$option]['price_prefix'] = $attributes_values->fields['price_prefix']; 
    } 
    // stock by attributes 
if (STOCK_CHECK == 'true') { 
    $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity'], $attributes); 
    if ($flagStockCheck == true) { 
      $flagAnyOutOfStock = true;       
      $stockAvailable = zen_get_products_stock($products[$i]['id'], $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']);
  $tmp =  zen_add_tax($products[$i]['final_price'],zen_get_tax_rate($products[$i]['tax_class_id']));
//  $productsPriceEach = $currencies->rateAdjusted($tmp);
//  $productsPriceTotal = $productsPriceEach * $products[$i]['quantity'];
  $productsPriceTotal = $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) : '');
//  $productsPriceTotal = $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) : '');
//  echo  $currencies->rateAdjusted($tmp);
  $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'=>$productsPriceTotal,
                            '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');
?>