Issue: Prestashop block newsletter

Standard

Prestashop Error: lang file is missing

I had this problem, maybe by using own Theme. The language file is missing in prestashop by sending register for newsletter. The confirmation e-mail can’t sent out to costumer.

Solution: Put in every following paths your lang.php file. In this example for english language

– /mails/en/lang.php
– //mails/en/lang.php
– /modules/blocknewsletter/mails/en/lang.php
– /themes//modules/blocknewsletter/mails/en/lang.php

Prestashop – Produkt in dieser Ausführung nicht verfügbar. Bitte wählen Sie eine andere Kombination

Standard

Produkt in dieser Ausführung nicht verfügbar. Bitte wählen Sie eine andere Kombination.

Um diese Warnmeldung zu Umgehen die folgenden Schritte befolgen:

  • Ordner: /themes/default-bootstrap/js/product.js
  • Datei: product.js
  • Behebung: folgende Zeilen auskommentieren
  • Zeile: 507 – 510
  • alter Code:

    //this combination doesn't exist (not created in back office)
    selectedCombination['unavailable'] = true;
    if (typeof(selectedCombination['available_date']) !== 'undefined')
    delete selectedCombination['available_date'];

    updateDisplay();

  • neuer Code:

    //this combination doesn't exist (not created in back office)
    /*selectedCombination['unavailable'] = true;
    if (typeof(selectedCombination['available_date']) !== 'undefined')
    delete selectedCombination['available_date'];*/

    updateDisplay();

  • Ergebnis: Keine Warnmeldungen mehr – diese Variante nicht verfügbar.

JQuery OWL Carousel Responsive

Standard

Good Morning,

here the working code for owl carousel responsive and checked. Also you need the free css and js file from owl. Get it at GitHub:
https://github.com/OwlCarousel2/OwlCarousel2/tree/develop/dist

Download following files:
– dist/owl.carousel.min.js
– dist/assets/owl.carousel.min.css

>>>HTML
div class : owl-carousel
my Image Link
my Image Link
my Image Link
my Image Link
my Image Link
my Image Link
my Image Link
div

>>>JAVASCRIPT
$(document).ready(function() {
var owl = $(‚.owl-carousel‘).owlCarousel({
itemsCustom : [
[0, 2],
[450, 3],
[680, 4],
[900, 5],
[1000, 6],
[1200, 7],
[1400, 8],
[1650, 10]
],
autoPlay : 5000,
stopOnHover : true,
navigation : true,
navigationText : [„<",">„],
loop:true,
center: true,
autoplay:true,
autoplayTimeout:1000,
autoplayHoverPause:true
})
});

Prestashop CSV Import

Standard

Important points for a right csv import in Prestashop are:

1. category import
2. article import
3. attributes import

Import category by csv file:

– important is to use category id´s
– very important is to use category parent id´s for a best structure
– you can import category by name or id
– don´t use special characters by csv import in category name

Import article by csv file:

– important is to use article id´s
– very important is to name categories where is the article in
– you can use category id or category name
– don´t use special characters in article name
– you can use html tags in description, with enabling the csv import option utf-8

Import attributes by csv file:

– use article id´s for get the right article
– the order of attribute names and attribute value is not important
– only specify order like :0,…:1,…:2 equal in both columns (attribute name, attribute value)
– you can´t use range controller for attributes, only for price and weight

… range controller coming soon by me 😉

Prestashop AdminTab add Module

Standard

The easiest way is the best way. Don`t forget your skills like developer and keep line in your object programing know how. So you can integrate your prestashop module into the prestashop backend menue bar on left site.

After some tries and looking in blogs, here your simpliest solution:

1
2
3 include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); //get prestashop admintab class
4 include_once(PS_ADMIN_DIR.'/../modules/produkt/produkt.php'); //get your module class
5
6 class AdminProdukt extends AdminTab //extend the admintab and put in in the folder /admin/tabs/AdminProdukt.php
7 {
8
9 private $asp=NULL; //safety first
10
11 public function __construct()
12 {
13 $this->asp = new Produkt(); //your module class
14 parent::__construct(); //call AdminTab parent constructor
15 }
16
17 public function display()
18 {
19 echo $this->asp->getContent(); //best way to get function of your module class
20}
21}

XDebug Eclipse Mars PHP

Standard

How remote debugging with xdebug and eclipse mars web application, php files?

1. Download xampp with apache and mysql

2. Configure php.ini like following:

     [XDebug]
     xdebug.remote_enable=true
     xdebug.remote_host=127.0.0.1
     xdebug.remote_port=9000

3. Restart Webservice (xampp)

4. Goto xdebug page and copy your source code in the text area and follow given steps:
     https://xdebug.org/wizard.php

5. Open Eclipse Mars

6. Goto Register Run -> Debug Configurations

     a. Create new PHP Web Application

     b. Register Server -> Default PHP Web Server -> File -> your PHP Project

     c. Debugger -> Configure -> Debugger -> XDebug -> Port 9000

7. Open Google Chrome Browser Install Free XDebug Addon for Google Chrome

Now you can see a Bug Icon on top-right corner like picture:

xdebug_chrome

8. Enable XDebug via Icon

9. Goto Eclipse set breakpoints on left border via double click and start debugging step by step:

2016-05-31 09_06_53-PHP - dev_presta_index.php - Eclipse

10. Have fun with debugging and coding!

Other second Server: Start Remote PHP SQL Query

Standard

Hallo Friends,

for me the simplest solution for this issue / problem is using PHP function file_get_contents()

To prevent a lot of problem create a file on the server with mysql database. Write some select, insert or update queries in normal mysqli->connect then mysqli->query(„SELECT * FROM testtab WHERE testcol = ‚yours'“) or mysqli->query(„INSERT INTO testtab…). Print out the query with print_r() or echo.

Create a new file on other server where you like print out the queries. Use the PHP function file_get_contents(‚the path of the query file‘) and get the string of all print_r() or echos from the query file into your new file. Maybe your need also the PHP functions utf8_decode() and utf8_encode() for special characters 😉

That’s all!

 

Smarty Templates Example

Standard

Hello Friends,

i need some content in my blog, so here a easy example for smarty templates using. Before you start with smarty templates please visit the homepage of smarty to learn something about the smarty framework / engine:   http://www.smarty.net/

<code><HTML>

<div class=“onediv“>{$myvariable}</div>
<div class=“anotherdiv“>
{if $choose eq ‚first‘}
<div class=“insidedivone“>Hello</div>
{elseif $choose eq ’second‘}
<div class=“insidedivtwo“>How are you?</div>
{else}
<div class=“insidedivthree“>No</div>
{\if}
</div>

</HTML><PHP>

$myvariable = ‚A simple short example for smarty engine‘,
$choose = ‚first‘;

</PHP></code>

This is how smarty easily works!