$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');
// retrieve quote items collection
$itemsCollection = $cart->getQuote()->getItemsCollection();
// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once ( "app/Mage.php" ); | |
Mage::app(); | |
umask(0); | |
//echo Mage::getBaseUrl(); | |
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); | |
//exit; | |
$_productCollection = Mage::getModel('catalog/product') | |
->getCollection() | |
->addAttributeToSort('created_at', 'DESC') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'app/Mage.php'; | |
Mage::app(); | |
$productId = 4299; | |
//load the product | |
$product = Mage::getModel('catalog/product')->load($productId); | |
//get all images | |
$mediaGallery = $product->getMediaGallery(); | |
//if there are images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//increase execution time | |
ini_set('max_execution_time', 900); //900 seconds = 15 minutes | |
//require Magento | |
require_once 'app/Mage.php'; | |
$app = Mage::app('admin'); | |
umask(0); | |
//enable Error Reporting |
New tab in product detail page is very easy task with product attribute. Use below steps and check it out.
-
Step 1. Create Product Attribute “video”.
-
Step 2. Create file catalog_product_view.xml in the app/design/frontend/{vender name}/{theme name}/Magento_Catalog/layout
In the file write the below code:
To login into magento admin, using only ftp access is a little tricky. Through FTP open the class Mage_Admin_Model_User located at
app\code\core\Mage\Admin\Model\User.php
Next find the
$this->loadByUsername($username);
<input name="qty" type="text" class="input-text qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>" />
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{block class="Magento\\Cms\\Block\\Block" block_id="block_identifier"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find the PHP binary and php.ini path | |
To display the path to your PHP binary, enter | |
which php | |
A sample result follows: | |
/usr/bin/php | |
Create the cron job |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
$reviewFactory = $objectManager->create('Magento\Review\Model\Review'); | |
$storeId = $this->_storeManager->getStore()->getId(); | |
$reviewFactory->getEntitySummary($product, $storeId); | |
$ratingSummary = $product->getRatingSummary()->getRatingSummary(); |