PEEL Shopping
Open source ecommerce : PEEL Shopping
get_product_price.php
Go to the documentation of this file.
1 <?php
2 // This file should be in UTF8 without BOM - Accents examples: éèê
3 // +----------------------------------------------------------------------+
4 // | Copyright (c) 2004-2015 Advisto SAS, service PEEL - contact@peel.fr |
5 // +----------------------------------------------------------------------+
6 // | This file is part of PEEL Shopping 8.0.0, which is subject to an |
7 // | opensource GPL license: you are allowed to customize the code |
8 // | for your own needs, but must keep your changes under GPL |
9 // | More information: https://www.peel.fr/lire/licence-gpl-70.html |
10 // +----------------------------------------------------------------------+
11 // | Author: Advisto SAS, RCS 479 205 452, France, https://www.peel.fr/ |
12 // +----------------------------------------------------------------------+
13 // $Id: get_product_price.php 46935 2015-09-18 08:49:48Z gboussin $
14 include("configuration.inc.php");
15 
16 if (empty($_POST) || empty($_POST['product_id']) || vb($_POST['hash']) != sha256('HFhza8462naf' . $_POST['product_id'])) {
17  die();
18 }
19 if (!empty($_GET['encoding'])) {
20  $page_encoding = $_GET['encoding'];
21 } else {
22  $page_encoding = 'utf-8';
23 }
25 $output = '';
26 $product_id = intval(vn($_POST['product_id']));
27 $attribut_list = vb($_POST['attribut_list']);
28 $size_id = intval(vn($_POST['size_id']));
29 $product_object = new Product($product_id, null, false, null, true, !is_user_tva_intracom_for_no_vat() && !check_if_module_active('micro_entreprise'));
30 $product_object->set_configuration(null, $size_id, $attribut_list, check_if_module_active('reseller') && is_reseller());
31 $product_id = intval(vn($_POST['product_id']));
32 $prix = $product_object->get_final_price(get_current_user_promotion_percentage(), display_prices_with_taxes_active(), check_if_module_active('reseller') && is_reseller(), false, false, 1, true, true, true);
33 if(!empty($_POST['product2_id'])) {
34  $product2_id = intval(vn($_POST['product2_id']));
35  $product_object2 = new Product($product2_id, null, false, null, true, !is_user_tva_intracom_for_no_vat() && !check_if_module_active('micro_entreprise'));
36  $product_object2->set_configuration(null, $size_id, $attribut_list, check_if_module_active('reseller') && is_reseller());
37  $prix += $product_object2->get_final_price(get_current_user_promotion_percentage(), display_prices_with_taxes_active(), check_if_module_active('reseller') && is_reseller(), false, false, 1, true, true, true);
38 }
39 $output .= fprix($prix, true);
40 if (!display_prices_with_taxes_active() || !empty($GLOBALS['site_parameters']['price_force_tax_display_on_product_and_category_pages'])) {
41  // !display_prices_with_taxes_active() : On n'affiche pas d'info sur la taxe sur le site si il est configuré en TTC, pour une présentation plus agréable.
42  // !empty($GLOBALS['site_parameters']['price_force_tax_display_on_product_and_category_pages']): L'admin a configuré l'affichage.
43  $output .= ' ' . (display_prices_with_taxes_active()?$GLOBALS['STR_TTC']:$GLOBALS['STR_HT']);
44 }
45 echo String::convert_encoding($output, $page_encoding, GENERAL_ENCODING);
46 
static convert_encoding($string, $new_encoding, $original_encoding=null)
Converts the character encoding of string $string to $new_encoding from optionally $original_encoding...
Definition: String.php:375
is_user_tva_intracom_for_no_vat($user_id=null)
is_user_tva_intracom_for_no_vat()
Definition: user.php:959
$attribut_list
output_general_http_header($page_encoding=null, $cache_duration_in_seconds=null)
Envoie les headers avant l'envoi du HTML.
Definition: fonctions.php:1528
$product_object
get_current_user_promotion_percentage()
Calcule la réduction générale applicable à un utilisateur et garde la valeur en session pour accélére...
Definition: user.php:939
if(!defined('IN_PEEL')) display_prices_with_taxes_active()
display_prices_with_taxes_active()
Definition: fonctions.php:23
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
$GLOBALS['page_columns_count']
if(!check_if_module_active('search')) $page_encoding
Definition: produit.php:23
vn(&$var, $default=0)
Variable nulle if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:110
fprix($price, $display_currency=false, $currency_code_or_default=null, $convertion_needed_into_currency=true, $currency_rate=null, $display_iso_currency_code=false, $format=true, $force_format_separator=null, $add_rdfa_properties=false, $round_even_if_no_format=false)
fprix formatte le prix donné en le convertissant si nécessaire au préalable et en ajoutant éventuelle...
Definition: fonctions.php:242
check_if_module_active($module_name, $specific_file_name=null)
Renvoie si un module est présent et activé ou non - Peut être appelé avant ou après le chargement d'u...

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:29:53 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.