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 ...
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 ...
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(
['...
4
votes
How should I get the image path?
Mage::getModel('catalog/product_media_config')->getMediaUrl( $product->getImage());
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);
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 ...
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 ...
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 ...
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 ...
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)
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 ...
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');
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 ...
2
votes
Accepted
How to turn off Bread Crumb
Go To Admin-->System --> Web --> Default Pages --> Show Breadcrumbs for CMS Pages to Set "NO".
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('...
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: ?...
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('*'...
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 ...
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" />
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 (...
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
<...
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 ...
1
vote
How to Get top 5 Subcategories?
try below code.
<?php $newCategory = Mage::getModel('catalog/category')->getCollection()->addAttributeToFilter('parent_id',array('eq' => $newSubCategoryId))->setPageSize(5); ?>
...
1
vote
Magento 2 js not loading after installing a new theme
Run following 2 commands, I am sure issue will be resolved:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
1
vote
Right path of an image?
Try this code for getting original path
$productMediaConfig = Mage::getModel('catalog/product_media_config');
$baseImageUrl = $productMediaConfig->getMediaUrl($product->getImage());
$...
1
vote
Accepted
Uncaught TypeError: Argument 2 passed to Mage::dispatchEvent() must be of the type array
This line
Mage::dispatchEvent('testimonial_save_before', $model);
Should be
Mage::dispatchEvent('testimonial_save_before', array('testimonial' => $model));
And you need to modify the ...
1
vote
Is there any library for this error or something else?
I think you are creating a stand alone script.
so you can try below things to work
require_once("$Magento_Root_DIR/app/Mage.php"); // include Mage.php file
$app = Mage::app(); //init Mage::app()
$...
1
vote
How to turn off Bread Crumb
Method 1
If you want to remove the Breadcrumbs from all dynamic pages, use the code below in local.xml:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
...
1
vote
get attribute option value in magento 2.1 using helper in module data.php
You can use this in your helper class ::
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Catalog\Model\Product\Attribute\Repository ...
1
vote
Accepted
How to call php if/else statement if value empty
You can do it like this:
$_commissionGroupCode = (!$_voucher ? "DEFAULT" : "VOUCHER");
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
php-5.4 × 279magento-1.9 × 85
magento-1.8 × 64
magento-1.6 × 25
magento-1.7 × 24
magento2 × 19
database × 15
magento2-dev-beta × 14
magento-enterprise × 13
checkout × 11
phpstorm × 11
product × 10
customer × 10
php × 9
template × 9
attributes × 8
xml × 8
api × 7
magento-1 × 6
extensions × 6
soap × 6
adminhtml × 5
ajax × 5
phtml × 5
patches × 5