Skip to content

Instantly share code, notes, and snippets.

Bruno elisei

Block or report user

Report or block elisei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@elisei
elisei / install_lamp_18.sh
Created Dec 18, 2018 — forked from ankurk91/install_lamp_18.sh
Ubuntu 18.04 - PHP development (php 7.2, MySQL 5.7, apache 2.4)
View install_lamp_18.sh
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 18.04 dev Server
# Run like - bash install_lamp.sh
# Script should auto terminate on errors
echo -e "\e[96m Adding PPA \e[39m"
sudo add-apt-repository -y ppa:ondrej/apache2
@elisei
elisei / dob.phtml
Created Jun 1, 2018 — forked from dele454/dob.phtml
Magento DOB widget with DOB Validation
View dob.phtml
<?php
/**
* @see Mage_Customer_Block_Widget_Dob
*/
?>
<label class="dob-label" for="<?php echo $this->getFieldId('month')?>"<?php if ($this->isRequired()) { echo ' class="required"'; } ?>><?php echo $this->__('Birthday') ?></label>
<div class="customer-dob input-box">
<div class="dob-year">
<?php $currentYear = intval(date("Y")); ?>
<select name="<?php echo $this->getFieldName('year'); ?>" id="<?php echo $this->getFieldId('year'); ?>">
@elisei
elisei / rest_test.php
Created Feb 22, 2018 — forked from xcommerce-gists/rest_test.php
Magento coupon code generator test script
View rest_test.php
<?php
/********************************************************************
File name: rest_test.php
Description:
A PHP test script that calls the Coupon AutoGen extension
to Magento's REST API.
The Coupon AutoGen API takes:
-- the rule ID of the &quot;Generate Coupons&quot; rule to execute
-- the number of coupon codes to generate
-- the length of each coupon code
@elisei
elisei / local.xml
Created Jun 13, 2017 — forked from MikeWilkie/local.xml
Magento – Disable Excessive Logging and Reporting in app/etc/local.xml
View local.xml
<?xml version="1.0"?>
<!-- license -->
<config>
<global>
<!-- global config -->
</global>
<frontend>
<events>
<!-- disble logs -->
<controller_action_predispatch>
@elisei
elisei / addExportButtonMagentoRecurringProfiles.php
Created Jan 20, 2017 — forked from tegansnyder/addExportButtonMagentoRecurringProfiles.php
To add a export button to Magento Recurring Profiles edit this file: /app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php
View addExportButtonMagentoRecurringProfiles.php
<?php
// ADD THIS CODE
/**
* Export order grid to CSV format
*/
public function exportCsvAction()
{
$fileName = 'subscriptions.csv';
View Get-OrderIncrementID-recurring-profiles-success-page.php
<?php
$order = Mage::getResourceModel('sales/order_collection')
->addFieldToFilter('customer_id', $customer_id)
->addRecurringProfilesFilter($profile->getProfileId())
->setOrder('entity_id', 'desc')
->getFirstItem();
echo '<pre>';
print_r($order->getData());
echo '</pre>';
View GetLastRecurringOrderID.php
<?php
$last_recurring_profile_id = $_SESSION['checkout']['last_recurring_profile_ids'][0];
$customer_id = Mage::getSingleton('customer/session')->getCustomerId();
$order = Mage::getResourceModel('sales/order_collection')
->addFieldToFilter('customer_id', $customer_id)
->addRecurringProfilesFilter($last_recurring_profile_id)
->setOrder('entity_id', 'desc')
->getFirstItem();
?>
@elisei
elisei / abandon-cart.sql
Created Jan 20, 2017 — forked from tegansnyder/abandon-cart.sql
Abandon Cart example
View abandon-cart.sql
SELECT `main_table`.*,
(main_table.base_subtotal_with_discount*main_table.base_to_global_rate) AS `subtotal`,
`cust_email`.`email`,
`cust_fname`.`value` AS `firstname`,
`cust_lname`.`value` AS `lastname`,
CONCAT_WS(' ', cust_fname.value, cust_lname.value) AS `customer_name`
FROM `sales_flat_quote` AS `main_table`
INNER JOIN `customer_entity` AS `cust_email` ON cust_email.entity_id = main_table.customer_id
INNER JOIN `customer_entity_varchar` AS `cust_fname` ON cust_fname.entity_id = main_table.customer_id
AND cust_fname.attribute_id = 5
@elisei
elisei / email-test.php
Created Jan 20, 2017 — forked from tegansnyder/email-test.php
email testing SMTP outbound relay on Magento
View email-test.php
<?php
/**
* email-tester.php
* A tool to test if the SMTP relay is working
*
* @category Mmm
* @package EmailTester
* @author Tegan Snyder
*
*/
@elisei
elisei / Magento-new-customer-sales-by-month-year.sql
Created Jan 20, 2017 — forked from tegansnyder/Magento-new-customer-sales-by-month-year.sql
Magento - New Customer Sales Averages and Totals by Month and Year - direct sql
View Magento-new-customer-sales-by-month-year.sql
SELECT sub_query.month_ordered,
sub_query.year_ordered,
AVG(sub_query.base_subtotal) AS average_base_subtotal,
AVG(sub_query.discount_amount) AS average_discount_amt,
AVG(sub_query.order_qty) AS average_total_item_count,
COUNT(sub_query.entity_id) AS total_orders
FROM
(SELECT so.entity_id,
MONTH(so.created_at) AS month_ordered,
YEAR(so.created_at) AS year_ordered,
You can’t perform that action at this time.