20 votes
Accepted

my table is not installing in Magento 2

In Magento 2 version information is stored on setup_module table. So you can remove your module and re run the commands it will work.
Manoj Kumar's user avatar
  • 1,348
10 votes

Creating custom module in magento2 show fatal error

You can use below mentioned command and then refresh the page. php bin/magento setup:upgrade
Hardik Shah's user avatar
6 votes
Accepted

Getting at variables from CMS block insertions

You can definitely use the code you pasted: {{block type="core/template" template="page/html/jobappform.phtml" a="1" b="2"}} And then in your template you can do: $this->getA(); $this->getB()...
Raphael at Digital Pianism's user avatar
6 votes
Accepted

How to get Cookies already set on the browser

You can try the below code to get cookie. <?php namespace Training\Rememberme\Helper; use Magento\Framework\App\Helper\AbstractHelper; use Magento\Framework\App\Config\ScopeConfigInterface; use ...
Jjo's user avatar
  • 1,158
5 votes

Email template 'custom_mail_template' is not defined

I face the same problem when I use a custom email template and its resolved by the following changes. If you check your system.xml file you can find that you path for system config for email template ...
Nikunj Rawat's user avatar
5 votes

retrieving collection in magento-2?

I hope this might help you $orderCollection = $objectManager->create('Magento\Sales\Model\ResourceModel\Order\Grid\Collection'); $orderCollection->getSelect()->joinLeft( ['...
Abhishek Panchal's user avatar
4 votes
Accepted

How should I get the image path?

You can take it from the helper class Mage::helper('catalog/image')->init($product, 'thumbnail')->resize(100);
Priyank's user avatar
  • 7,682
4 votes

How should I get the image path?

Mage::getModel('catalog/product_media_config')->getMediaUrl( $product->getImage());
Shahab Hameed's user avatar
4 votes
Accepted

Magento 1 end of life - where can I download Magento 1.5.1 patch to run PHP 5.4?

UPDATE Magento has removed the official links but there is a project on github where all releases of magento can be found. The link is https://github.com/OpenMage/magento-mirror/releases Currently the ...
Zenel Rrushi's user avatar
4 votes

Magento 1 end of life - where can I download Magento 1.5.1 patch to run PHP 5.4?

Check github repo from OpenMage – https://github.com/OpenMage/magento-mirror/releases. It contain releases starting from 1.1.1 up to 1.9.4.5. Security patches can be found in Magento patches mirror ...
Sergey Korzhov's user avatar
3 votes

How to get all review filter/order by rating star of a product

This code will put reviews with higher rates on top: $productId = $my_product->getId(); $reviews = Mage::getModel('review/review')->getResourceCollection() ->addStoreFilter(Mage::...
Neklo.com's user avatar
  • 2,379
3 votes
Accepted

Mage::getStoreConfig('Section/Group/Field') path not in core_config_data

The problem comes from: <source_model>adminhtml/system_config_source_tracktype</source_model> This source model does not exist. There is also no other source model in the core, called "...
Fabian Schmengler's user avatar
3 votes

RegEx in PHP file

I reckon you should use Zend_Validate_Regex in that case. You could do: $validate = new Zend_Validate_Regex("/(?=.*[\d])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&])[0-9a-zA-Z!@#$%^&]{10,16}/"); if ...
Raphael at Digital Pianism's user avatar
3 votes

Is there any library for this error or something else?

you should have this: require_once('app/Mage.php'); $app = Mage::app(); Mage::helper('catalog/output'); Basically the $this->helper is calling the function that is contained inside ...
Nguyễn Hồng Quân's user avatar
3 votes
Accepted

Where is the Magento 1.x PHP 5.4 patch?

How about https://magento.com/tech-resources/download#download252 :) Sorry for one line answer (have to write something)
sv3n's user avatar
  • 11.7k
2 votes

how to extend/inject this to customer address in magento 2

Extending @magento two's answer, I've managed to find a way to somewhat extend the web/js objects while still maintaining the original JS object's constructors and functions are available. I've done ...
CarComp's user avatar
  • 1,246
2 votes

Magento Module development

Magento already displays some messages above the whole page like when javascript is not enabled or when the store is in "demo" mode. You can rewrite the block that displays those messages and do ...
Marius's user avatar
  • 198k
2 votes

my table is not installing in Magento 2

Some time there may an entry for you module in app/etc/config.php with value 0. And if you run the command bin/magento setup:upgrade then it will not upgrade your plugin. Change the vaue to 1 ...
Manish's user avatar
  • 3,106
2 votes
Accepted

RegEx in PHP file

if (strlen($password) && !Zend_Validate::is($password, 'Regex', array('/(?=.*[\d])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&])[0-9a-zA-Z!@#$%^&]{10,16}/')) { $errors[] = Mage::helper('...
Marius's user avatar
  • 198k
2 votes

How to call php if/else statement if value empty

You can achieve this in one line with a ternary operator $_commissionGroupCode = ($_voucher ? 'VOUCHER' : 'DEFAULT');
TheNightmare's user avatar
2 votes
Accepted

How to turn off Bread Crumb

Go To Admin-->System --> Web --> Default Pages --> Show Breadcrumbs for CMS Pages to Set "NO".
Mage Rider's user avatar
2 votes

How to turn off Bread Crumb

If you want to remove breadcrumbs from site add below code in your local.xml file in current theme <?xml version="1.0"?> <layout version="0.1.0"> <default> <reference ...
Minesh Patel's user avatar
  • 2,193
2 votes
Accepted

How can i redirect from 1 page to product detail page?

just use below code $productCollection = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToFilter('name', array('like' => '%hp%')) ->addAttributeToSelect('*'...
Gopal Patel's user avatar
  • 3,139
2 votes
Accepted

What is the attribute to check if products are sold in incrememts?

Try it like this: <?php if($_product->getStockItem()->getQtyIncrements()): ?> <p><?php echo $this->__('Only available in box quantities');?></p> <?php else: ?...
Marius's user avatar
  • 198k
2 votes

How to get the css file path in magento?

Replace Code With: <link rel="stylesheet" href="<?php echo $this->getSkinUrl(); ?>css/yourCssfile.css" type="text/css" />
Harshil Parekh's user avatar
2 votes
Accepted

Magento 1 - Save Collection Without Foreach

After doing some research into this, I discovered that the best way to do this is like the following. Please note that the walk iterator is essentially the same thing as a foreach loop, however the ...
djames's user avatar
  • 387
2 votes
Accepted

Magento 2 : Error While Installing

For upgrading PHP version you can go through following steps Run the following command if you are using linux: For PHP 5.5, PHP 5.6 and PHP 7.0: sudo apt-add-repository ppa:ondrej/php For PHP 5.4 (...
Bhupendra Jadeja's user avatar
2 votes
Accepted

Not able to override phtml file

In argument (default.xml) you have specify your new phtml file. But you have given original phtml file. Instead of Magento_Theme you have to use Netsmartz_Welcomemessage::theme/messages.phtml <...
Agnes's user avatar
  • 787
2 votes
Accepted

Fetch array with PHP MySQL query

Try this $query = "SELECT $userTable.value, SUM(DISTINCT(base_order_total)) FROM $salesTable INNER JOIN $userTable ON $salesTable.vendor_id=$userTable.entity_id WHERE payment_state='2' GROUP BY ...
Dinesh Yadav's user avatar
  • 6,447
1 vote
Accepted

How to call php if/else statement if value empty

You can do it like this: $_commissionGroupCode = (!$_voucher ? "DEFAULT" : "VOUCHER");
Raphael at Digital Pianism's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible