Stock information

Discussion for coding development or feature requests
amedeo
Posts: 10
Joined: Sun Mar 27, 2011 8:03 am

Stock information

Post by amedeo » Sun Nov 13, 2011 12:25 pm

1. A situation with information about products cantity, value at price list, with and without tax, group by category etc., I think it is a usefull list.
2. I make a view in mySQL, but I don't know to use it with php. (is posible or only a stored procedure must be used?)
select `product`.`product_id` AS `Id`,`product_description`.`model_number` AS `Cod_Articol`,`product_description`.`name` AS `Nume_Articol`,`product`.`price` AS `Pret`,`product`.`quantity` AS `Stoc`,(`product`.`quantity` * `product`.`price`) AS `val_cu_TVA`,`product`.`viewed` AS `Nr_Vizualizari`,`category_description`.`name` AS `Den_Grupa` from (((`product` left join `product_description` on((`product`.`product_id` = `product_description`.`product_id`))) left join `product_to_category` on((`product`.`product_id` = `product_to_category`.`product_id`))) left join `category_description` on((`product_to_category`.`category_id` = `category_description`.`category_id`)))
3. A situation about invoices, based on the followinh view...
select `order`.`invoice_number` AS `Nr_doc`,`order`.`date_added` AS `Data_Doc`,`order`.`lastname` AS `Fact_Nume_Cli`,`order`.`firstname` AS `Fact_Pren_Client`,`order`.`email` AS `email`,`order`.`shipping_lastname` AS `Liv_Nume_Cli`,`order`.`shipping_firstname` AS `Liv_Pren_Client`,`order`.`shipping_address_1` AS `Liv_Strada`,`order`.`shipping_city` AS `Liv_Oras`,`order`.`shipping_postcode` AS `Cod_Postal`,`order`.`payment_method` AS `Metoda_Liv`,`order`.`total` AS `Val_Doc`,`order_product`.`name` AS `Den_Prod`,`order_product`.`model_number` AS `Cod_Prod`,`order_product`.`quantity` AS `quantity`,`order_product`.`price` AS `price`,`order_status`.`name` AS `Stare` from ((`order` left join `order_product` on((`order`.`order_id` = `order_product`.`order_id`))) left join `order_status` on((`order`.`order_status_id` = `order_status`.`order_status_id`)))
Can you help me? I use 1.2.5 version.

Thank you.

User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Stock information

Post by Brent » Sun Nov 13, 2011 3:54 pm

What do you want to do with these. Is it to create reports?
We are not sure what the goal is.

amedeo
Posts: 10
Joined: Sun Mar 27, 2011 8:03 am

Re: Stock information

Post by amedeo » Mon Nov 14, 2011 12:26 am

Yes, for a report in Admin/Reports section. I don't know to add a menu line, because I don't know php. I want to save reports from internet to my computer in xls format, to have information about all the product from store, etc. In the future maybe you add a postal module for label printing of the customer adress.

Oistacus
Posts: 133
Joined: Sat Oct 08, 2011 3:21 pm
Location: Matera ITALY

Re: Stock information

Post by Oistacus » Mon Nov 21, 2011 6:53 am

hi ,
why in the web i should see to customers my quantity into the store ?
I suggest this idea :
if the disponibility is over 10 or better customizable , i can see to customers a symbol green ( in stock )
else if the disponibility is under 10 ( or cust...) but over 3 the symbol yellow ( critical )
else if disponibility is zero the simbol red ( out of stock )
I can see to customers if the products is or not in stock , and i dont see my stock of store in quantity to them .
I remeber this function in Osc . Or number or symbol display
Can you think about this ?

Ois

User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Stock information

Post by Brent » Mon Nov 21, 2011 8:06 am

Yes, it could be added in the next version.

Oistacus
Posts: 133
Joined: Sat Oct 08, 2011 3:21 pm
Location: Matera ITALY

Re: Stock information

Post by Oistacus » Sat Nov 26, 2011 11:29 am

Hi Brent,
in this image I like to see to you what is my new job :
Disponibile.JPG
Disponibile.JPG (55.14 KiB) Viewed 14168 times

If I set hide the onhand (display off), I can see the image in the product page to indicate the status of disponibilty of product , without to see the number .( green -> good , yellow -> critical , red -> not available )
I edit in product.tpl this step :

Code: Select all

  <?php if($show_stock){?>
    <div class="ponhand"><?php echo $quantity_available; ?>
    <span id="<?php echo $this_controller . '_stock_level_' . $product['product_id'];?>"> <?php echo $stock_level; ?> </span></div>
      <?php } elseif ($stock_level >= 10) {?>
              <div class="ponhand"><?php echo $quantity_available .'&nbsp'; ?><img src="image/qta/stock_status_1.png" alt="Disponibile" title="Disponibile"></div>
      <?php } elseif ($stock_level <= 0) {?>
              <div class="ponhand"><?php echo $quantity_available .'&nbsp'; ?><img src="image/qta/stock_status_0.png" alt="NON Disponibile" title="NON Disponibile"></div>
      <?php } else {?>
              <div class="ponhand"><?php echo $quantity_available .'&nbsp'; ?><img src="image/qta/stock_status_2.png" alt="Scarsa" title="Scarsa"></div>
      <?php }?>


and upload three small png .

If the product is with option , what is the variable of the total disponibility ?
Because if I have a products with three option, disponibility e.g. 3,2,3 ( set in option products ), but the $stock_level is 0 .
Ois

Oistacus
Posts: 133
Joined: Sat Oct 08, 2011 3:21 pm
Location: Matera ITALY

Re: Stock information

Post by Oistacus » Sat Nov 26, 2011 12:19 pm

Hi,
right now I set in admin/setting show disponibilty. I test the product with option , to see how many product to show in product page . The product have 2 + 1 + 2 disponibility in option product. In the product page I see -10 ( negative value ). In admin/ catalog I see 0 ( zero ) in general tab and 2+1+2 in option tab . I dont know where i wrong .
Can you help me ?

User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: Stock information

Post by Brent » Sat Nov 26, 2011 12:22 pm

There is no variable a such. I you look at the page source code, you will see all the product/option combination quantities.
These are static hidden input tags.
Everything that happens when options are changed is javascript.

User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: Stock information

Post by leo » Sat Nov 26, 2011 3:18 pm

Try something like this. Not tested.

Code: Select all

    <?php if($show_stock){?>
        <div class="ponhand"><?php echo $quantity_available; ?>
        <span id="<?php echo $this_controller . '_stock_level_' . $product['product_id'];?>"> <?php echo $stock_level; ?> </span></div>
	  <?php if ($stock_level >= 10) {?>
                  <div class="ponhand"><?php echo $quantity_available .'&nbsp'; ?><img src="image/qta/stock_status_1.png" alt="Disponibile" title="Disponibile"></div>
          <?php } elseif ($stock_level <= 0) {?>
                  <div class="ponhand"><?php echo $quantity_available .'&nbsp'; ?><img src="image/qta/stock_status_0.png" alt="NON Disponibile" title="NON Disponibile"></div>
          <?php } else {?>
                  <div class="ponhand"><?php echo $quantity_available .'&nbsp'; ?><img src="image/qta/stock_status_2.png" alt="Scarsa" title="Scarsa"></div>
          <?php }?>
    <?php } ?>

Oistacus
Posts: 133
Joined: Sat Oct 08, 2011 3:21 pm
Location: Matera ITALY

Re: Stock information

Post by Oistacus » Sat Nov 26, 2011 3:58 pm

If the onhand is visible or not , the qty to show in product page is wrong if the product has an option . It shows always 0 !
The qty should be show for the option selected . If I select the first option , it must show the pieces of the first option . If shows the amount of pieces , how can I know the qty of these option ?

Post Reply