Jump to content

Редактируемое поле в админке в заказе у конкретной покупки


Recommended Posts

Здравствуйте!

 

Нужно добавить поле для серийного номера, чтобы серийник потом печатался в товарном чеке. Для этого пытаюсь добавить поле для конкретной покупки  в карточке заказа.

 

Добавил поле в таблице s_purchases. В шаблоне заказа добавил нужно поле. Попробовал в OrderAdmin.php внести изменения :
 

foreach($purchases as $purchase)

				{

					$variant = $this->variants->get_variant($purchase->variant_id);



					if(!empty($purchase->id))

						if(!empty($variant))

							$this->orders->update_purchase($purchase->id, array('variant_id'=>$purchase->variant_id, 'variant_name'=>$variant->name, 'sku'=>$variant->sku,'price'=>$purchase->price, 'amount'=>$purchase->amount, 'sn'=>$purchase->sn));

						else

							$this->orders->update_purchase($purchase->id, array('price'=>$purchase->price, 'amount'=>$purchase->amount));

					else

						$purchase->id = $this->orders->add_purchase(array('order_id'=>$order->id, 'variant_id'=>$purchase->variant_id, 'variant_name'=>$variant->name, 'price'=>$purchase->price, 'amount'=>$purchase->amount, 'sn'=>$purchase->sn));

						

					$posted_purchases_ids[] = $purchase->id;			

				}

Пока безрезультатно. Помогите :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...