This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function total_weight() | |
{ | |
$result = $this->om('weight')*$this->quantity; | |
$extras = $this->get_extra_option_objects(); | |
foreach ($extras as $option) | |
$result += $option->weight*$this->quantity; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE VIEW fiftydigital_quotes AS | |
SELECT DISTINCT concat(cart_name, '_', customer_id) as 'id', cart_name, customer_id | |
FROM shop_customer_cart_items | |
WHERE cart_name != 'main' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyModule_Module extends Core_ModuleBase | |
{ | |
protected function createModuleInfo() | |
{ | |
return new Core_ModuleInfo( | |
'MyModule', | |
'Whatever...', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -avz /path/to/files/public_html/ username@server:/path/to/files/public_html/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT billing_first_name, billing_last_name, billing_email, shop_countries.name as 'country' | |
FROM shop_orders | |
LEFT JOIN shop_countries | |
ON shop_countries.id = shop_orders.billing_country_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class My_Module extends Core_ModuleBase | |
{ | |
public function subscribeEvents() | |
{ | |
Backend::$events->addEvent('shop:onExtendCustomerModel', $this, 'extend_customer_model'); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_save_path('/path/to/writable/directory/inside/your/account'); | |
ini_set('session.gc_maxlifetime', 3*60*60); // 3 hours | |
ini_set('session.gc_probability', 1); | |
ini_set('session.gc_divisor', 100); | |
ini_set('session.cookie_secure', FALSE); | |
ini_set('session.use_only_cookies', TRUE); | |
session_start(); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"head":{ | |
"udid": "UDIDBYJAMES", | |
"api_key": "test123", | |
"api_token": "test123" | |
}, | |
"body":{ | |
"order_id": "20300", | |
"transaction_id": "PAY-69X87306BF709670NKUABN4Q" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function process_paypal_ipn($params) | |
{ | |
try | |
{ | |
$order = null; | |
/* | |
* Find order and load paypal settings | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE transactions | |
SET DateTime = CAST(CONCAT(STR_TO_DATE(Date,'%d/%m/%Y'), ' ', Time) AS DateTime) |
NewerOlder