Skip to content

Instantly share code, notes, and snippets.

View stnc's full-sized avatar
🎯
Focusing

TUNÇ Selman stnc

🎯
Focusing
View GitHub Profile
#!/usr/bin/python3
#test için http://localhost:8000/cgi-bin/get_example.py?first_name=selman&last_name=tunc
# Import modules for CGI handling
import cgi, cgitb
# Create instance of FieldStorage
form = cgi.FieldStorage()
# Get data from fields
first_name = form.getvalue('first_name')
from jinja2 import Environment, FileSystemLoader
import os
# Import modules for CGI handling
import cgi, cgitb
# Capture our current directory
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
def print_html_doc():
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ title }}</title>
<meta name="description" content="{{ description }}">
<meta name="author" content="selmantunc.com">
#!/usr/bin/python3
import cgi, cgitb
# Create instance of FieldStorage
form = cgi.FieldStorage()
if form.getvalue('name_lastnema'):
name_ = form.getvalue('name_lastnema')
# Get data from fields
<?php
/*
CSV ye export edilmiş müşteri datasının magento içerisine alınmasını sağlayan kod parçası.
*/
ini_set('display_errors', '1');
error_reporting(E_ALL);
include "app/Mage.php";
header('Content-type: text/plain; charset=utf-8');
<?php
/*
CSV ye export edilmiş newsletter üyelerinin sadece newsletter a atanmasını sağlayan kod parçası.
*/
$store_id = 1;
$csv_filepath = "subscriber.csv";
$csv_delimiter = ',';
$csv_enclosure = '"';
$magento_path = __DIR__;
<?php
$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
if ($product) {
$productId = $product->getId();
$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);
$stockItemId = $stockItem->getId();
$stock = array();
if (!$stockItemId) {
$stockItem->setData('product_id', $product->getId());
<?php
/*
Magentoda yer alan simple ürünleri okuyup yerine configurable ürün açan kod parçası
*/
ini_set('display_errors', '1');
error_reporting(E_ALL);
include "app/Mage.php";
header('Content-type: text/plain; charset=utf-8');
Mage::app();
<?php
/* Remove all category */
require_once('app/Mage.php');
ini_set('display_errors', 1);
set_time_limit(0);
Mage::setIsDeveloperMode(true);
Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
<?php
/*
Başka bir eticaret script inden export edilmiş CSV yi düzenleyip magentoya ürün olarak ekleyen kod parçası.
*/
//print_r($urunler);
/*
*
* [0] => StokNo
[1] => urunADI