HELP & FAQ
Solutions: Prestashop, Odoo, Javascript, Angular, Smarty, PHP, SQL, Ubuntu
Do you need help? Write us an email to: support(at)profistart.com
Do you need help? Write us an email to: support(at)profistart.com
Go to following directory:
/modules/ps_facetedsearch/src/Filters/
Open php file:
Block.php
At Line 681 in the sql query change following column
agl.name to agl.public_name
At least login into administration choose faceted search module and click on clear cache on top.
First of all you need following two files: /modules/blocklayered/blocklayered.php and /classes/Tools.php
Put between if and else in blocklayered.php (Line ~2020):
if (version_compare(_PS_VERSION_, '1.6.1', '>=') === true){
$this->products = Db::getInstance()->executeS('
SELECT DISTINCT
p.*,
'.($alias_where == 'p' ? '' : 'product_shop.*,' ).'
'.$alias_where.'.id_category_default,
pl.*,
image_shop.`id_image` id_image,
il.legend,
m.name manufacturer_name,
'.(Combination::isFeatureActive() ? 'product_attribute_shop.id_product_attribute id_product_attribute,' : '').'
DATEDIFF('.$alias_where.'.`date_add`, DATE_SUB("'.date('Y-m-d').' 00:00:00", INTERVAL '.(int)$nb_day_new_product.' DAY)) > 0 AS new,
stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity'.(Combination::isFeatureActive() ? ', product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity' : '').'
FROM '._DB_PREFIX_.'cat_filter_restriction cp
LEFT JOIN `'._DB_PREFIX_.'product` p
ON p.`id_product` = cp.`id_product`
'.Shop::addSqlAssociation('product', 'p').
(Combination::isFeatureActive() ?
' LEFT JOIN `'._DB_PREFIX_.'product_attribute_shop` product_attribute_shop
ON (p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop='.(int)$context->shop->id.')':'').'
LEFT JOIN '._DB_PREFIX_.'product_lang pl
ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').' AND pl.id_lang = '.(int)$cookie->id_lang.')
RIGHT JOIN `'._DB_PREFIX_.'category_product` p_cat
ON (p.id_product = p_cat.id_product)
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop
ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.')
LEFT JOIN `'._DB_PREFIX_.'image_lang` il
ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$cookie->id_lang.')
LEFT JOIN '._DB_PREFIX_.'manufacturer m
ON (m.id_manufacturer = p.id_manufacturer)
'.Product::sqlStock('p', 0).'
WHERE '.$alias_where.'.`active` = 1 AND '.$alias_where.'.`visibility` IN ("both", "catalog") AND p_cat.id_category = '.(int)$id_parent.'
ORDER BY
'.Tools::getProductsOrder('by', Tools::getValue('orderby'), true).' '.Tools::getProductsOrder('way', Tools::getValue('orderway')). ' , p.id_product'.
' LIMIT '.(((int)$this->page - 1) * $n.','.$n), true, false);
$this->products += Db::getInstance()->executeS('
SELECT DISTINCT
p.*,
'.($alias_where == 'p' ? '' : 'product_shop.*,' ).'
'.$alias_where.'.id_category_default,
pl.*,
image_shop.`id_image` id_image,
il.legend,
m.name manufacturer_name,
'.(Combination::isFeatureActive() ? 'product_attribute_shop.id_product_attribute id_product_attribute,' : '').'
DATEDIFF('.$alias_where.'.`date_add`, DATE_SUB("'.date('Y-m-d').' 00:00:00", INTERVAL '.(int)$nb_day_new_product.' DAY)) > 0 AS new,
stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity'.(Combination::isFeatureActive() ? ', product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity' : '').'
FROM '._DB_PREFIX_.'cat_filter_restriction cp
LEFT JOIN `'._DB_PREFIX_.'product` p
ON p.`id_product` = cp.`id_product`
'.Shop::addSqlAssociation('product', 'p').
(Combination::isFeatureActive() ?
' LEFT JOIN `'._DB_PREFIX_.'product_attribute_shop` product_attribute_shop
ON (p.`id_product` = product_attribute_shop.`id_product` AND product_attribute_shop.`default_on` = 1 AND product_attribute_shop.id_shop='.(int)$context->shop->id.')':'').'
LEFT JOIN '._DB_PREFIX_.'product_lang pl
ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').' AND pl.id_lang = '.(int)$cookie->id_lang.')
RIGHT JOIN `'._DB_PREFIX_.'category_product` p_cat
ON (p.id_product = p_cat.id_product)
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop
ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.')
LEFT JOIN `'._DB_PREFIX_.'image_lang` il
ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$cookie->id_lang.')
LEFT JOIN '._DB_PREFIX_.'manufacturer m
ON (m.id_manufacturer = p.id_manufacturer)
'.Product::sqlStock('p', 0).'
WHERE '.$alias_where.'.`active` = 1 AND '.$alias_where.'.`visibility` IN ("both", "catalog") AND p_cat.id_category != '.(int)$id_parent.'
ORDER BY
'.Tools::getProductsOrder('by', Tools::getValue('orderby'), true).' '.Tools::getProductsOrder('way', Tools::getValue('orderway')). ' , p.id_product'.
' LIMIT '.(((int)$this->page - 1) * $n.','.$n), true, false);
}else{
} elseif ($value == 'position' || empty($value)) {
$order_by_prefix = 'p_cat.';
//$order_by_prefix = 'cp.';
}
The merchant expertise module connects to gamification.prestashop.com and often leads to long waiting times in the backend of Prestashop 1.6. Therefore, you can turn off the success indicators in backoffice, to increase the loading speed of your admin area. If you can not log into BackOffice, connect to the Prestashop database, go to the Table ps_module_shop and delete the record gamification module.
Push an array in your php-file into smarty template variable like following example.
<?php
$array = array("profi" => "success", "start" => "solution");
$smarty->assign('smarty_template_array',$php_array);
Open your smarty template and print your php array in smarty template for example to control solution.
{$smarty_template_array|print_r}
Open your browser and type in url of your website.
To show or hide VAT in Prestashop, go to the following Smarty template: /themes/deinTheme/product.tpl (~ Line 300)
{if $priceDisplay >= 0 && $priceDisplay <= 2}
<span id="our_price_display" class="price" itemprop="price" content="{$productPrice}" style="margin-left:-20px">{convertPrice price=$productPrice|floatval}</span>
{if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))}
<!-- {if $priceDisplay == 1} {l s='tax excl.'}{else} {l s='tax incl.'}{/if} -->
{/if}
<meta itemprop="priceCurrency" content="{$currency->iso_code}" />
{hook h="displayProductPriceBlock" product=$product type="price"}
{/if}
Comment out the IF-conditions for excluding VAT or including VAT text, to hide display VAT completely. In the Prestashop Backend, you can set up under Customers > Groups, who can see gross VAT or net VAT
All Prestashop accounts are located in the / pdf / folder as a Smarty Template File (.tpl) in the root directory. The most important templates for your invoices are /invoice.tpl , /invoice-b2b.tpl . These Smarty templates contain Ordering information such as product, number, price, etc. Other important billing templates are /header.tpl and /footer.tpl . As the name already indicates, this is the head and footing area of the invoice, as the logo address etc. of the company are deposited. The smarty template /invoice-addresses-tab.tpl , which is the customer information, is also important for Prestashop PDF invoices and invoices Of the PDF invoice.
Solution: Open the Smarty Template nav.tpl in the module blockuserinfo from Prestashop. To do this, go to the following folder: /themes/yourTheme/modules/blockuserinfo
Solution:
The error occures because the language file is expecting in root/mails, but the language file in prestashop is in /themes/mails/yourlanguage.
Open smarty template in folder /themes/meintheme/product.tpl
In Smarty Template goto line ~ 500
<div class="box-cart-bottom">
<div if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || (isset($restricted_country_mode) && $restricted_country_mode) || $PS_CATALOG_MODE} class="unvisible" /if >
<p id="add_to_cart" class="buttons_bottom_block no-print">
<button type="submit" name="Submit" class="exclusive">
<span> if $content_only && (isset($product->customization_required) && $product->customization_required) l s='Customize' else l s='Add to cart' /if </span>
</button>
</p>
</div>
</div> <!-- end box-cart-bottom -->
In the first div-Tag the shopping cart button is hidden or shown by if-condition. Between if-Tag the shopping cart button is visibile or not with class="unvisible"
Here you can leave the if-condition completely or set a new if-condition for your use in prestashop smarty template product.tpl.
$( document ).ready(function() {
$('.standard-checkout').empty().append(' weiter ');
});
this.add_barcode_patterns(attributes.patterns || {
'product': ['xxxxxxxxxxxxx'],
'cashier': ['041xxxxxxxxxx'],
'client': ['052xxxxxxxxxx'],
'weight': ['31xxxxxNNNDDx'],
'discount': ['25xxxxxxxNNNx'],
'price': ['28xxxxxNNDDDx'],
});
Smarty Template Path: prestashop/themes/yourtheme/product.tpl – Line ~ 220
Inset new span with id:
{*{l s='Availability:'}*} quantity <= 0 && !$allow_oosp} class="warning_inline"{/if}>
{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}
{else}
{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}
{/if}
Javascript Path: prestashop/themes/yourtheme/js/product.js – Line ~ 535
In function findCombination() at the end before calling updateDisplay(), insert following JQuery Code:
//Kombination nicht gefunden
console.log("12. Combination nicht gefunden");
$("#variante_nicht").text("Variante nicht Verfügbar");
$("#variante_nicht").css('display','block');
$('.box-cart-bottom').css('display','none');
updateDisplay();
This position will be called/arrived when no product variation was detected/found from prestashop system. So you can put any code here to display anything when product variation not existing.
If the last quantity warning in prestashop doesn’t disappear, only copy the code lines ~ 595 in the function findCombination() in product.js:
function findCombination() {
if (!allowBuyWhenOutOfStock){
if (quantityAvailable <= maxQuantityToAllowDisplayOfLastQuantityMessage){
no_var_quantity = 0;
}
}
Create a variable no_var_quantity with default value 2. Set no_var_quantity in the end of function findCombination() to value 1:
no_var_quantity = 1;
updateDisplay();
}
How remove Attribute Search in Product Page?
How remove Block Visa Master Payment Logo Picture?
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
Product is not available in this version. Please choose another combination.
To work around this warning message, follow these steps:
//this combination doesn't exist (not created in back office)
selectedCombination['unavailable'] = true;
if (typeof(selectedCombination['available_date']) !== 'undefined')
delete selectedCombination['available_date'];
updateDisplay();
//this combination doesn't exist (not created in back office)
/*
selectedCombination['unavailable'] = true;
if (typeof(selectedCombination['available_date']) !== 'undefined')
delete selectedCombination['available_date'];
*/
updateDisplay();
Error: The reason of your fatal error in prestashop is: Your php5 doesn't support gd. So install like following:
Solution:
Where to find error.log file of apache webserver in Linux Ubuntu?
/var/log/apache2/error.log
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="wl-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: Image link in mysql database ps_image and ps_image_shop
In Prestashop all images are linked in the mysql tables ps_image and ps_image_shop. The images are linked with the product
in with id_image and id_product. In table ps_image_lang you can get name and descriptions of images.
Important points for a right csv import in Prestashop are:
Import category by csv file:
Import article by csv file:
Import attributes by csv file:
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:
//get prestashop admintab class
include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php');
//get your module class
include_once(PS_ADMIN_DIR.'/../modules/produkt/produkt.php');
/*extend the admintab and put in in the folder
/admin/tabs/AdminProdukt.php*/
class AdminProdukt extends AdminTab
{
private $asp=NULL; //safety first
public function __construct()
{
//your module class
$this->asp = new Produkt();
//call AdminTab parent constructor
parent::__construct();
}
public function display()
{
//best way to get function of your module class
echo $this->asp->getContent();
}
}
How remote debugging with xdebug and eclipse mars web application, php files?
[XDebug]
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
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 and mysqli-query
("SELECT * FROM testtab WHERE testcol = 'yours'") or mysqli-query("INSERT INTO testtab...)
Print out the query with print_r() or echo.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/
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>
PHP:
$MYVARIABLE = ‚A SIMPLE SHORT EXAMPLE FOR SMARTY ENGINE‘,
$CHOOSE = ‚FIRST‘;
After I moved the website for a customer based on Joomla 2.5.14 on a 1und1 server, I will not deny you the problem solutions. I have two hours on various help pages and forums looked up, the error when calling the page ...
"The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request."Important information for develop starter: Sending header() information reloads the page because of php functionality - server response and request. If you working with javascript, this is only onpage without communication between server and client. If you need new page and a communication to server, so you need to handle this with php. If you only change content in the same page, you can use javascript - only client site or only server site.
Important is the user authorization, as Backend Services has to handle more and more javascript frontend applications. This all are realized by a token system. The OpenID Connect application is a useful tool. With Angular 2 Routing authorized users are directed to authorized views.
JWT - JSON Web Token is an effective and standardized format according to RFC 7519 to implement a token distribution system.
Javascript Node.js Framework Express is a great tool for file upload, authentication, and log files. Express is a module of Node.js for Routing. In principle, when an Express application is used, certain functions are specified by URL path and HTTP method to generate a response to the client.
How get $scope from other controller in angular.
The simpliest way is every time the best. If you have two or more controller and you like update the scope of one controller with another controller, you need a parent child structure, else you can't update the scope of other controller. Another way to share Service in Angular is the factory method. Back to parent child structure in angular. If one controller is the parent controller, so you can simply change the scope of parent controller with the child controller like following:
Javascript Angular:
//instead of
$scope.variable = data;
//write
$scope.$parent.variable = data;
<div ng-controller="ParentCtrl">
<div ng-controller="ChildCtrl"></div>
</div>
//apiKey look in your cleverreach
$apiKey = "b#797###e8f6###25#########40d63#-#";
$wsdl_url="http://api.cleverreach.com/soap/
interface_v5.1.php?wsdl";
//listId look in your cleverreach
$listId = "1####8";
$api = new SoapClient($wsdl_url);
$page = 0;
do{
$filter = array( "page"=>$page++,
"filter"=>"all" //active, inactive, bounce
);
$return = $api->receiverGetPage($apiKey, $listId,
$filter);
if($return->status=="SUCCESS") {
for($i=0;$i < count($return->data);$i++){
var_dump($return->data[$i]->email);
}
}else{
//var_dump($return->message);
}
}while($return->data);
For getting time difference in postgres Timestamp Format
SELECT "Timestamp", "column", "column"
FROM "Database"."Table"
WHERE "Timestamp" > CURRENT_TIMESTAMP - INTERVAL '20 hours'
ORDER BY "Timestamp"
DESC
Change width of javascript c3.js charts, please insert following method for c3Config in javascript
var c3Config = {
size: {
width: <em>mywidth</em> },
...
}
The wheel does not have to be invented twice. JQuery in Javascript provides many features to build a modern page.
$(document).ready(function(){
$('div').show();
});
How to change TinyMCE editor configuration in Prestashop for making breaks instead of paragraphs by pressing enter
Insert following configuration in /js/admin/tinymce.inc.js
forced_root_block : false,
force_p_newlines : false,
force_br_newlines : true,