SELECT cpet.entity_id, cpet.value, cpet.store_id, cpet.attribute_id FROM eav_attribute AS ea
INNER JOIN catalog_product_entity_text AS cpet ON cpet.attribute_id = ea.attribute_id
WHERE ea.attribute_code = 'short_description'
AND ea.entity_type_id = 4
AND cpet.entity_id = 388
#GROUP BY cpet.entity_id
#LIMIT 3
// Get all blosk on page
$blocks = Mage::app()->getLayout()->getAllBlocks();
// Get all block on page names
$blockNames = array_keys($blocks);
The Magento Session object should be used when querying the current quote. Access it like so:
$checkout = Mage::getSingleton('checkout/session')
The getQuote() method is responsible for retrieving the current quote. If a quote ID doesn't exist on the session object then a new quote object (Mage_Sales_Model_Quote) is created and set up with all of the necessary data (customer id, store id, remote ip etc).
If a product has never been added to the cart or the cart isn't being loaded from a previous session, it's likely the cart will never have been saved and will have no id. The cart gets saved when a product is added from the Checkout module's CartController (Mage_Checkout_CartController) in the addAction.
When I first needed to access a collection of countries in Magento I assumed it would work like all other data collections but was shocked to find that this wasn't the case. Rather than store country data in the database, Magento stores country data in an XML file and loads it in on each request. Fortunately though, there are some simple functions that we can use to access country names and codes in Magento.
$countryList = Mage::getResourceModel('directory/country_collection')
->loadData()
->toOptionArray(false);
UPDATE `eav_entity_store` SET `increment_last_id` = {{NEW_LAST_INCREMENT_ID}} WHERE `entity_type_id` = {{ENTITY_TYPE_ID}} AND `store_id` = {{STORE_ID}};
- {{NEW_LAST_INCREMENT_ID}} - any number what will be new last increment
- {{ENTITY_TYPE_ID}} - entity type id from table
eav_entity_type
like order, invoice etc - {{STORE_ID}} - store id for what need change increment
Change your .htaccess file code on your website root directory (i.e. Your public_html ".htaccess" file)
############################################
## Allow fonts to load on subdomains.
<FilesMatch "(ttf | otf | woff | eot | svg). $">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
<?php | |
class Vendor_ExtensionName_Helper_Data extends Mage_Core_Helper_Abstract | |
{ | |
protected $_attributes; | |
protected $_options_count; | |
/** | |
* Retrieve product attribute options count | |
* |
#Get File Extension
Detects the file extension from a given string. This function returns the text following the last dot of the file name, so more complicated file extensions such as .tar.gz are only returned as ".gz".
function file_ext($file) {
$last_dot = strrpos($file, '.');
if ($last_dot !== false) {
return strtolower(substr($file, $last_dot + 1));
}