Skip to content

Instantly share code, notes, and snippets.

@benytocarlo
benytocarlo / detalle_productos_prestashop.sql
Last active October 17, 2016 12:15
Productos activados en Prestashop
SELECT
p.id_product AS ID,
p.reference AS REFERENCIA,
pl.name AS NOMBRE ,
pm.name AS FABRICANTE,
p.price AS PRECIO ,
pl.link_rewrite as LINK,
pa.reference,
pa.upc,
pa.price,
@benytocarlo
benytocarlo / getallcombinations.sql
Created February 19, 2016 12:17
get all combinations prestashop
SELECT
p.id_product,
pa.reference,
pa.upc,
pa.price,
pai.id_image,
pl.name,
GROUP_CONCAT(DISTINCT(pal.name) SEPARATOR ", ") as combination,
pq.quantity
FROM ps_product p
@benytocarlo
benytocarlo / imagenes_productos_magento.sql
Created August 4, 2015 19:00
Imagenes de Productos Magento
SELECT *
FROM `catalog_product_entity` AS a
INNER JOIN `eav_attribute` AS `attribute` ON `attribute`.attribute_code = 'image'
AND `attribute`.frontend_input = 'media_image'
LEFT JOIN `catalog_product_entity_varchar` AS b ON a.entity_id = b.entity_id
AND b.attribute_id = attribute.attribute_id
WHERE `type_id` = 'simple' AND (b.value = ''
OR b.value IS NOT NULL
OR b.value != 'no_selection')
@benytocarlo
benytocarlo / carros_abondanados
Last active August 29, 2015 14:24
Carros abandonados Magento
SELECT `main_table`.*, GROUP_CONCAT(item.sku) AS `skus`, (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 `sales_flat_quote_item` AS `item` ON item.quote_id = main_table.entity_id
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
INNER JOIN `customer_entity_varchar` AS `cust_lname` ON cust_lname.entity_id = main_table.customer_id AND cust_lname.attribute_id = 7 WHERE (items_count != '0') AND (main_table.is_active = '1') GROUP BY `item`.`quote_id` ORDER BY updated_at DESC
// Agrupado por fecha
SELECT `main_table`.*, (main_table.base_subtotal_with_discount*main_table.base_to_
@benytocarlo
benytocarlo / robots.txt
Created June 25, 2015 20:10
Robots.txt for Magento
User-agent: *
Disallow: /index.php/
Disallow: /*?
Disallow: /*.js$
Disallow: /*.css$
Disallow: /customer/
Disallow: /checkout/
Disallow: /js/
Disallow: /lib/
Disallow: /media/
@benytocarlo
benytocarlo / gist:9a8182bd616c8472362e
Created June 23, 2015 18:19
Listado de Usuarios en magento
SELECT DISTINCT ce.entity_id AS b, email, 'default_password', (
SELECT value
FROM customer_entity_varchar
WHERE attribute_id =7
AND customer_entity_varchar.entity_id = b
) AS l_name, (
SELECT value
FROM customer_entity_varchar
module BootstrapPaginationHelper
class LinkRenderer < WillPaginate::ActionView::LinkRenderer
protected
def page_number(page)
unless page == current_page
link(page, page, :rel => rel_value(page))
else
link(page, "#", :class => 'active')
end
@benytocarlo
benytocarlo / .htaccess
Last active August 29, 2015 14:05
seguridad htaccess
#activar charset utf8 cuando servidor no lo reconoce
AddDefaultCharset UTF-8
#Ocultar Listado Directorios
Options All -Indexes
#Hotlink
#RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
@benytocarlo
benytocarlo / server_route.php
Created July 4, 2014 15:00
Ruta absoluta del servidor
<?php
echo dirname(__FILE__);
?>
@benytocarlo
benytocarlo / mediamath.html
Created June 23, 2014 15:26
Tag event con MediaMath
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>