$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect(['entity_id'])
->addAttributeToFilter(
array(
array('attribute'=> 'pricegroup','null' => true),
array('attribute'=> 'pricegroup','eq' => ''),
array('attribute'=> 'pricegroup','eq' => 'NO FIELD')
),
'',
'left')
->addAttributeToFilter('status', ['eq' => 1]);
echo $collection->getSelect();
echo '<pre>';print_r($collection->getData());exit;
Shopify, Shopify Apps, Magento, WordPress, Codeigniter, Joomla, Big Commerce | PHP
Tuesday, 10 September 2019
How to get null attribute product value in magento 1 addAttributeToFilter Filter Query | Where condition
Thursday, 5 September 2019
How to upload image file with ajax
jQuery("form#add-group-form").submit(function(e){
e.preventDefault();
var formData = new FormData(jQuery(this)[0]);
jQuery.ajax({
type:"POST",
url:jQuery(this).attr("action"),
data:formData,
processData: false,
contentType: false,
dataType: "json",
success: function(response){
alert(response);
}
});
});
e.preventDefault();
var formData = new FormData(jQuery(this)[0]);
jQuery.ajax({
type:"POST",
url:jQuery(this).attr("action"),
data:formData,
processData: false,
contentType: false,
dataType: "json",
success: function(response){
alert(response);
}
});
});
Friday, 30 August 2019
How to create multidimensional array in jQuery | Javascript
var jaydip = {};
for(var i=0; i < items.length; i++){
jaydip[items[i]] = items[i]+'123';
}
console.log(jaydip);
alert(JSON.stringify(jaydip));
Wednesday, 28 August 2019
Re-index primary key in Mysql database table
set @ROW = 0;UPDATE `visitorhistory` SET `id` = @ROW := @ROW+1 ORDER BY `id` ASC;
How to Eliminate render-blocking JavaScript and CSS on WordPress
https://www.hostinger.in/tutorials/how-to-fix-eliminate-render-blocking-javascript-and-css-in-above-the-fold-content-on-wordpress
How to work async in jQuery ajax | Does it have something to do with preventing other events on the page from firing?
Yes, async to false means that the statement you are calling has to complete before the next statements of your function can be called. If you set async: true then that statement will begin it's execution the same time and the next statement will be called regardless of whether the async statement has completed yet.
jQuery('body #pricegroup-products-container').on('click', '.saveimage' , function (e) {
var returnHtml = '';
jQuery.ajax({
type: "POST",
async: false,
cache: false,
url: url,
data: {id: '12345'},
dataType: "html",
success: function (response) {
returnHtml = response;
}
});
alert(returnHtml);
});
jQuery('body #pricegroup-products-container').on('click', '.saveimage' , function (e) {
var returnHtml = '';
jQuery.ajax({
type: "POST",
async: false,
cache: false,
url: url,
data: {id: '12345'},
dataType: "html",
success: function (response) {
returnHtml = response;
}
});
alert(returnHtml);
});
Friday, 2 August 2019
How to set cron job in heroku in PHP | Codeigniter
Step 1: Install Heroku Scheduler add-ons from Heroku.
Step 2: Goto Heroku Scheduler page and add Job, set time interval and add command " php /app/index.php orderupdate crontset jaydip "
Step 2: Goto Heroku Scheduler page and add Job, set time interval and add command " php /app/index.php orderupdate crontset jaydip "
- php = server language
- /app/index.php = Path of the project root index.php
- orderupdate = name of controller
- crontset = name of function
- jaydip = variable name which you want to get into crontset function
Step 3: open Orderupdate.php controller
public crontset function($name){
echo $name;
}
Subscribe to:
Posts (Atom)