문제

I want to generate a link to the sales create order page (manual order page) in the admin and submit a customer id so that it opens automatically with the customers details filled out in the address form.

  index.php/admin/sales_order_create/index/key

I know sometimes a $this->getUrl('path') works but I can't find any instructions online for setting a customer before the page loads. A solution like the following would obviously be ideal.

 $this->getUrl('sales/order/create/', $customer_id);
도움이 되었습니까?

해결책

In your admin template or block file:

echo $this->getUrl('*/sales_order_create', array('customer_id' => 137));

This will land you on store selection page. If you already know store id you can add that as well:

echo $this->getUrl('*/sales_order_create', array('customer_id' => 137, 'store_id' => 1));

EDIT

Alternative method

echo $this->helper('adminhtml')->getUrl('*/sales_order_create', array('customer_id' => 137, 'store_id' => 1));

다른 팁

Assuming $customer_id is already the correct ID for the customer, I think you'd just need:

$this->getUrl('sales/order/create/', array('customer_id' => $customer_id));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top