Posts

Prestashop : quote module (devis)

ScreenshotPrestashopDevis

The quote feature  is  an implementation of a shopping cart within prestashop framework, without the price : we have designed this feature for specific groups, for which we deactivate the price display on the shop.

  • Deactivating price display for specific user group (below : group 2) is a long task that involves 2 different steps
    • in init.php : set the smarty variable around line 116
      $priceDisplayConfig = intval(Configuration::get('PS_PRICE_DISPLAY'));
      if($tmpCust->isMemberOfGroup(2)) $priceDisplayConfig = 3;

      And around line 155

      'priceDisplay' => $priceDisplayConfig
    • use the smarty $priceDisplay variable in the templates to hide prices and change the "cart' (panier in french) to "quote" (devis), example from homefeature.tpl
      {if $priceDisplay<3}{l s='Add to cart' mod='homefeatured'}{else} Ajouter au devis {/if}
  • Quote / Devis module and status :
    • Download and install the "devis" module [download id="7"]
    • create the mails/devis.html and mail/devis.txt and change texts according to your business
    • create the order status "devis en cours" in BackOffice >> Orders >> statuses, check the created id (12 here) and add the following line to config.inc.php :
      define('_PS_OS_DEVIS_EN_COURS', 12);
    • You can optionnally deactivate the order confirmation email in classes/PaymentModule.php, line 288-290, replace the send email to customer test by adding a new condition :
      	// Send an e-mail to customer
      if ($id_order_state != _PS_OS_ERROR_ AND $id_order_state != _PS_OS_CANCELED_ AND $customer->id
      AND $id_order_state != _PS_OS_DEVIS_EN_COURS)