skip to Main Content

Magento: Get Customer ID in Admin

In Magento 1.9 I want to get the customerId of opened customer in Mage_Adminhtml_Block_Customer_Edit_Tab_View. I tried like this: $customer_session = Mage::getSingleton('customer/session'); //I saw here in Stackoverflow this $customer = $customer_session->getCustomer(); $customerID = $customer->getId(); But I got a null. I also…

VIEW QUESTION

Split array in magento 1.x

I have an array like this on;tracking34567;1;ABC;2019-08-13;on;tracking123;1;BCD;2019-08-13;on;123456test;1;USA;2019-08-13; How to split it like this Array ( [0] => on [1] => tracking34567 [2] => 1 [3] => ABC [4] => 2019-08-13 ) Array ( [0] => on [1] => tracking123 [2]…

VIEW QUESTION

Getting error while adding product to cart – Magento

I tried to add product programmatically. and i use below code $cart = Mage::getSingleton('checkout/cart'); $cart->init(); $paramater = array( 'product' => $product->getId(), 'related_product' => null, 'qty' => 1, 'form_key' => Mage::getSingleton('core/session')->getFormKey() ); $request = new Varien_Object(); $request->setData($paramater); $cart->addProduct($product, $request); $cart->save(); This…

VIEW QUESTION
Back To Top
Search