Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
In my Magento site I want to remove(delete) discontinue(No longer) products.
But I don't know how to find which product is discontinued product and how to remove(delete) them.
Please anybody have script.
Create a delete_products.php file in magento's root folder.
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);
ini_set('log_errors', TRUE);
//Include the Mage package
require_once './app/Mage.php';
//Set Developer mode to true, allows for more verbose errors
Mage::setIsDeveloperMode(true);
//Initialize the app.
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect(array('sku','status'))->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_DISABLED);
foreach ($products as $product) {
try {
echo "<pre>Deleting ".$product->getSku().", status: ".$product->getStatus()."</pre>";
$product->delete();
echo '<pre>OK</pre>';
} catch(Exception $e) {
echo "<pre>ERROR: ".$e->getMessage()."</pre>";
}
}
Run [MAGENTO SITE URL]/delete_products.php
It is not as fast as direct SQL delete but it works.
Reindex after script is done.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I would like to open a json file on Excel to sepparate the fields in rows. I see that on internet there are many converters, but i can´t upload the information i´m working with to internet. is there any manual way or a method to do this?
thank you
You can download/copy this code locally from jsfiddle.net:
http://jsfiddle.net/hybrid13i/JXrwM
It uses the JSONToCSVConvertor object of JavaScript:
$(document).ready(function(){
$('button').click(function(){
var data = $('#txt').val();
if(data == '')
return;
JSONToCSVConvertor(data, "Vehicle Report", true);
});
});
The full code from jsfiddle.net includes only HTML, CSS and JavaScript, so you can simply run it locally.
Afterwords, you can paste your JSON code and generate the CSV/Excel file.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have problem making sql request
such as
SELECT * FROM 'users' WHERE 1
using lazarus SqlQuery,SqlTransaction and MySql55Connection.But when I'm trying to open SqlQuery(
SqlQuery1.Open;
) it causes exception:
Sql statement not set.
I understood my problem. I should for first set sql request and then open query and connection. Like this:
SqlQuery1.Sql.text:='SELECT FROM "users" WHERE 1'
MySql55Connection1.Open;
SqlQuery1.Open;
while not SqlQuery1.EOF
begin
//fetch result
SqlQuery1.Next;
end;
SqlQuery1.Close;
MySql55Connection1.Close;//Close connection
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am working on writing a testing suite for our REST API in node.js. I am wondering if there is a module out there that does the json comparison in a configurable way.
For example : { "id":"456", "data":"Test_Data", "date":"2014-05-19" }
I need to be able to tell the module, check not null for id since its autogenerated, check not null for date and check only data value.
Thanks.
Or you can use expect.js
var expect = require("expect.js");
var data = {"name":"John", "age":32};
data.toString = function(){"String"};
expect(data).not.to.be(undefined);
expect(data.name).to.be("John");
expect(data.toString).to.be.a("function");
For your tests, you can use should.js:
var should = require('should');
var data = { "id":"456", "data":"Test_Data", "date":"2014-05-19" };
data.should.containEql({ id: "456" })
data.should.have.property("data");
data.should.have.property("data").with.type("string");
data.should.not.have.property("non-existing");
data.data.should.match(/^Test.*$/);
[...]
Happy testing!
EDIT: you can use instead of use. Also, I'm not affiliated with should.js :)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Is there any example/tutorial about how to fetch JSON data from a web server as an HttpRequest, and then it uses the data in a web page? I googled, but did not find one. This one here is too simple http://www.w3schools.com/json/json_eval.asp
Use Jquery's getJSON method to pull the JSON:
$.getJSON('/someurl',function(jsonObject){
// the json object is passed as input to the callback
});
http://api.jquery.com/jQuery.getJSON/
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
A certain open source project is hosted at Gitorious. Suppose that at some future point X they decide to close source / delete their project from Gitorious.
Will there exist a public archive of the source code, in something like The Wayback Machine?
No, except someone keeps his clone of the repository and makes it public somewhere else.
If you want to mirror git repositories, see my blog entry about it.