This code will show you how to get the product id of the last product that was added to the shopping cart, and all the products currently in the shopping cart.
$productID
=Mage::getSingleton(
'checkout/session'
)->getLastAddedProductId(true);
echo
$productID
.
"<br>"
;
$_product
=Mage::getModel(
'catalog/product'
)->load(
$productID
);
echo
$_product
->getName().
"<br>"
;
$session
= Mage::getSingleton(
'checkout/session'
);
foreach
(
$session
->getQuote()->getAllItems()
as
$item
)
{
$productID
=
$item
->getProductId();
$productSku
=
$item
->getSku();
$productName
=
$item
->getName();
$productQty
=
$item
->getQty();
echo
$productID
.
"|"
.
$productSku
.
"|"
.
$productName
.
"|"
.
$productQty
.
"<br>"
;
}
Revisions
- June 9, 2017 @ 15:16:42 [Current Revision] by Sharing Solution
- June 9, 2017 @ 15:16:42 by Sharing Solution
Does Magento cost much to run? I have been using WooCommerce for awhile, but they have really irritated me lately. I just got hit with a $10k bill for a few plugins I own (completely out of the blue). They have increased their prices by 50 on all annual renewals – without telling their customers! Seems pretty odd. But nevertheless, I am currently looking to jump ship and not sure which shopping cart platform to use with our store.
Hi,
I think the cost will depend on the requirements of your business.
Magento has a lot of built-in features, so you don't need to buy a lot of plugins.
I see a lot of people have moved from WooCommerce to Magento with a half of cost and without renewal fee.
If you need further suggestion, you can contact me via the email [email protected]
Regards,
Han.
Enjoyed every bit of your post.Much thanks again. Keep writing.