Skocz do zawartości

Wyszukaj

Wyświetlanie wyników dla tagów 'duplikacja' .



Więcej opcji wyszukiwania

  • Wyszukaj za pomocą tagów

    Wpisz tagi, oddzielając je przecinkami.
  • Wyszukaj za pomocą nazwy autora

Typ zawartości


Forum

  • PrestaShop
    • Ogólna dyskusja
    • NOWY PrestaShop 1.7
    • Dla początkujących
    • Instalacja i aktualizacja
    • Moduły
    • Szablony i wygląd
    • Błędy i bezpieczeństwo
    • SEO i optymalizacja
    • Baza wiedzy
  • Webmastering
    • Ogólna dyskusja
    • Programowanie i grafika
    • Gotowe sklepy lub projekty
    • Zlecenia i oferty
  • O Forum
    • Off-topic
    • Feedback

Grupa podstawowa


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Znaleziono 2 wyniki

  1. Duplikat modułu

    Witam serdecznie. Zduplikowałem moduł odpowiedzialny za wybieranie przy zamówieniu czy klient chce paragon i fakturę. Chciałem go zduplikować jako osobny moduł aby dodać jeszcze opcję wyboru Wniosku NFZ. Co zrobiłem aby zduplikować moduł: - Dodałem "2" do nazwy folderu oraz wszystkich plików które znajdują się w katalogu modułu (nie wliczając katalogów). - Wyedytowałem odpowiednio wszystkie pliki zduplikowanego stylu np. główny plik php: <?php if (!defined('_PS_VERSION_')) exit; class twParagonFaktura2 extends Module { const _PARAGON_FAKTURA2_ = 'tw_paragonfaktura2'; public static $documentType2 = array(); public function __construct() { $this->name = 'twparagonfaktura2'; $this->tab = 'billing_invoicing'; // front_office_features'; // $this->version = '1.0'; $this->author = 'Tomek Witek'; $this->need_instance = 0; $this->bootstrap = true; parent::__construct(); self::$documentType = array('Yes' => $this->l('Yes'), 'No' => $this->l('No') ); $this->displayName = $this->l('Receipt or invoice?'); $this->description = $this->l('The module allows you to choose the type of document confirming the purchase of goods (receipt or invoice)'); $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); } // ------------------------------------------------------------------------------------------------- __construct() public function addOverride($classname) { if ( version_compare(_PS_VERSION_, '1.6.1.0', '<') ) { return parent::addOverride($classname); } else { return true; } } // ------------------------------------------------------------------------------------------------- addOverride() public function install() { reset(self::$documentType); $sql = 'CREATE TABLE IF NOT EXISTS`'._DB_PREFIX_.self::_PARAGON_FAKTURA2_.'` ( `id_cart` int(11) NOT NULL, `document_type` ENUM(\''.implode("','", array_keys(self::$documentType) ).'\') NOT NULL DEFAULT \''.key(self::$documentType).'\', PRIMARY KEY(`id_cart`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=UTF8;'; return( parent::install() && $this->registerHook('displayShoppingCartFooter') && $this->registerHook('displayReceiptInvoiceExtra') && $this->registerHook('displayOrderDetail') && $this->registerHook('displayAdminOrder') && $this->registerHook('displayAdminOrderExtra') && $this->registerHook('actionGetExtraMailTemplateVars') && Configuration::updateValue('TW_PARAGON_FAKTURA2', key(self::$documentType)) && Db::getInstance()->execute($sql) ); } // ------------------------------------------------------------------------------------------------- install() public function removeOverride($classname) { if ( version_compare(_PS_VERSION_, '1.6.1.0', '<') ) { return parent::removeOverride($classname); } else { return true; } } // ------------------------------------------------------------------------------------------------- removeOverride() public function uninstall() { $sql = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.self::_PARAGON_FAKTURA2_.'`;'; return( parent::uninstall() && $this->unregisterHook('displayShoppingCartFooter') && $this->unregisterHook('displayReceiptInvoiceExtra') && $this->unregisterHook('displayOrderDetail') && $this->unregisterHook('displayAdminOrder') && $this->unregisterHook('displayAdminOrderExtra') && $this->unregisterHook('actionGetExtraMailTemplateVars') && Configuration::deleteByName('TW_PARAGON_FAKTURA2') && Db::getInstance()->execute($sql) ); } // ------------------------------------------------------------------------------------------------- uninstall() public function getContent() { if (Tools::isSubmit('submitSaveConfiguration')) { Configuration::updateValue('TW_PARAGON_FAKTURA2', Tools::getValue('TW_PARAGON_FAKTURA2')); } return $this->renderConfigForm(); } // ------------------------------------------------------------------------------------------------- getContent() public function renderConfigForm() { $fields_form = array( 'form' => array( 'legend' => array( 'title' => $this->l('Configuration'), 'icon' => 'icon-cogs' ), 'input' => array( array( 'type' => 'select', 'label' => $this->l('Default document'), 'name' => 'TW_PARAGON_FAKTURA2', 'desc' => $this->l('Set the default document confirming the purchase of goods'), 'options' => array( 'query' => $this->getDocumentTypes(), 'id' => 'id_option', 'name' => 'name' ), ), ), 'submit' => array( 'title' => $this->l('Save'), ) ), ); $helper = new HelperForm(); $helper->show_toolbar = false; $helper->table = $this->name; $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); $helper->default_form_language = $lang->id; $helper->module = $this; $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; $helper->identifier = $this->identifier; $helper->submit_action = 'submitSaveConfiguration'; $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->tpl_vars = array( 'fields_value' => array( 'TW_PARAGON_FAKTURA2' => Tools::getValue('TW_PARAGON_FAKTURA2', Configuration::get('TW_PARAGON_FAKTURA2')), ), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id ); return $helper->generateForm(array($fields_form)); } // --------------------------------------------------------------------------------------------------------- _renderConfigForm() public function getDocumentTypes() { $options = array(); foreach( self::$documentType as $docType => $docName ) { $options[] = array( 'id_option' => $docType, 'name' => $docName ); } return $options; } // --------------------------------------------------------------------------------------------------------- getDocumentTypes() public function getCurrentDocumentType($id_cart) { $sql = 'SELECT `document_type` FROM `'._DB_PREFIX_.self::_PARAGON_FAKTURA2_.'` WHERE `id_cart`='.$id_cart.';'; $currentDocument = Db::getInstance()->getValue($sql); return ( array_key_exists($currentDocument, self::$documentType) ? $currentDocument : 'unknow' ); } // --------------------------------------------------------------------------------------------------------- getCurrentDocumentType() public function getCurrentDocumentName($currentDocument, $unknow = 'unknow' ) { return ( array_key_exists($currentDocument, self::$documentType) ? self::$documentType[$currentDocument] : $unknow ); } // --------------------------------------------------------------------------------------------------------- getCurrentDocumentName() public function _prepareHook() { $this->context->controller->addCSS(($this->_path).'views/css/twparagonfaktura2.css', 'all'); $this->context->controller->addJS(($this->_path).'views/js/twparagonfaktura2.js'); // --------------------------- dodaje rekord jezeli nie istnieje (z domyslnym typem dokumentu - klient nie wybral rodzaju dokumentu) // --------------------------- dla danego koszyka (id_cart) zostanie wykonane tylko JEDEN RAZ! $sql = 'INSERT IGNORE INTO `'._DB_PREFIX_.self::_PARAGON_FAKTURA2_.'` (`id_cart`, `document_type`) VALUES ('.$this->context->cart->id.', "'.Configuration::get('TW_PARAGON_FAKTURA2').'" )'; Db::getInstance()->execute($sql); // --------------------------- odczytuje biezacy typ dokumentu, typ dokumentu moze byc inny niz po dodaniu rekordu // --------------------------- np po ponownym wejscu do koszyka - klient wczesniej zmienil typ dokumentu, // --------------------------- zobacz paragonfaktuta2.js, ajax2.php $currentDocument = $this->getCurrentDocumentType($this->context->cart->id); $this->smarty->assign(array( 'documentType' => self::$documentType, 'currentDocument' => $currentDocument, 'id_cart' => $this->context->cart->id, )); } // --------------------------------------------------------------------------------------------------------- _prepareHook() public function hookdisplayReceiptInvoiceExtra($params) { $this->_prepareHook(); return $this->display(__FILE__, 'views/templates/hook/paragonfaktura2.tpl'); } // --------------------------------------------------------------------------------------------------------- hookdisplayReceiptInvoiceExtra() public function hookDisplayShoppingCartFooter($params){ $this->_prepareHook(); return $this->display(__FILE__, 'views/templates/hook/paragonfaktura2.tpl'); } // --------------------------------------------------------------------------------------------------------- hookDisplayShoppingCartFooter() public function hookDisplayOrderDetail($params) { $currentDocument = $this->getCurrentDocumentType($params['order']->id_cart); if ($currentDocument == 'unknow') return false; $this->smarty->assign(array( 'currentDocument' => $currentDocument, 'currentDocumentTranslate' => $this->getCurrentDocumentName($currentDocument), )); return $this->display(__FILE__, 'views/templates/hook/order_detail2.tpl'); } // --------------------------------------------------------------------------------------------------------- hookDisplayOrderDetail() public function _prepareAdminHook() { $currentDocument = $this->getCurrentDocumentType($this->context->cart->id); $this->smarty->assign(array( 'currentDocument' => $currentDocument, 'currentDocumentTranslate' => $this->getCurrentDocumentName($currentDocument), )); } // --------------------------------------------------------------------------------------------------------- _prepareAdminHook() public function hookDisplayAdminOrder($params) { $this->_prepareAdminHook(); return $this->display(__FILE__, 'views/templates/admin/admin_orders2.tpl'); } // ---------------------------------------------------------------------------------------------------------- hookDisplayAdminOrder() public function hookDisplayAdminOrderExtra($params) { $this->_prepareAdminHook(); return $this->display(__FILE__, 'views/templates/admin/admin_orders2.tpl'); } // ---------------------------------------------------------------------------------------------------------- hookDisplayAdminOrderExtra() public function hookActionGetExtraMailTemplateVars($params) { if ($params['template'] == 'order_conf' || $params['template'] == 'new_order') { $currentDocument = $this->getCurrentDocumentType($this->context->cart->id); $params['extra_template_vars']['{receipt_invoice}'] = $this->getCurrentDocumentName($currentDocument, ''); } } // ---------------------------------------------------------------------------------------------------------- hookActionGetExtraMailTemplateVars() } Wszytko na pierwszy rzut oka powinno działać jednak gdy wybieram przy zamówieniu 1 pole (Paragon czy Faktura) to pod zarówno 1 jak i 2 polem na raz wyświetlają się błędy o uaktualnieniu i błędzie co skutkuje tym że 2 pole nie zmienia się po zakończeniu zamówienia (pozostaje domyslne - takie jakie jest ustawione w opcjach modułu) W bazie danych SQL tak samo widnieje tylko opcja domyślna, nie zmieniona. Gdzie robię błąd ? twparagonfaktura2.zip
  2. Witam. W ostatnim czasie site naszej witryny (lampa-lampy.pl) zwiększył się prawie dwukrotnie poprzez zaindeksowanie w wynikach google m.in. wyniki sortowań po różnych parametrach, porzuconych koszyków zakupów itp., pomimo tego że są one blokowane w robots.txt. Wyświetlają się one w wynikach wyszukiwania z opisem: ?wyświetlanie zablokowane w pliku robots.txt?. Czy zna ktoś sposób na niewyświetlanie tych wyników? Znalazłem jedną radę, ale kompletnie nie wiem gdzie mam dokonać takich zmian ? ?blokowanie stron poprzez znacznik metatag robots. Aby tego dokonać, należy nadpisać kontroler search i przekazać w nim do szablonu Smarty zmienną nobots ustawioną na TRUE. W tym przypadku należy pamiętać o usunięciu pliku cache/class_index.php? Drugi problem to duplikowanie metatytułów i metaopisów kategorii oraz producentów. Dla uniknięcia powielania treści na podstronach kategorii zastosowałem zmianę, która powoduje wyświetlanie opisu danej kategorii tylko na jej pierwszej stronie, kolejne są bez opisu. Jednak opisy ?meta? są wszędzie identyczne i kolejne strony danej kategorii są zaindeksowane z powielanymi metatytułami i metaopisami. Czy można w jakiś sposób dopisać na przykład na ich początku odpowiednio ?strona1? , ?strona2? itd., tak żeby były zróżnicowane?
×