Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Add Product Amount In Order.details (Backend) Rate Topic   - - - - -

 
  • roussetos
  • Newbie
  • Members
  • Join Date: 27-Feb 14
  • 7 posts

Posted 01 April 2020 - 08:29 PM #1

Hi,

How do I get it to show me the order details and the actual stock of products?

 

now

               {foreach from=$order_info.products item="oi" key="key"}
                {hook name="orders:items_list_row"}
                {if !$oi.extra.parent}
                <tr>
                    <td data-th="{__("product")}">
                        <div class="order-product-image">
                            {include file="common/image.tpl" image=$oi.main_pair.icon|default:$oi.main_pair.detailed image_id=$oi.main_pair.image_id image_width=$settings.Thumbnails.product_admin_mini_icon_width image_height=$settings.Thumbnails.product_admin_mini_icon_height href="products.update?product_id=`$oi.product_id`"|fn_url}
                        </div>
                        <div class="order-product-info">
                            {if !$oi.deleted_product}<a href="{"products.update?product_id=`$oi.product_id`"|fn_url}">{/if}{$oi.product nofilter}{if !$oi.deleted_product}</a>{/if}
                            <div class="products-hint">
                            {hook name="orders:product_info"}
                                {if $oi.product_code}<p class="products-hint__code">{__("sku")}:{$oi.product_code}</p>{/if}							
                            {/hook}						
                            </div>
                            {if $oi.product_options}<div class="options-info">{include file="common/options_info.tpl" product_options=$oi.product_options}</div>{/if}
                        </div>
                    </td>
                    <td class="nowrap" data-th="{__("price")}">
                        {if $oi.extra.exclude_from_calculate}{__("free")}{else}{include file="common/price.tpl" value=$oi.original_price}{/if}</td>
                    <td class="center" data-th="{__("quantity")}">
                        {$oi.amount}<br />
                        {if !"ULTIMATE:FREE"|fn_allowed_for && $oi.shipped_amount > 0}
                            <span class="muted"><small>({$oi.shipped_amount}&nbsp;{__("shipped")})</small></span>
                        {/if}
                    </td>
                    {if $order_info.use_discount}
                    <td class="nowrap" data-th="{__("discount")}">
                        {if $oi.extra.discount|floatval}{include file="common/price.tpl" value=$oi.extra.discount}{else}-{/if}</td>
                    {/if}
                    {if $order_info.taxes && $settings.General.tax_calculation != "subtotal"}
                    <td class="nowrap" data-th="{__("tax")}">
                        {if $oi.tax_value|floatval}{include file="common/price.tpl" value=$oi.tax_value}{else}-{/if}</td>
                    {/if}
                    <td class="right" data-th="{__("subtotal")}"><span>{if $oi.extra.exclude_from_calculate}{__("free")}{else}{include file="common/price.tpl" value=$oi.display_subtotal}{/if}</span></td>
                </tr>
                {/if}
                {/hook}
                {/foreach}

after

               {foreach from=$order_info.products item="oi" key="key"}
                {hook name="orders:items_list_row"}
                {if !$oi.extra.parent}
                <tr>
                    <td data-th="{__("product")}">
                        <div class="order-product-image">
                            {include file="common/image.tpl" image=$oi.main_pair.icon|default:$oi.main_pair.detailed image_id=$oi.main_pair.image_id image_width=$settings.Thumbnails.product_admin_mini_icon_width image_height=$settings.Thumbnails.product_admin_mini_icon_height href="products.update?product_id=`$oi.product_id`"|fn_url}
                        </div>
                        <div class="order-product-info">
                            {if !$oi.deleted_product}<a href="{"products.update?product_id=`$oi.product_id`"|fn_url}">{/if}{$oi.product nofilter}{if !$oi.deleted_product}</a>{/if}
                            <div class="products-hint">
                            {hook name="orders:product_info"}
                                {if $oi.product_code}<p class="products-hint__code">{__("sku")}:{$oi.product_code}</p>{/if}
      ----------->              <p class="products-amount">{__("product_amount")}:{$product_amount}</p>							
                            {/hook}						
                            </div>
                            {if $oi.product_options}<div class="options-info">{include file="common/options_info.tpl" product_options=$oi.product_options}</div>{/if}
                        </div>
                    </td>
                    <td class="nowrap" data-th="{__("price")}">
                        {if $oi.extra.exclude_from_calculate}{__("free")}{else}{include file="common/price.tpl" value=$oi.original_price}{/if}</td>
                    <td class="center" data-th="{__("quantity")}">
                        {$oi.amount}<br />
                        {if !"ULTIMATE:FREE"|fn_allowed_for && $oi.shipped_amount > 0}
                            <span class="muted"><small>({$oi.shipped_amount}&nbsp;{__("shipped")})</small></span>
                        {/if}
                    </td>
                    {if $order_info.use_discount}
                    <td class="nowrap" data-th="{__("discount")}">
                        {if $oi.extra.discount|floatval}{include file="common/price.tpl" value=$oi.extra.discount}{else}-{/if}</td>
                    {/if}
                    {if $order_info.taxes && $settings.General.tax_calculation != "subtotal"}
                    <td class="nowrap" data-th="{__("tax")}">
                        {if $oi.tax_value|floatval}{include file="common/price.tpl" value=$oi.tax_value}{else}-{/if}</td>
                    {/if}
                    <td class="right" data-th="{__("subtotal")}"><span>{if $oi.extra.exclude_from_calculate}{__("free")}{else}{include file="common/price.tpl" value=$oi.display_subtotal}{/if}</span></td>
                </tr>
                {/if}
                {/hook}
                {/foreach}

But not working...
i have tried and {oi.amount} but this amount is order amount.. :-(
How do I have to write it to display the stock there?

 

This is a screenshot how I want it done in the end

http://prntscr.com/rr3o26

 

 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11597 posts

Posted 01 April 2020 - 08:45 PM #2

Try

{$oi.amount}

which will give you the purchased quantity (but it already shows that).  If you want the amount that is currently in inventory (after this order) then you'll most likely have to do something like this:

{assign var="inventory_amount" value=$oi.product_id|fn_get_product_amount}
{$inventory_amount}

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • roussetos
  • Newbie
  • Members
  • Join Date: 27-Feb 14
  • 7 posts

Posted 10 April 2020 - 11:31 AM #3

Yes Done!!!
This is solution!

Thanks!
 

 

Try

{$oi.amount}

which will give you the purchased quantity (but it already shows that).  If you want the amount that is currently in inventory (after this order) then you'll most likely have to do something like this:

{assign var="inventory_amount" value=$oi.product_id|fn_get_product_amount}
{$inventory_amount}