Сборка материалов по Opencart

Базовый модуль для админки

Открыть

    
//скачать по ссылке

https://retter241.by/assets/FilesDynamic/BaseModuleAdminStructure.zip
    

Отличная надстройка над opencart api ( тестил на 3x )

Открыть

    
https://github.com/iSenseLabs/OpenCartAPI


https://retter241.by/assets/FilesDynamic/opencartApi.zip
    

Автозаполнение seourl OC-3 в админке (js)

Открыть

    

var ru2en = {
    ru_str: 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя(),.; "+/*?!@',
    en_str: ['a', 'b', 'v', 'g', 'd', 'e', 'jo', 'zh', 'z', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f',
        'h', 'c', 'ch', 'sh', 'shh', '', 'i', '', 'je', 'ju', 'ja',
        'a', 'b', 'v', 'g', 'd', 'e', 'jo', 'zh', 'z', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f',
        'h', 'c', 'ch', 'sh', 'shh', '', 'i', '', 'je', 'ju', 'ja',
        '', '', '', '', '', '-', '', '', '', '', '', '', ''],
    translit: function (org_str) {

        var tmp_str = "";
        for (var i = 0, l = org_str.length; i < l; i++) {
            var s = org_str.charAt(i), n = this.ru_str.indexOf(s);
            if (n >= 0) {
                tmp_str += this.en_str[n];
            }
            else {
                tmp_str += s;
            }
        }
        return tmp_str.toLowerCase();
    }
};

function TranslitCustom(old_input, old_value, new_input, new_value, rewritemode = true) {
    //console.log(new_value, rewritemode);
    if (new_value != undefined) {
        //console.log('clear');
        new_input.val(ru2en.translit(old_value));
    }
}

$(document).ready(function () {

    //product
    var old_input = $('input[name="product_description[3][name]"]');//исходное поле
    var old_value = $('input[name="product_description[3][name]"]').val(); //исходное значение
    var new_input = $('input[name="product_seo_url[0][3]"]');// новое поле
    var new_value = $('input[name="product_seo_url[0][3]"]').val();//новое значение


    //category

    var cat_input = $('input[name="category_description[3][name]"]');//исходное поле
    var cat_value = $('input[name="category_description[3][name]"]').val(); //исходное значение


    if (new_value == ''){
        TranslitCustom(old_input, old_value, new_input, new_value);
        TranslitCustom(cat_input, cat_value, new_input, new_value);
    }
    else {
        old_input.keypress(function (e) {
            //console.log($(this).val());
            TranslitCustom(old_input, old_value, new_input, new_value);
            TranslitCustom(cat_input, cat_value, new_input, new_value);
        });

    }



});

Канонические ссылки для пагинации категории - OC 2.x

Открыть

    
//catalog/controller/product/category.php

// http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html

if ($page == 1) {
	$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'], 'SSL'), 'canonical');
} elseif ($page == 2) {
	$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'], 'SSL'), 'canonical');
	$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'], 'SSL'), 'prev');				
} else {
	$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'], 'SSL'), 'canonical');
	$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page - 1), 'SSL'), 'prev');				
}

if ($limit && ceil($product_total / $limit) > $page) {
    $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1), 'SSL'), 'next');
}

///

if (isset($this->request->get['limit'])) { 
    $this->document->setTitle('new title');
    $this->document->setDescription('new description');
}

    
Тэги:

Комментарии (1)

retter241

TRUNCATE TABLE oc_product;
TRUNCATE TABLE oc_product_attribute;
TRUNCATE TABLE oc_product_description;
TRUNCATE TABLE oc_product_discount;
TRUNCATE TABLE oc_product_image;
TRUNCATE TABLE oc_product_option;
TRUNCATE TABLE oc_product_option_value;
TRUNCATE TABLE oc_product_related;
TRUNCATE TABLE oc_product_related;
TRUNCATE TABLE oc_product_reward;
TRUNCATE TABLE oc_product_special;
TRUNCATE TABLE oc_product_to_category;
TRUNCATE TABLE oc_product_to_download;
TRUNCATE TABLE oc_product_to_layout;
TRUNCATE TABLE oc_product_to_store;
TRUNCATE TABLE oc_review;
DELETE FROM oc_url_alias WHERE query LIKE 'product_id=%';


Оставить комментарий

Success/Error Message Goes Here

TOP