Jump to content

How to output correct quantity


sanl

Recommended Posts

Hello, I have product: weights 20 kg. But I have this product 10 qnt - red color and 10 black color. So I made combination: Weight red color - 10 qnt , weight black color - 10 qnt.

 

If I would like to export a bit information about my products how should I do with quantities?

 

Variable: $product[ 'quantity' ] works perfect if product dont have such combinations. 

 

But how to get correct quantity? Now I see quantity: 0 to this product, but I have 20 qnt !

 

I tryed      $combinations[ $row[ 'id_product_attribute' ] ][ 'quantity' ] = intval( $row[ 'quantity' ] );

 

Any could help me? 

 

 

How to check:

 

IF product has combinations { 

$quantity-combiation 

} else {

$product['quantity']

But I think I need make array of combiations with quantities? Mh..

 
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...