Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Add Custom field invoice</name>
<code>valdeir_custom_field_invoice</code>
<version>1.5</version>
<author>Valdeir Santana</author>
<link>http://www.valdeirsantana.com.br</link>
<file path="catalog/view/theme/*/template/checkout/payment_address.tpl,catalog/view/theme/*/template/checkout/shipping_address.tpl">
<operation error="skip">
@valdeir2000
valdeir2000 / installer.php
Last active December 21, 2015 19:31
Correção do bug "Method not implemented" ao tentar instalar uma extensão. Substitua o arquivo admin/controller/extension/installer.php
<?php
class ControllerExtensionInstaller extends Controller {
private $error = array();
public function index() {
$this->load->language('extension/installer');
$this->document->setTitle($this->language->get('heading_title'));
@valdeir2000
valdeir2000 / api_permission.ocmod.xml
Last active July 18, 2018 20:37
Require vqmod; Search for "My-IP" and replace the temporary url or site IP.
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>API Permission</name>
<code>valdeir_api_permission</code>
<version>1.1</version>
<author>Valdeir Santana</author>
<link>http://www.valdeirsantana.com.br</link>
<file path="admin/controller/sale/order.php">
<operation>
<search>
DROP TABLE `Database`.`oc_address`;
DROP TABLE `Database`.`oc_affiliate`;
DROP TABLE `Database`.`oc_affiliate_activity`;
DROP TABLE `Database`.`oc_affiliate_login`;
DROP TABLE `Database`.`oc_affiliate_transaction`;
DROP TABLE `Database`.`oc_ajax_product_option`;
DROP TABLE `Database`.`oc_api`;
DROP TABLE `Database`.`oc_api_ip`;
DROP TABLE `Database`.`oc_api_session`;
DROP TABLE `Database`.`oc_attribute`;
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Categories Page Product</name>
<code>valdeir_categories</code>
<version>1.0</version>
<author>Valdeir Santana</author>
<link>https://www.valdeirsantana.com.br</link>
<file path="admin/controller/catalog/product.php">
<operation>
<search>
@valdeir2000
valdeir2000 / currency.php
Created November 10, 2016 15:34
Update Currency - OpenCart
<?php
class ControllerLocalisationCurrency extends Controller
{
public function index()
{
$data = array();
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "currency WHERE code != '" . $this->db->escape($this->config->get('config_currency')) . "'");
@valdeir2000
valdeir2000 / index.html
Last active February 10, 2018 20:00
StackOverflow - #275596
<!DOCTYPE hml>
<html>
<head>
<title>Title of the document</title>
<style>
* {margin:0;padding:0}
#img {margin:0 auto;height:auto;overflow:hidden;position:relative;width:350px;}
#img #main {left:0;position:relative;top:0;width:350px;}
#img #arrow {left:0;position:absolute;top:0;}
#area {background:red;height:50px;width:50px;left:0;position:relative;top:0;z-index:1}
@valdeir2000
valdeir2000 / index.php
Last active February 20, 2023 19:10
StackOverflow #277329
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
<?php
$content = file_get_contents("https://www.infomoney.com.br/mercados/cambio");
$dom = new domDocument();
@$dom->loadHTML($content);
$xpath = new DOMXpath($dom);
@valdeir2000
valdeir2000 / postman_collection.json
Created February 24, 2018 05:41
StackOverflow #278576
{
"info": {
"name": "StackOverflow #278574",
"_postman_id": "9d080934-2035-0e69-6145-b0b679eb03a4",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "\"Pede\" Autorização",
@valdeir2000
valdeir2000 / gump_validator_class.php
Created March 4, 2018 09:14
Validação para o GUMP
<?php
/**
* Código responsável pela validação de CPF e data de nascimento para o GUMP (https://github.com/Wixel/GUMP)
* @author: Valdeir Psr
*/
require_once "vendor/autoload.php";
class ValidatorPsr extends GUMP {