Skip to content

Instantly share code, notes, and snippets.

@gartes
gartes / document.addEventListener
Created September 2, 2018 20:41
DOMContentLoaded
document.addEventListener("DOMContentLoaded", function(){
var $=jQuery ;
});
@gartes
gartes / load.php
Last active August 18, 2018 01:38
Первый символ в верхний регистр
$str = ucfirst( $str ) ;
// ============
/**
* Для керилицы
*/
static function mb_ucasefirst($str)
{
$str[0] = mb_strtoupper($str[0]);
return $str;
}#END FUNCTION
@gartes
gartes / view.html.php
Created August 15, 2018 02:46
VmModel-paymentmethod
// Получить параметры способа оплаты
$paymentmethodModel = VmModel::getModel('paymentmethod');
$paymentmethodData = $paymentmethodModel->getPayment($this->cart->virtuemart_paymentmethod_id) ;
if( isset ( $paymentmethodData->cost_percent_total ) ){
$DATA->SUBTOTAL->PAYMENT_PARAM_DISCOUNT = $paymentmethodData->cost_percent_total ;
}else{
$DATA->SUBTOTAL->PAYMENT_PARAM_DISCOUNT = false ;
}
@gartes
gartes / popup.js
Last active August 7, 2018 16:18
chrome.tabs
// chrome.tabs.onUpdated
// Добавить слушателя события загрузки владки браузера
// info :{
// status : "loading" || "complete" ,
// favIconUrl : - is favIcon Url ( string ) ,
// title : is - title txt ( string ) ,
// }
chrome.tabs.onUpdated.addListener(function (tabId , info) {
console.log (info ) ;
if (info.status === 'complete') {
@gartes
gartes / Events
Last active July 31, 2018 23:31
vm:helper:Cart
plgVmConfirmedOrder ( $cart , $orderDetails ) // После создания заказа
@gartes
gartes / JRoute::_()
Last active November 12, 2019 23:19
JRoute::_()
<?php
echo JRoute::_('index.php?option=com_virtuemart&view=orders&layout=list' );
@gartes
gartes / plg_system
Created July 30, 2018 20:51
fancybox
function onBeforeCompileHead() {
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();
$doc = JFactory::getDocument();
$headData = $doc->getHeadData();
unset ( $headData['styleSheets']['/components/com_virtuemart/assets/css/jquery.fancybox-1.3.4.css?vmver='.VM_JS_VER] );
unset ( $headData['scripts']['/templates/gk_storefront/js/fancybox/jquery.fancybox-1.3.4.pack.js?vmver='.VM_JS_VER] );
$doc->setHeadData($headData);
if (!class_exists( 'VmConfig' )) require(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();
@gartes
gartes / VirtueMartCart
Created July 28, 2018 18:34
VirtueMart
if(!class_exists('VirtueMartCart')) require(VMPATH_SITE.DS.'helpers'.DS.'cart.php');
$cart = VirtueMartCart::getCart();
@gartes
gartes / JUser
Last active July 30, 2018 10:56
JUser
$user = JFactory::getUser($uid) ;
// Авторизация пользователя
$user = JUser::getInstance( $uid );