I am adding products to cart from admin to customer account like this:
$quote = Mage::getModel('sales/quote')->loadByCustomer($customer_ID); $quote->addProduct($product, $qty);
from this product is adding successfully in sales_flat_quote table with customer details but on frontend product is not showing in customer's cart. From little search I found that to show product in frontend side I have to add product to cart like this:
$quote = Mage::getSingleton('checkout/session')->getQuote(); $quote->addProduct($product, $qty);
But this is not working in my case as I have to use them from mobile apps.
So my queries are following:
- My first query is obvious how I can show products to fronted?
- Magento using oauth system for rest api's but that is not good(my perception) for android/ios applications. So what is best way to make api's for such of type of apps.
- When I am creating rest api for customer I am noticing that always in customer details it shows created from Admin and Associate to Website is Admin Even I after hardcode the website id value like:
$customer->setWebsiteId(2);Really we can not change?
- Is it good to create customer from admin side always?
If you find some corrections, please update them.