Projekt

Allgemein

Profil

GX-Bug #49115 » Attribute_Artikelnr_Fix.patch

neuer Fix aus Core-Abteilung - Moritz Bunjes, 03.11.2016 17:22

Unterschiede anzeigen:

src/system/classes/checkout/CheckoutConfirmationContentView.inc.php (revision Shelved version)
1 1
<?php
2 2
/* --------------------------------------------------------------
3
  CheckoutConfirmationContentView.inc.php 2015-04-13 gm
3
  CheckoutConfirmationContentView.inc.php 2016-11-03
4 4
  Gambio GmbH
5 5
  http://www.gambio.de
6
  Copyright (c) 2015 Gambio GmbH
6
  Copyright (c) 2016 Gambio GmbH
7 7
  Released under the GNU General Public License (Version 2)
8 8
  [http://www.gnu.org/licenses/gpl-2.0.html]
9 9
  --------------------------------------------------------------
......
125 125

  
126 126
				$t_options_values_array = array();
127 127
				$t_attr_weight = 0;
128
				$t_attr_model_array = array();
129 128

  
130 129
				if(isset($coo_order->products[$i]['attributes']) && is_array($coo_order->products[$i]['attributes']))
131 130
				{
......
139 138
					{
140 139
						$t_attr_sql = "SELECT
141 140
											options_values_weight AS weight,
142
											weight_prefix AS prefix,
143
											attributes_model
141
											weight_prefix AS prefix
144 142
										FROM
145 143
											products_attributes
146 144
										WHERE
......
154 152
						{
155 153
							$t_attr_result_array = xtc_db_fetch_array($t_attr_result);
156 154

  
157
							if(trim($t_attr_result_array['attributes_model']) != '')
158
							{
159
								$t_attr_model_array[] = $t_attr_result_array['attributes_model'];
160
							}
161

  
162 155
							if($t_attr_result_array['prefix'] == '-')
163 156
							{
164 157
								$t_attr_weight -= (double) $t_attr_result_array['weight'];
......
185 178
				}
186 179

  
187 180
				$t_products_model = $coo_order->products[$i]['model'];
188
				if($t_products_model != '' && isset($t_attr_model_array[0]))
189
				{
190
					$t_products_model .= '-' . implode('-', $t_attr_model_array);
191
				}
192
				else
193
				{
194
					$t_products_model .= implode('-', $t_attr_model_array);
195
				}
196 181

  
197 182
				#properties
198 183
				$t_properties = '';
src/includes/classes/wish_list.php (revision Shelved version)
1 1
<?php
2 2
/* --------------------------------------------------------------
3
  wish_list.php 2016-09-21
3
  wish_list.php 2016-11-03
4 4
  Gambio GmbH
5 5
  http://www.gambio.de
6 6
  Copyright (c) 2016 Gambio GmbH
......
491 491

  
492 492
				# add attributes price
493 493
				$products_price = $products_price + $this->attributes_price($products_id);
494

  
494
				
495
				$t_attr_model_array = [];
496
				if(array_key_exists('attributes', $this->contents[$products_id]))
497
				{
498
					foreach($this->contents[$products_id]['attributes'] AS $t_option_id => $t_value_id)
499
					{
500
						$t_attr_sql    = "SELECT
501
											options_values_weight AS weight,
502
											weight_prefix AS prefix,
503
											attributes_model
504
										FROM
505
											products_attributes
506
										WHERE
507
											products_id				= '"
508
						                 . (int)xtc_get_prid($products_id) . "' AND
509
											options_id				= '" . (int)$t_option_id . "' AND
510
											options_values_id		= '" . (int)$t_value_id . "'
511
										LIMIT 1";
512
						$t_attr_result = xtc_db_query($t_attr_sql);
513
						
514
						if(xtc_db_num_rows($t_attr_result) == 1)
515
						{
516
							$t_attr_result_array = xtc_db_fetch_array($t_attr_result);
517
							
518
							if(trim($t_attr_result_array['attributes_model']) != '')
519
							{
520
								$t_attr_model_array[] = $t_attr_result_array['attributes_model'];
521
							}
522
						}
523
					}
524
					
525
					$t_products_model = $products['products_model'];
526
					if($t_products_model != '' && count($t_attr_model_array))
527
					{
528
						$t_products_model .= '-' . implode('-', $t_attr_model_array);
529
					}
530
					else
531
					{
532
						$t_products_model .= implode('-', $t_attr_model_array);
533
					}
534
				}
535

  
495 536
				$products_array[] = array('id' => $products_id,
496 537
					'name' => $products['products_name'],
497
					'model' => $products['products_model'],
538
					'model' => $t_products_model,
498 539
					'image' => $products['products_image'],
499 540
					'price' => $products_price,
500 541
					'quantity' => $this->contents[$products_id]['qty'],
src/includes/classes/shopping_cart.php (revision Shelved version)
1 1
<?php
2 2
/* --------------------------------------------------------------
3
  shopping_cart.php 2016-09-26
3
  shopping_cart.php 2016-11-03
4 4
  Gambio GmbH
5 5
  http://www.gambio.de
6 6
  Copyright (c) 2016 Gambio GmbH
......
573 573
					{
574 574
						$t_properties_weight = $products['products_weight'];
575 575
					}
576

  
576
					
577
					$t_attr_model_array = [];
578
					if(array_key_exists('attributes', $this->contents[$products_id]))
579
					{
580
						foreach($this->contents[$products_id]['attributes'] AS $t_option_id => $t_value_id)
581
						{
582
							$t_attr_sql    = "SELECT
583
											options_values_weight AS weight,
584
											weight_prefix AS prefix,
585
											attributes_model
586
										FROM
587
											products_attributes
588
										WHERE
589
											products_id				= '"
590
							                 . (int)xtc_get_prid($products_id) . "' AND
591
											options_id				= '" . (int)$t_option_id . "' AND
592
											options_values_id		= '" . (int)$t_value_id . "'
593
										LIMIT 1";
594
							$t_attr_result = xtc_db_query($t_attr_sql);
595
							
596
							if(xtc_db_num_rows($t_attr_result) == 1)
597
							{
598
								$t_attr_result_array = xtc_db_fetch_array($t_attr_result);
599
								
600
								if(trim($t_attr_result_array['attributes_model']) != '')
601
								{
602
									$t_attr_model_array[] = $t_attr_result_array['attributes_model'];
603
								}
604
							}
605
						}
606
						
607
						$t_products_model = $products['products_model'];
608
						if($t_products_model != '' && count($t_attr_model_array))
609
						{
610
							$t_products_model .= '-' . implode('-', $t_attr_model_array);
611
						}
612
						else
613
						{
614
							$t_products_model .= implode('-', $t_attr_model_array);
615
						}
616
					}
617

  
577 618
					$products_array[] = array(
578 619
						'id' => $products_id,
579 620
						'name' => $products['products_name'],
580 621
						'checkout_information' => $products['checkout_information'],
581
						'model' => $products['products_model'],
622
						'model' => $t_products_model,
582 623
						'image' => $products['products_image'],
583 624
						'price' => $products_price,
584 625
						'vpe' => $product->getVPEtext($products, $products_price),
(2-2/2)