• My account
    • (X)Sign in

      I am a returning customer at TYPO3 Multishop

      Enter your username and password here in order to log in on the website:

      Forgot your password?

      Not yet customer of TYPO3 Multishop?

      • Order history
      • Automatic generated e-mail history
      • Track your Order
      New at TYPO3 Multishop
You are here:

Help by translating Multishop in your local language

On the following page you can help by translating Multishop in your local language:

https://translation.typo3.org/projects/TYPO3.ext.multishop/

Spanish:

https://translation.typo3.org/es/TYPO3.ext.multishop/pi1/locallang.xlf

The following language are already translated by our supporters:

  • Dutch
  • German
  • French

multishop bug: no attributes shown in the admin edit order print


Author Message
jens
Jens
Multishop professional
Topic creator
registered since: 16.05.2012
Posts: 33
Hi Bas!

\typo3conf\ext\multishop\scripts\admin_pages\includes\orders\admin_edit_order_print.php

The problem starts in line 164:

PHP
foreach ($order['products'] as $product)
		{
			if (!$tr_type or $tr_type=='even') 	$tr_type='odd';
			else								$tr_type='even';
			$tmpcontent.='<tr class="'.$tr_type.'">';
			$tmpcontent.='<td align="right" class="cell_products_qty">'.number_format($product['qty']).'</td>';
			$tmpcontent.='<td align="right" class="cell_products_id">'.$product['products_id'].'</td>';
			$tmpcontent.='<td align="left" class="cell_products_model">'.$product['products_model'].'</td>';
			$tmpcontent.='<td align="left" class="cell_products_name"><strong>'.$product['products_name'];
			if ($product['products_article_number'])
			{
				$tmpcontent.=' ('.$product['products_article_number'].')';
			}
			$tmpcontent.='</strong></td>';
			if ($get['print'] == 'invoice')
			{
				$tmpcontent.='<td align="right" class="cell_products_normal_price">'.mslib_fe::Money2Cents($product['final_price'],0).'</td>';
				$tmpcontent.='<td align="right" class="cell_products_vat">'.number_format($product['products_tax']).'%</td>';
				$tmpcontent.='<td align="right" class="cell_products_final_price">'.mslib_fe::Money2Cents(($product['qty']*$product['final_price']),0).'</td>';
			}
			$tmpcontent.='</tr>';
			if ($product['attributes'][$order['orders_products_id']])
			{
				foreach ($product['attributes'][$order['orders_products_id']] as $tmpkey => $options)
				{
					if ($options['products_options_values'])
					{
						$tmpcontent.='<tr class="'.$tr_type.'"><td>&nbsp;</td><td>&nbsp;</td><td align="left">'.$options['products_options'].': '.$options['products_options_values'].'</td><td align="right">&nbsp;</td><td align="right">&nbsp;</td><td align="right">';
						if ($get['print'] == 'invoice')
						{
							if ($options['options_values_price']> 0)
							{
								$tmpcontent.=mslib_fe::Money2Cents($options['price_prefix'].$options['options_values_price'],0);
							}
							$tmpcontent.='</td>';
							// count the vat
							if ($options['options_values_price'] and $order['products_tax'])
							{
								$item_tax=(($order['qty']*$options['options_values_price'])*($order['products_tax']/100));
								if ($options['price_prefix']=='+') $total_tax=$total_tax+$item_tax;
								elseif ($options['price_prefix']=='-') $total_tax=$total_tax-$item_tax;
							}
						}
					}
				}
			}
			$tmpcontent.='</tr>';
			// count the vat
			if ($order['final_price'] and $order['products_tax'])
			{
				$item_tax=$order['qty']*($order['final_price']*$order['products_tax']/100);
				$total_tax=$total_tax+$item_tax;
			}
		}


There is no
PHP
if ($product['attributes'][$order['orders_products_id']])

I guess you would need an additional foreach there, s.th. like:
PHP
foreach ($product['attributes'] as $attribute)


Could you please fix that and give me the code, so that I don´t have to change my code and instead ouse your original one.

Thx! icon_smile.gif
Written on: 26. 06. 2012 [11:18]
jens
Jens
Multishop professional
Topic creator
registered since: 16.05.2012
Posts: 33
I could not get my fingers from my keyboard... icon_wink.gif

So, my working solution is:

PHP
foreach ($order['products'] as $product)
		{
			if (!$tr_type or $tr_type=='even') 	$tr_type='odd';
			else								$tr_type='even';
			$tmpcontent.='<tr class="'.$tr_type.'">';
            $tmpcontent.='<td align="left" class="cell_products_model">'.$product['products_model'].'</td>';
            $tmpcontent.='<td align="left" class="cell_products_name"><strong>'.$product['products_name'].'</strong>';
 
            foreach ($product['attributes'] as $indexJ => $options)
            {
                if ($options['orders_products_id'])
                {
                    if ($options['products_options_values'])
                    {
                        $tmpcontent.='<div>'.$options['products_options'].': '.$options['products_options_values'];
                        if ($get['print'] == 'invoice')
                        {
                            if ($options['options_values_price']> 0)
                            {
                                $tmpcontent.=mslib_fe::Money2Cents($options['price_prefix'].$options['options_values_price'],0);
                            }
                            $tmpcontent.='</div>';
                            // count the vat
                            if ($options['options_values_price'] and $order['products_tax'])
                            {
                                $item_tax=(($order['qty']*$options['options_values_price'])*($order['products_tax']/100));
                                if ($options['price_prefix']=='+') $total_tax=$total_tax+$item_tax;
                                elseif ($options['price_prefix']=='-') $total_tax=$total_tax-$item_tax;
                            }
                        }
                    }
                    $tmpcontent.='</div>';
                }
 
                // count the vat
                if ($order['final_price'] and $order['products_tax'])
                {
                    $item_tax=$order['qty']*($order['final_price']*$order['products_tax']/100);
                    $total_tax=$total_tax+$item_tax;
                }
            }
            $tmpcontent.='</td>';
 
			$tmpcontent.='<td align="right" class="cell_products_qty">'.number_format($product['qty']).'</td>';
			if ($product['products_article_number'])
			{
				$tmpcontent.=' ('.$product['products_article_number'].')';
			}
 
			if ($get['print'] == 'invoice')
			{
				$tmpcontent.='<td align="right" class="cell_products_normal_price">'.mslib_fe::Money2Cents($product['final_price'],0).'</td>';
				$tmpcontent.='<td align="right" class="cell_products_final_price">'.mslib_fe::Money2Cents(($product['qty']*$product['final_price']),0).'</td>';
			}
			$tmpcontent.='</tr>';
 
 
		}


But I have to give the hint, that this is configured to my special needs. I have a different order of the columns and so on. So if one would like to copy this, he should know what he does. In this case, copy and paste could destroy your expected layout. So be careful.

Best regards!
Jens

P.S. I will use Bas´s variable-names later on, when he has fixed this bug. icon_smile.gif
Written on: 26. 06. 2012 [12:05]